Download MetaTrader 5

Question about this code

To add comments, please log in or register
Cuong Truong
4620
Cuong Truong  

I'm currently writing code for a new EA.

I wanted to write a code to place a buy order only if RSI crossed down below 50 level, and then cross back up over the 50 level. After RSI crossed back up above 50 level then place a buy order

Is this the right line to use?

if((iRSI(NULL,0,10,PRICE_MEDIAN,0)<50)&&(iRSI(NULL,0,10,PRICE_MEDIAN,0)>50))

Sherif Hasan
7400
Sherif Hasan  
if ((iRSI(NULL, NULL,10,PRICE_MEDIAN,1) < 50) && (iRSI(NULL, NULL,10,PRICE_MEDIAN,0) > 50))  //Previous Candle Closed below <50 level and Current Candle Cross up >50 Level.
To add comments, please log in or register