This block of code in OnMarketData fails:
if (Position.MarketPosition != MarketPosition.Flat) {
Draw.Ray(this, "AskLine", false, 1, Close[0]+PriceTarget/Instrument.MasterInstrument.PointValue, 0, Close[0]+PriceTarget/Instrument.MasterInstrument.PointValue, Brushes.Blue, DashStyleHelper.Solid, 2);
Draw.Ray(this, "BidLine", false, 1, Close[0]-PriceTarget/Instrument.MasterInstrument.PointValue, 0, Close[0]-PriceTarget/Instrument.MasterInstrument.PointValue, Brushes.Red, DashStyleHelper.Solid, 2);
}
The failure is related to the test Position.MarketPosition != MarketPosition.Flat. Error is "An object reference for the non-static field... CS0120
Should this work?

Comment