Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamic Stop Profit

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

    Dynamic Stop Profit

    Hello

    I'm running an automated strategy and rather than going for a fixed or a trailing Stop Profit, I'd like to pin it to a Moving Average. Example:

    The strategy enters a long position at the price of 950. The 50 SMA is at 970 at this time, ie the Stop Profit is 970 as well. 30 minutes later, the 50 SMA is at 965 and the market is at 965 as well, ie the market has hit the 50 SMA and this must trigger the Stop Profit. How can such a dynamic Stop Profit be developed?

    Thanks.

    #2
    laocoon, for this you can just call for example SetProfitTarget again in CalculationMode.Price and then put your desired SMA value in there to use, this call would be done in OnBarUpdate() to dynamically update the target price.

    Comment


      #3
      Thanks Bertrand, will look into it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      17 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      120 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      174 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      92 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      134 views
      0 likes
      Last Post cmoran13  
      Working...
      X