This indicator plots five different time frames as a stacked chart. The circles or dots at the bottom represent the difference between the closing price of each time frame and its associated pivot price [(high + low + close)/3]. The value plotted at 4, in this case, represents the 5 minute time frame. The 10-minute time frame is represented by the plot at 3 and so on. The value plotted at 7 represents the composite of all the time frames. It is only turned on if all times are either red or green. If there is a disagreement then nothing is plotted.
This indicator is relatively simple even though the plot looks complicated. You have to make sure the indicator is plotted in a separate pane. The y – axis has 0 and 8 as its boundaries. All you have to do is keep track of the highest highs/lowest lows for each time frame. I use a multiplier of the base time frame to create different time frames. TimeFrame1Mult = 2 represents 10 minutes and TimeFrame2Mult = 3 and that represents 15 minutes. The indicator shows how strong the current swing is across five different time frames. When you start getting a mix of green and red dots this could indicate a short term trend change. You can use the EasyLanguage to plug in any indicator over the different time frames. Here’s the code. Just email me with questions or if you see a mistake in the coding.
{EasyLanguage MultiTime Frame Indicator) written by George Pruitt - copyright 2019 by George Pruitt }
If condition10 then setPlotColor(1,Green) else SetPlotColor(1,Red); If condition11 then setPlotColor(2,Green) else SetPlotColor(2,Red); If condition12 then setPlotColor(3,Green) else SetPlotColor(3,Red); If condition13 then setPlotColor(4,Green) else SetPlotColor(4,Red); If condition14 then setPlotColor(5,Green) else SetPlotColor(5,Red);
condition6 = condition10 and condition11 and condition12 and condition13 and condition14; Condition7 = not(condition10) and not(condition11) and not(condition12) and not(condition13) and not(condition14);
If condition6 then setPlotColor(7,Green); If condition7 then setPlotColor(7,Red);
If condition6 or condition7 then plot7(7,"trend");
Subscribe to get the latest posts sent to your email.
10 thoughts on “Programming a Multi-Time Frame Indicator in EasyLanguage”
Hi George, a very interesting approach to build data for several different timeframes from only data1. Should reduce workarounds due to limitations in Tradestation when several data streams are used.
I can´t see that the variable mtf1o(0), mtf2o(0) …. is used. Is that to be able to use open data for different timeframes in coming versions?
How would best practice to store open data for each timeframe be coded?
And thanks for your valuable efforts to educate through your books and this webpage.
Thanks for your post and question. I didn’t need the open for this analysis but I am sure others will in the future. Add this code and it should do it. You want to store the open tick for each time frame and carry it over for the entire time period before changing it again. I use the modulus function to determine the first time stamp of each time frame. Hope this helps.
And thanks for your prompt reply. I will try both this version and also the discrete time frame version and compare the results. Always interesting to understand more about different logic and what result they give. MTF logic can really be tricky to code, but be the filter that gives the edge for a really good trading system.
Many thanks for your answer and we out here, are eager to follow your work.
Sorry for the delay. Noting yet for the PINE editor. I have played around with it, but haven’t drilled down deep enough to translate this indicator. If I do I will post. Best.
This is the one I have been looking for a long time to code a MTF indicator. it is very simple but more powerful than using multiple data stream and PSP. I really love your powerful code Mr. George. It is so wonderful that I can\’t sleep until now almost 3 AM. Thank you so muchhhhhhhh for your sharing. May God always bless you.
Just wondering if this can work with charts plotted in Mean Renko format, or what changes might be required? When I plot the code using Multicharts on my Renko charts, each indicator line is identical, and only reflects the actual base timeframe.
Sorry for the late reply. I don’t know much about non time based charts such as Renko. Initially thinking about it I don’t think it would work. Let me do some research. Shoot me an email at george.p.pruitt@gmail.com in a week or two and I will let you know what I found out.
George Pruitt’s Easing into EasyLangauge – Academy
A video-based approach to teaching EasyLanguage. Learn at your own pace.
Module #1
and Pattern Smasher 2024 too!
From the creator of the bestselling Easing into EasyLanguage series comes his latest project – Easing into EasyLanguage Academy. In this introductory course, George shows you to program a George Taylor Technique into a day trading system. You will start with a blank slate and learn everything you need to take advantage of Taylor’s Buy and Short – day techniques. Give the gift the keeps on giving – knowledge.
Can You Program This Trading Strategy?
Imagine this: On a buy day, you want to:
Enter: Place a buy order for tomorrow if the market:
Trades a certain amount below today’s low, and
Then travels back up to today’s low.
Protect: Use a protective stop at tomorrow’s low (before the buy stop is triggered).
Risk Manage: If the entry and exit levels are too large, limit your risk to a predefined amount.
Profit Secure: When a specific profit level is reached, implement a ratcheting trailing stop to lock in a percentage of the maximum open trade equity.
Time Manage: If still in the trade at a specific time of day, exit the position.
PURCHASE NOW AND GET PATTERN SMASHER 2024 FOR FREE!
Learn how to do this and then pick intelligent and robust paremeter sets.s
Get the Pattern Smasher Cheat Code to create this strategy. This is a 4 Pattern relationship based on the last three day’s closing relationships. You can learn more at George’s Digital Store.
Hi George, a very interesting approach to build data for several different timeframes from only data1. Should reduce workarounds due to limitations in Tradestation when several data streams are used.
I can´t see that the variable mtf1o(0), mtf2o(0) …. is used. Is that to be able to use open data for different timeframes in coming versions?
How would best practice to store open data for each timeframe be coded?
And thanks for your valuable efforts to educate through your books and this webpage.
Hi Goran,
Thanks for your post and question. I didn’t need the open for this analysis but I am sure others will in the future. Add this code and it should do it. You want to store the open tick for each time frame and carry it over for the entire time period before changing it again. I use the modulus function to determine the first time stamp of each time frame. Hope this helps.
Hi George,
And thanks for your prompt reply. I will try both this version and also the discrete time frame version and compare the results. Always interesting to understand more about different logic and what result they give. MTF logic can really be tricky to code, but be the filter that gives the edge for a really good trading system.
Many thanks for your answer and we out here, are eager to follow your work.
Best regards
Goran
Hi George,
Do you have the corresponding Pine script for this MTF indicator ?
Sorry for the delay. Noting yet for the PINE editor. I have played around with it, but haven’t drilled down deep enough to translate this indicator. If I do I will post. Best.
Rahul
in Pine you can just use security() function to access MTF data. its a lot easier.
Hi Rahul,
Thanks for the information. Do you have a PINE script that replicates this? I would love to see it.
Best,
George
This is the one I have been looking for a long time to code a MTF indicator. it is very simple but more powerful than using multiple data stream and PSP. I really love your powerful code Mr. George. It is so wonderful that I can\’t sleep until now almost 3 AM. Thank you so muchhhhhhhh for your sharing. May God always bless you.
Hi George,
Just wondering if this can work with charts plotted in Mean Renko format, or what changes might be required? When I plot the code using Multicharts on my Renko charts, each indicator line is identical, and only reflects the actual base timeframe.
HI Adrian,
Sorry for the late reply. I don’t know much about non time based charts such as Renko. Initially thinking about it I don’t think it would work. Let me do some research. Shoot me an email at george.p.pruitt@gmail.com in a week or two and I will let you know what I found out.
Thanks,
George