I’m stumped on this one!
-
Hi everyone,
I’ve spent the weekend trying to solve this problem and I’ve got nowhere so I’m hoping someone may be able to help me onto the right path.
Essentially I’ve setup an EA that once the criteria’s are met it sets the stop loss and take profit for the weekly swing high and low using a custom indicator that’s shows this. That all works fine EXCEPT early in the week the swing hi or low is obviously very tight and when it’s creating new hi’s or lows it can sometimes set the TP really close to the entry.
My question is there a way to put in the conditions not to enter a trade if the close price is within say the ATR figure in pips of the swing hi/low line?
-
hi. can you clearly say what do you want ATR to do for you? i working with ATR always
-
@xfire essentially I’m saying for example if the weekly high is 1.1900 and the trigger for a buy trade comes when it’s very close to 1.1900 I would like the EA to make sure it’s not too close to that weekly high so I want to use the ATR figure as the pip gap that I would like to set away from the weekly high to skip that trade. Does that make sense?
-
@that_adam_guy Yes, you can do it with variables. All those values should be stored into variables before opening the trade. Is that the way you do it?
-
@l-andorrà thanks for the reply. I’m sorry I don’t know how to set a variable?
-
-
@xfire Hi. Hope I am not hijacking this thread, if so , I will start a new one for now I ask the question.... .. If you use ATR regularly, do you have a good ATR setup to use in an existing expert of mine? The normal setup would be buy and sell at different values also with the ATR period14. I guess I am looking for a setup from your experience that will work well to help indicate my other indicators etc.
0_1618163009419_AO-Hodrick-Prescott Channel.mq5
0_1618163035575_Autotrendlines 3.mq5Thank you in advance
-
@xfire thanks for this. So if ive identified the variables like this: shared/NaIFvZvud how can i then get the figure of the "high" number minus the ATR number and then how do i then put it in the conditions to not trade if its within that number of the candle close?
-
@alphaomega
HI. Please create a new topic for your question because some users are professional in Fxdreema and can see your topic and help you.
i check it for you and if I find a better setting say to you -
@that_adam_guy
i can't see your link. you should click on the link and copy the share link from the address bar.
you can use any calculate under the block in the "Adjust" part and after that save data into a variable.
please share your project I can see what do you need
you can use the variable in the conditions same this sample
-
@xfire thanks, does this work: https://fxdreema.com/shared/bWyQ5JJ1d
-
@that_adam_guy You got the general idea. However, you will need different variables for each timefram. They cannot be stored as you suggest. Additionally I guess you are searching for lows and highs with a limited period of time. You also need to specify that period in candles like this:

This is the way to store the highest price on H1 timeframe for the last 10 candles.