I am hoping you can help me figure out a problem I am having getting realtime strategy trades to show up in the SystemPerformance object. In version 8.0.0.12 standard beta, had same problem in .11 over last few days. Not sure if this is code problem or maybe corruption problem.
private bool entryPlaced = false; protected override void OnBarUpdate() { if (State == State.Realtime) { if (Position.MarketPosition == MarketPosition.Flat) { Print(CurrentBar + " Position is FLAT and AllTrades Count is "+SystemPerformance.AllTrades.Count); if (!entryPlaced) { EnterLong(); SetStopLoss(CalculationMode.Ticks, 2); SetProfitTarget(CalculationMode.Ticks, 2); entryPlaced = true; } } else Print(CurrentBar + " Position is NOT FLAT and AllTrades Count is "+SystemPerformance.AllTrades.Count); } }
7039 Position is FLAT and AllTrades Count is 0
7/11/2016 11:46:12 PM Strategy 'LongPlacerTestSync/70812310': Entered internal SubmitOrderManaged() method at 7/11/2016 11:46:12 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
NinjaScript strategy 'LongPlacerTestSync/70812310' submitting order
7/11/2016 11:46:12 PM Strategy 'LongPlacerTestSync/70812310': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=2 IsSimulatedStop=False IsMarketIfTouched=False
7/11/2016 11:46:12 PM Strategy 'LongPlacerTestSync/70812310': Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=2 IsSimulatedStop=False IsMarketIfTouched=False
NinjaScript strategy 'LongPlacerTestSync/70812310' submitting order
NinjaScript strategy 'LongPlacerTestSync/70812310' submitting order
7039 Position is NOT FLAT and AllTrades Count is 0
7039 Position is NOT FLAT and AllTrades Count is 0
7040 Position is NOT FLAT and AllTrades Count is 0
7040 Position is FLAT and AllTrades Count is 0
7040 Position is FLAT and AllTrades Count is 0
Disabling NinjaScript strategy 'LongPlacerTestSync/70812310'
Comment