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.

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand, will look into it.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      179 views
      0 likes
      Last Post jeronymite  
      Started by ghoul, Today, 06:02 PM
      0 responses
      9 views
      0 likes
      Last Post ghoul
      by ghoul
       
      Started by Barry Milan, Yesterday, 10:35 PM
      6 responses
      19 views
      0 likes
      Last Post Barry Milan  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      13 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Working...
      X