I'm running WealthLab 5.3.44
The following code does not work. Original time interval is 60 minutes.
QUOTE:
SetScaleCompressed(120);
DataSeries TheSeries = ATR.Series(Bars,5);
RestoreContext();
TheSeries = Synchronize(TheSeries);
PlotSeries(pane1,TheSeries,Color.Beige,LineStyle.Solid,2);
When the PlotSeries gets executed, the following error happens:
Runtime error: Plotted DataSeries has fewer bars than the Symbol being charted.Any idea why this does not work?
Further down in my code, it does appear that accessing the data directly from TheSeries may be working, because the program still works if I comment out the PlotSeries. However, I'm not yet sure it it works in the case of substituting SetScaleDaily() for SetScaleCompressed(120) because no trades get executed.
Is there a problem with SetScaleDaily when compressing an ATR series? Thanks,
jreality
Size:
Color:
Your mistake is that you used RestoreContext(), but never changed the Context. You need to RestoreScale() instead.
Size:
Color:
Ok, thanks. Will give it a try with RestoreScale instead.
EDIT: Works great, thanks!
Size:
Color: