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 kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      59 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      41 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      46 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      37 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      157 views
      0 likes
      Last Post SalmaTrader  
      Working...
      X