Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot modify SetStopLoss and a SetProfitTarget.

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

    Cannot modify SetStopLoss and a SetProfitTarget.

    Hello
    in the strategy, a SetStopLoss and a SetProfitTarget are defined
    when an order is executed, i cannot be modified.
    this means if you i move them with the mouse, they return to their initial place
    Is there a solution to change them after order is executed?
    Thank you in advance

    #2
    Hi aekzof, thanks for writing in. You must use an Exit method with the int barsInProgressIndex parameter overload. E.g.

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

    This will keep the order alive without needing to re-submit on every bar so you can move it around. This should be set after placing the entry order.

    Comment


      #3
      Merci .

      Comment


        #4
        Hi Chris,

        on the above, how do I set the 'double stop price' in the ExitLongStopMarket to an indicator such as an EMA? Do I just put the EMA[Close, 0] as the 'double stop price' or do I need to load the EMA into a variable and set that variable in the 'double stop price'? Looking to have that Limit order appear and 'move' in the same way it would when I attach an order to an indicator from that 'attach to an indicator' chart function.

        Comment


          #5
          Hello Austiner87,

          When you see double as a parameter that means you can use any double type number, indicators return double type numbers so that could be used.

          If the price of the EMA makes sense for the order used you could just specific the indicator directly;

          Code:
          ExitLongStopMarket(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, [B]EMA(12)[0][/B], string signalName, string fromEntrySignal);
          If that price gives errors like the order was placed on the wrong side of the market then you would need to use a variable in that case to calculate a correct price or check if the price you used is on the correct side of the market before submitting the order.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          56 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          133 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 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
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X