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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    39 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X