Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie question for Enter()/Exit()

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

    Newbie question for Enter()/Exit()

    Hello,

    I'm porting a strategy from another platform to NinjaScript, I'm not a trading expert but only a software developer.

    When backtesting my script I can't figure out why, when I call EnterLong()/EnterShort(), the position is opened on the next bar instead of the current (as happened on the old platform).
    What am I missing?

    Thanks
    Roberto

    #2
    Welcome to our forums Roberto, this would be expected with NinjaTrader as take the conservative approach to filling orders in backtesting - a signal is generated by your code on bar 0 can only be executed on bar 1 then, as the bar first needs to be fully closed in order to trigger the signal, so this really is the first possible trade location we can conservatively offer.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    117 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    413 views
    0 likes
    Last Post CaptainJack  
    Working...
    X