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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    93 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    123 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    73 views
    0 likes
    Last Post PaulMohn  
    Working...
    X