Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set SL/TP based on ATR in Strategy Builder (no-coding)

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

    Set SL/TP based on ATR in Strategy Builder (no-coding)

    Hi,
    I have created a strategy that enters the market based on MACD cross signal if the price is above/below a few moving averages.
    Now, for the SL/TP I would like to use ATR value (1.5 ATR for the stoploss and 3 ATR for the profit target).

    For example, my '1 Set' is the conditions to enter SHORT,
    Then in 'Do the following' I have 'Enter Short' and for the SL/TP
    I have created variables: 'StopLossPrice' and 'TakeProfitPrice', where I am setting the SL/TP prices with the relevant offset from the last 'Close price' based on the ATR.

    Then in '2 Set' conditions if 'current market position is short',
    Do the following 'Exit short stop market' = 'StopLossPrice' from above and
    'Exit short limit' = 'TakeProfitPrice' also from above.

    Then when I am testing it, it looks not accurate. What am I doing wrong?

    Thanks, Ilya.

    #2
    Hi Ilya, thanks for writing in. The ATR has very small values relative to most futures instruments. E.g. it would not work to set a stop and target for say 5.75 ATR on the ES which is around 4000 dollars at the moment. You would need to add/subtract the ATR value from the price of the ES but its not possible to do arithmetic in the builder, your script would need to be unlocked to do this e.g. ExitLongStopMarket(Close[0]-ATR(14)[0]);

    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    131 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
    44 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