just read the docu. about iLowest() and what does it return, a price or ...?
iLowest(): https://docs.mql4.com/series/ilowest
if(iLow(NULL, 1, iLowest(NULL,1,MODE_LOW,10,0)) > iMA(NULL,PERIOD_M1,50,0,MODE_SMA,PRICE_CLOSE,0)) {}
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I'm trying to create an EA that place a buy order when price is above the 50 days line.
Here's the 'if' condition:
if((iLowest(NULL,1,MODE_LOW,10,0) > iMA(NULL,PERIOD_M1,50,0,MODE_SMA,PRICE_CLOSE,0)))
However,
When I test out that if condition it placed an order at a bar higher then the bar I wanted.
I've attached an image to show you, the red arrow in the image shows the EA placed the buy order.
However, I wanted the EA to place the buy order at the bar as shown in the yellow arrow. I painted in the red an yellow arrow to show you where I want the EA to place the buy order based on the 'if condition' I wrote above.
Your help is appreciated.