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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X