I'm trying to use the SwingRays2b indicator in a strategy to provide that the last swinglow using this indicator. I used the Strategy Builder to get the basic code, but when I transfer it into my strategy, I'm not getting any results. So then I tried to just get it to plot the indicator and I'm getting an error. Here is my code.
Under Startup:
private SwingRays2b SwingRays2b1;
Under State Date Loaded:
SwingRays2b1 = SwingRays2b(Close, 5, false, false, 1);
AddChartIndicator(SwingRays2b1);
Here is the error I get.
Indicator 'SwingRays2b': Error on calling 'OnBarUpdate' method on bar 0: Object reference not set to an instance of an object.
The strategy does run, but it does not plot the SwingRays. Eventually I want to get the last SwingLow using this indicator. I'm not sure that is an option, but first things first as I'm just trying to get it to plot the inidcator.
Thanks,
Lee
Comment