Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to place an initial stop?

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

    How to place an initial stop?

    Hello i used following code to place an initial stop with the variable initialstop being an int with 30 ticks as default setting:

    if (order.Action==Action.Buy &&
    order.OrderState==OrderState.Filled

    )
    {

    SetStopLoss("long", CalculationMode.Ticks, initialstop, false);

    }

    when there is a long trade the position gets immediatly terminated, and NT reports in the execution list that a stop was rejected (the stop price NT tried to place was the exact entry price of the last long trade which was higher than todays entry price)

    so would i have to place a stoploss order properly?

    #2
    Hi tradereight, if you have a static Stop Loss you should put it into the Initialize() section of your code, if you vary it dynamically the OnBarUpdate() is good, however take proper care to reset your Stop Loss to your defaults once you are flat - the reference sample may be of help > http://www.ninjatrader-support2.com/...ead.php?t=3222

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X