Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close[0] price is inconsistent

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Close[0] price is inconsistent

    Hello

    Can you please help on the below....

    Close[0] price is showing erratic values when added to the chart window for simulation account.

    The logic is written in the OnBarUpdate() event....

    On the strategy back tester it seems to work fine. But when i tested on the chart in simulation mode the prices are jumping all over the place when using the print statement. Shown below the script output logs...

    Disabling NinjaScript strategy 'AGStrategy1/268369812'
    Enter Initial Long : Close[0] : 4131.25 Qty : 0 Average Price : 0
    Enter Additional Long Close[0] : 4089.5 Qty : 1 Average Price : 4131
    Enter Additional Long Close[0] : 4067.75 Qty : 2 Average Price : 4110.25
    Exit Long Close[0] : 4138 Qty : 3 Average Price : 4096.16666666667
    Enter Initial Long : Close[0] : 4137.25 Qty : 0 Average Price : 0
    Exit Long Close[0] : 4178.5 Qty : 1 Average Price : 4137
    Enter Initial Long : Close[0] : 4171.25 Qty : 0 Average Price : 0
    Enter Additional Long Close[0] : 4121.75 Qty : 1 Average Price : 4171.25
    Enabling NinjaScript strategy 'AGStrategy1/268369813' : On starting a real-time strategy - StartBehavior=WaitUntilFlat Position=MES 03-23 2L EntryHandling=All entries EntriesPerDirection=10 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=False SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On bar close IsUnmanaged=False
    MaxRestarts=4 in 5 minutes


    Script settings attached​
    Attached Files

    #2
    Hello salaimuthumdu,

    This type of question would be impossible to answer without seeing the code compared to the prints. We would need to see how the close price is being used in your logic and where your prints are to get a better idea of what may be happening.

    Comment


      #3
      ok will share
      Last edited by salaimuthumdu; 02-15-2023, 06:44 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X