The problem is, assuming the primary timeframe is 10min chart, Add() two additional, hourly and 2min of the same instrument to the indicator.
If the logic is to compute something (same logic for all three), store the results somewhere, then the main one (10min) will also do the 2nd pass of the logic, based on the current states gathered from the other two, and its own.
The 'states' are stored in one list per time frame, and the lists are stored in a static array so 10min one can reference all of them. This is not the problem.
Something like
All will need to do
Part1( mylist); // my list to store the states
then
the 10min will do
Part2();
The problem is, when the 10min is ready to do the trade logic computation based on 'current states of all three', how to ensure the 10min's OnBarUpdate is called AFTER the hourly and 2-min.
I am not using OnBarClose true, I will maintain my own tick count and maybe do the real thing every, say 133ticks.
The problem still exists if I am doing my counting every 133k, i.e., I want to have the hourly and the 2-min execute its logic and update the states before the 10min do its work.
One thing I can do is to let 10min do ALL the work, including those of hourly and 2min, but this means I will need to write three versions of the Part1() code.
Suggestions?
Comment