I'm using a muti-timeframe strategy to enter and exit my trades (Eg entering on a 5min setup and exiting on a 1min scenario). Specifically, I have set some 5min exits and some 1min exits.
So far, the code seems to be behaving rather well when I use the prescribed settings of BarsInProgress, BarsArray, High / Highs etc.
However, the trade Exits get flaky When I use the BarsSinceEntry multi-timeframe function and its 3 overloads, and what was supposed to have been exited on a 1min timeframe gets confused with the 5min one.
Please let me know if my understanding is correct:
eg: BarsSinceEntry (1,"",0) > 5
translates into: if more than 5 time periods have passed since the last entry on the secondary data series
Can you tell me how to fit in entryName and entriesAgo using my example? The most recent entry in all cases would have been on the primary 5min data series.
I have also uniquely labeled all the entries in a way that every open position at that point in time has its own name. Eg. "A", "B" (from a different market), "C" as the pyramiding increment of "A", each entered on a 5min timeframe
Thanks
Comment