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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    144 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X