Multi timeframe indicator passses output value for default session template
Hello! After a lot of hours trouble shooting, I belive that I have found an unexpected behaviour when referencing a multi timeframe indicator in a another indicator. The problem seems to be that the output value from the multi timeframe indicator always is calculated for the the default session template of the instrument, eaven when it's attached to a chart of another session template.
I have created a simple indicator that plots the SMA(20) for the 5, 10 min, 20 min, 60 min timeframes and added the indicator to a 5 min chart. This indicator calculates an output value that is the number of timeframes above the SMA(20) of the base period. The output series can be between 0 and 3. When I reference the output IntSeries in another indicator, the output value is calculated for the default session template of the instrument, although both indicators are attached to a chart with the ETH session template. I can see this for sure when I compare the print statments in the multi timeframe indicator for the same bar that is printed twice, since it also prints when the second indicator calls the first indicator. The output values differ. The multi timeframe indicator is plotted correctly in the ETH time frame. But when the output value is referenced by another indicator, it passes an output value for the RTH instead of the ETH, as expected.
/regards
Last edited by poseidon_sthlm; 01-07-2011 at 10:14 AM.
|