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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X