ATR Stop loss help (Bollinger Bands)
-
Hi All,
Been working on a little project.
Logic Buy
When price crosses above Bollinger Band 20EMA (main line) buy.
I'm trying to figure out how to make the so that the SL will be placed below the Lower band. currently its working with a Fixed amount of pips but id like to make it dynamic and use an ATR but able to adjust the ATR in optimization
I'm new to making formulas and variables if that what it requires?
logic
ATR x 1.5 under the Lower band for a SL
TP is currently ATR x 2 cause I'm yet to figure out how to get it to close at the top of the band when it breaks out a bit.Anyone know of any examples of this in the formula or able to walk me through how to make this happen?
https://fxdreema.com/shared/g7BxUnVIc
Cheers
Deadllee -
@deadllee If I understand you correctly, what you want is that the bot will modify the SL for a buy just by moving is as new candles are formed, right? I don't catch why you want to combine the ATR then.
-
@deadllee First of all,you must convert atr value in pips therefore you have to multiply the value * 10000 if there is no yen in the symbol otherwise * 100.
-
@l-andorrà so basically I want the value of the ATR x 2 eg 20 pips to the placed from the lower band.
so under the lower band the atr value x 2 in pips will the stop + what ever distance from from the opening price.
so as the atr changes so will the stop for future orders rather then the fixed amount that's it doing atm 15 pips
so no trailing stop or profit.
atm the ea is running fine with a fixed amount of pips below the lower band. just want instead if fixed amount it dynamic using that ATR value x 2 (or what ever i want the times value. )
maybe the photo will help ?

-
the logic would be to place the desired stop loss into a varible, and then use a variable modification block, or formula block to create another variable, that is simple the value of first variable(ATR*20000) - 22 pips, and the modifed results would be your 2nd variable and new SL. From there, within the Buy block, you would set a custom pip value to your SL, then use the value selection and right click, selecting your final modified variable.
-
@jsauter86 Exactly. That is the way to do it.
-
thanks im getting better with my formulas and creating variables now, lol
-
@jsauter86 awesome thanks for this. now time to rip my hair out figuring out how to use all the blocks to make this work
do you have an examples I can look?
Cheers
Deadllee -
sorry it is too much for me to put into example right now, my brain is on another topic. variables are till very difficult for me to think about, and execution and testing is just as difficult.
-
here is a start...
https://fxdreema.com/shared/4ZcGA7aOb -
it is a little confusing since you mentioned lower band of bb
-
@deadllee This is a way to get the SL moved to the distance (without ATR) for buys:
