I use an indicator hosted in a Stretegy. The scheme is as follows:
-The indicator has 10 AddDataSerires() based on 15 minutes, calculated on bar close. The indicator calculates some parameters from the prices of these 10 series regardless of the Primary (BarsArray[0]) Instrument. This works fine, whenever I load this indicator on a chart produces the expected output.
-The strategy works at much higher frequency, calculated on each tick from 1 minute bars, and needs some variables from the indicator above as they become accesible. However, the strategy does not need the 10 dataseries at all, but following the Hosted recommendation of the documentation, I added them too.
The weird thing is (Debugged with VS):
When I load the Strategy on Strategy Analyzer, this is what happens:
1) Strategy State.Configure is hitted
2) Strategy State.DataLoaded is hitted
3) Indicator State.Configure is hitted
4) Indicator State.DataLoaded is hitted
5) Strategy OnBarUpdate is executed for all the ticks and never produces any entry. this is because the indicator never computed anything since its OnBarUpdate Method never was called
6) When Strategy ends, the indicator starts to compute its bars, inside OnBarUpdate but it is too late because The strategy has already ended.
What I would like is to have step 5) and 6) in parallel. I can achieve this if I change the referenced Indicator. If the Strategy used for example another indicator that does not call AddDataSerires(), then I can see step 5) and 6) in parallel
Of course 1 solution would be writting the Indicator's code in the Strategy but I would like to solve it in another way.
Thanks in advance!
Comment