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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      132 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X