Please use the SRC button when posing code, I've done it for you this time.
if (Ask - Average<FarFromAverage*pips)
if Ask is below the EMA then Ask-Average will be a negative number, so it will be true whatever the distance
if (MathAbs(Ask - Average)<FarFromAverage*pips)
Using MathAbs should do as you want
Please use the SRC button when posing code, I've done it for you this time.
if Ask is below the EMA then Ask-Average will be a negative number, so it will be true whatever the distance
Using MathAbs should do as you want
Thank you very much GumRai.
The Issue I'm expiriencing is that I'm opening a trades with prices that are far from the EMA (more then: FarFromAverage*pips).
I tried to use MathAbs and backtest it but still some trades opened witn 10p from the EMA instead of 1p that I set.
thanks.
There are no mind readers here. We can not see your code.
I managed to figure this- the code is fine.
thanks!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
Trying to catch a price to execute a trade when I'm not far from the EMA using GoodPrice function below
but with no success. what am I'm doing wrong here?
Thank you!!!