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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X