Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close[0] price is showing erratic values

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

    Close[0] price is showing erratic values

    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


    #2
    Hello, thanks for writing in. If your script does not add any extra series, you can set the Order Fill Resolution to High>1 Tick to improve the order fill accuracy in your backtest. See here for more information on intrabar granularity:

    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by poplagelu, Today, 05:00 AM
    0 responses
    3 views
    0 likes
    Last Post poplagelu  
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,407 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    98 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    160 views
    0 likes
    Last Post loganjarosz123  
    Working...
    X