Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLossOrder

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

    StopLossOrder

    Hi,

    I'm putting an EnterLongStop at each bar within OnBarUpdate().
    Same for a stop loss. (Backtest)

    EnterLongStop(1, buystop2,"entry long");
    SetStopLoss("entry long",CalculationMode.Ticks, Range()[0]*0.5/TickSize, false);

    Whenever the order is filled, the stop loss occures at Open of the entry bar.
    Exit woud normally take place at the following Open.

    Why is that? Are there any pending stop loss orders due to orer submission at every bar that cause that behaviour. Do I have to use OnExecution() and OnOrderupdate() for proper working SLs?

    #2
    Hello Stephan,

    Thank you for your post.

    When the entry is filled the StopLoss is placed at the same bar of the entry.
    Since the backtest is working off of CalculateOnBarClose and if the same bar goes through the StopLoss price it will get filled on the same bar.

    You may want to add a condition to wait a couple bars before placing the StopLoss or increase the StopLoss amount.

    BarsSinceEntry() would help accomplish this -
    http://www.ninjatrader.com/support/h...sinceentry.htm
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    575 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X