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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      88 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      34 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      68 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X