Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying setstoploss and setprofittarget in the chart

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

    Modifying setstoploss and setprofittarget in the chart

    Hi, i have the following code that trigers a limit entry with stop and target and i would like to know how can i modify the stop and target on the chart? Each time i modify it it goes back to the programmed level on each bar update.
    Thanks for your help:

    if(ShortTrigger && SentryOrder == null && Close[1]>Open[1] && Close[0] < Open[0]
    && Position.MarketPosition == MarketPosition.Flat)
    {
    Starget = (int)((High[0]-Close[0])/TickSize);
    SetStopLoss("Short",CalculationMode.Price, High[0]+TickSize, false);
    SetProfitTarget("Short",CalculationMode.Ticks,Star get , false);
    EnterShortLimit(0, true, contracts, Close[0], "Short");
    }​

    #2
    Hello cbadr,

    Set methods are managed by NinjaTrader and are not intended to be managed by the user. If you modify an order submitted by a set method, the action will be undone the next time the Set method updates.

    Use Exit order methods with isLiveUntilCancelled as true instead if you intend to manually manage these.

    Attached is an example.
    ManuallyModifiableStopTargetExample_NT8.zip
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much for the help.

      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