Multitimeframe strategy

Questions about MultiCharts and user contributed studies.
Jonny473
Posts: 68
Joined: 04 Apr 2016
Has thanked: 5 times
Been thanked: 1 time

Multitimeframe strategy

Postby Jonny473 » 05 Jan 2017

Happy new year everyone!

Here is another question for the experts:

Lets say I have a multtimeframe strategy and the 2 higher Timeframes give me signals independent from the lower TF. These higher signals shall be "stored" as the lower Timeframe shall only trade once the "higher" signal is still valid. So the conditions for the lower data stream have nothing to do with the ones from the higher data streams. How can I implement that in one strategy? Can I just "store" the higher TF signal in a condition and use a "while loop" so the signal does not vanish as we move on along the bars? Do you get my idea?

Best regards
Jonas

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Multitimeframe strategy

Postby tony » 05 Jan 2017

When you declare and initialize your variables you need to reference the data set in which they are associated. Data 1 is the top chart, the chart in which you signal off. The other data sets / sub charts are associated with conditional statements that are used to generated signals for Data 1. Be careful with intrabar strategies using multiple data sets. Unless it has changed, which I don't believe it has. Data 1 can calculate on every tick, whereas Data2, etc will only calculate on OHLC so you will not have accurate backtests. If you reference prior bars (i.e. closed bars) for Data2, etc then no issue, but if you need to signal off open Data2, etc bars, then be careful.

MAZINGUER
Posts: 75
Joined: 06 Jan 2017
Has thanked: 9 times
Been thanked: 25 times

Re: Multitimeframe strategy

Postby MAZINGUER » 06 Jan 2017

"While" is for looping.
Maybe the use of switches is better.
Have a look at this
viewtopic.php?t=50410

But keep in mind that I am not an expert
Greetings and happy new year

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Multitimeframe strategy

Postby TJ » 06 Jan 2017

All about Loops and Nests... (A Primer)

viewtopic.php?t=7351


Return to “MultiCharts”