implementing TrendLines code in my tick replay strategy, run it on a chart, the rays are not generated for historical data
Hi Friends!
The trendlines indicator is implemented by adding the TrendRay and TrendQueue classes and queueing up rays from OnBarUpdate().
I want to expand on this concept in a strategy so I copied the code (changing names along the way).
When I run the strategy in the strategy analyzer, it works as expected, but when I run the strategy in a chart, the trendlines are not Enqueued or drawn for the historical part of the data, just the real time.
How can I fix that?
I suspect this is easily answered so only a brief overview of the code here, but I would be happy to elaborate if necessary.
The strategy has Bars[0] = minute bars and Bars[1] = BarsPeriodType.Tick, 1
And the code looks kind of like this..
OnBarUpdate(){ if (BarsInProgress == 0) if (IsFirstTickOfBar) { if( swing.SwingHighBar(1, 1, Strength + 1) != -1 ){ if( various conditions ) trendLines.Enqueue(highTrend); } } }
Comment