It compiles fine , but I get Error on calling 'OnStateChange' method Object: reference not set to an instance of an object.
Here is the code that I think is the issue
EMA1 = EMA(Close, 9);
VWAP1 = VWAP(Close);
VWAP2 = VWAP(Close);
CurrentDayOHL1 = CurrentDayOHL(Close);
Stopticks =(int)((VWAP2.PlotVWAP[0] - CurrentDayOHL1.CurrentLow[0])/3);
BarCounter1 = BarCounter(Close, true, Brushes.Gray, 14, 50, true);
SetStopLoss(@"Long",CalculationMode.Ticks, Stopticks, false);
SetProfitTarget(@"Long", CalculationMode.Ticks, Stopticks);
Comment