MTF Indicators - futures io

# Discussion in EasyLanguage Programming

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

 Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
 Genuine reviews from real traders, not fake reviews from stealth vendors Quality education from leading professional traders We are a friendly, helpful, and positive community We do not tolerate rude behavior, trolling, or vendors advertising in posts We are here to help, just let us know what you need You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple. -- Big Mike, Site Administrator (If you already have an account, login at the top of the page)

# MTF Indicators

Singapore

Experience: Beginner
Platform: Multicharts, R

Posts: 185 since Feb 2010

MTF Indicators

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 = 1else if (DayEma[0] < DayEma[1]) then    trend = -1else if (DayEma[0] = DayEma[1]) then trend = 0else 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[1 + Mod(BarNumber -1,  24)]) then    trend = 1else if (DayEma[0] < DayEma[1 + Mod(BarNumber -1,  24)]) then    trend = -1else if (DayEma[0] = DayEma[1 + Mod(BarNumber -1,  24)]) then trend = 0else 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

Can you help answer these questions
from other members on futures io?

in the last 7 days on futures io
 What is your single biggest weakness?95 thanks Spoo-nalysis ES e-mini futures S&P 50091 thanks Is Volume Profile worth learning or is it an outdated concept?57 thanks Is Amp at risk of going under?36 thanks Is Orderflow An Outdated Concept?30 thanks

Platform: My own custom solution

Posts: 48,755 since Jun 2009

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

 #4 (permalink) St. Petersburg, Russia     Posts: 30 since Nov 2010 Thanks: 6 given, 18 received 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.

 futures io > MTF Indicators

Upcoming Webinars and Events

June

## Every journal equals ten meals for the hungry

June

 Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io 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.
no new posts