NexusFi: Find Your Edge


Home Menu

 





MTF Indicators


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 1 posts (0 thanks)
    2. looks_two diverdan with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Doctor Leo with 1 posts (0 thanks)
    1. trending_up 4,199 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 diverdan 
Singapore
 
Experience: Beginner
Platform: Multicharts, R
Trading: EUR / USD
Posts: 185 since Feb 2010
Thanks Given: 106
Thanks Received: 99

Hi

I have created a MTF signal in MC, one timeframe (for trend) is the daily chart and the other for trading is 60 minute chart.

I have defined the trend based upon the daily chart using:
 
Code
                            
if (DayEma[0] > DayEma[1]) then
    trend 
1
else if (DayEma[0] < DayEma[1]) then
    trend 
= -1
else if (DayEma[0] = DayEma[1]) then trend 0
else trend trend
However this only worked for one hour bar in the day i.e. when the session ended. Otherwise DayEma[0] = DayEma[1].

I sort of solved the problem by calculating the hour bar to reference back to the end of the session to get the correct daily EMA value:

 
Code
                            
if (DayEma[0] > DayEma[Mod(BarNumber -1,  24)]) then
    trend 
1
else if (DayEma[0] < DayEma[Mod(BarNumber -1,  24)]) then
    trend 
= -1
else if (DayEma[0] = DayEma[Mod(BarNumber -1,  24)]) then trend 0
else trend trend
This would work for time based trade charts but not any exotic bar types (e.g. Range).

Does anyone know how to solve this elegantly?

Cheers,

Daniel


Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583


I just use a

 
Code
                            
if date <> date[1
block in my code for processing new day events. It may work here too, I'm not 100% sure what you are trying to do.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
Doctor Leo
St. Petersburg, Russia
 
Posts: 30 since Nov 2010
Thanks Given: 6
Thanks Received: 20

I think I realize the root of the problem. When you use any indicator from a higher timerame on a lower one you have equal values for all bars except the first corresponding to the higher timeframe bar. And you seem to want the condition like ma1 > ma2 be true over the whole lower timeframe span (day in your example). If my guess is true then it's very easy to implement. You simply write:

ma1 = xaverage(close of data2, N);
condition1 = ma1 of data2 > ma1[1] of data2;

In this case the condition should be true during the whole day on the lower timeframe.

Hope this helps. If this is not what you're looking for please ask for more, I'll try to help.


Reply With Quote




Last Updated on November 13, 2010


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts