Enter if 2 moving averages are x pips apart
9 replies
vabsie
9 years ago #113326
Hello ..
I was wondering if someone can please help me with the property selections in EA Wizard to have an IF condition which states:
IF: EMEA(x) 20 pips > than EMEA(5)
I assume I need to create two variables as per below:
min_difference = 20
actual_difference = {condition} – I think this is the bit that I don’t fully understand how to compute. How do I set this variable to own the value of the difference in pips between two MA?
I can then have a condition that says:
IF actual_difference > min_difference do something.
I am basically trying to add a mechanism which means the EA should not trade unless the difference in pips between two EMAs meet the criteria, in order to avoid the EMAs being too close to one another.
Thanks in advance.
Threshold
9 years ago #128778
look at this
vabsie
9 years ago #128781
Perfect thank you Threshold, will have a go tonight
vabsie
9 years ago #128786
Can I ask what is the difference between ConvertoPips and ConverttoRealPips?
Sorry if this is explained somewhere else.
vabsie
9 years ago #128787
Apologies .. I’ve now read the instructions 🙂
Count-Roy
9 years ago #128873
Threshold I wanted to replicate you pic: converttopips ema9 – ema 26 >= 20.
but without succes.
can you share the rule as an sqw file please so that I can see how you did this.
thanks in advance.
greetz
Threshold
9 years ago #128875
Looking for the number of pips between 2 MAs entire depends on
-the emas
-the currency pair
-time frame
-current market environment
and possible more overlooked criteria.
Maybe it is working and you never received a signal because the MAs never were >=20 pips?
This is how it would be done. I would recommend using an ATR instead of “20”. It will adjust to the time frame, currency pair, market environment etc…
Anyway if you weren’t sure how to make the EA parameters this is them:
Count-Roy
9 years ago #128881
thanks for your quick respons Threshold but it was a matter of me not understanding how to wright the code. now I see you used two parameters and the subtraction tab.
now I understand how you made the code. Nice 🙂
really it would be nice to have more tutorials in the form of examples of how all these different tabs can be used. but with quick answers like yours, maybe they aren’t really that needed after all.
in any case,
Thank you again.
vabsie
9 years ago #129383
Apologies that it has taken me so long to get back to this again.
The example Threshold gave me above works nicely for Long trades, but the difference in pips between the EMAs for Short entries do not appear to work.
Some time ago I saw a post over here where Mark helped add a formula for something similar (was the MATHABS?) in order to positively calculate the pip difference when subtracting a negative value?
Hope this explains .. and thanks – but I “think” simply turning the EMAs around does not work for short entries … ?
Stefan
daveM
8 years ago #133752
Viewing 9 replies - 1 through 9 (of 9 total)