Stop Loss a days

Questions about MultiCharts and user contributed studies.
Rangers1970
Posts: 4
Joined: 03 Nov 2022
Has thanked: 1 time

Stop Loss a days

Postby Rangers1970 » 03 Nov 2022

Hello at all
I would like to know if it is possible to add an atr stop loss at time for my strategy
example after my entry day for 5 days use stop loss atr
after a different stop loss
thx

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Stop Loss a days

Postby syswizard » 05 Nov 2022

Yes, it can be done. You must use some fancy date arithmetic that takes into account the weekends and the holidays.
If Date < LastDateOf5 Then
SetstopLoss(ATR(5))
Else
SetstopLoss(500);

You must create a function that will determine the LastDateOf5 based on the CurrentDate.


Return to “MultiCharts”