Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitShortStop

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

    ExitShortStop

    Dear Support

    i have strategy activating a ExitLongStopMarket.
    The order is put correctly however in the next bar update it gets cancelled.

    you can see in the screenshot attached

    this is my code below

    Code:
    if (StopLossSet == 0 && Position.GetUnrealizedProfitLoss(PerformanceUnit.P oints, Close[0]) > 0.25 && Close[0] >= EMA200[0])
    {
    Print("Position Hit EMA200, Set Exit Stop Market Order 0.25 above Average Price");
    ExitLongStopMarket((int)CalculationMode.Price, (Position.AveragePrice + 0.25));
    StopLossSet = 1;
    }
    Then When the market position is flat i reset the variable flag to 0 -> StopLossSet = 0;

    So this ExitLongStopMarket gets ran only one time, since what i want is to set it and let the price continue ging up or closing with 1 tick profit.
    but i dont know why is getting cancelled as soon as next bar is created.

    what am i doing wrong?

    Thanks
    Last edited by jimmy_NT; 05-19-2022, 11:38 PM.

    #2
    here is the screenshot

    Comment


      #3
      Hi jimmy_NT, thanks for posting. Use the advanced overload to keep resting orders alive:

      ExitLongStopMarket(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName, string fromEntrySignal)

      This overload lets you keep the order alive. Other resting orders will be canceled on the close of every bar unless they are resubmitted each bar.

      Kind regards,
      -ChrisL

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 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
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X