I am not able to execute strategy as soon as I use Close[2] or Open[2] , last 3rd Candle values to compare with Open or Close of current candle or 2nd last candle 1.
Here is the statement causing issues in the Log.
if (Close[2] < Open[2] && Close[1] > Open[1] && Close[0] > Close[1] && Low[1] < Low[2])
{
Bull_123_Bar = true;
}
Here is the log I get.
Strategy 'A1_M': Error on calling 'OnBarUpdate' method on bar 1: Object reference not set to an instance of an object.
Strategy 'A1_M': Error on calling 'OnBarUpdate' method on bar 1: Object reference not set to an instance of an object.
Strategy 'A1_M': Error on calling 'OnBarUpdate' method on bar 1: Object reference not set to an instance of an object.
Please advise how do i make use of last 3 to 4 candles open and close data.
Thanks,

Comment