/+------------------------------------------------------------------+ //| Enter long signal | //+------------------------------------------------------------------+
if (PreviousClose> SMA10 && RSI10 > CurrentRSI10Value) Order = SIGNAL_BUY;
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi, I created an expert advisor to enter long and I would like to add a condition that I can't find. This is the bold one below:
I'm not sure of the rest of the program.
Enter long if :
- Previous Close > SMA 10 ---- I'm not sure I programmed it well
- Current Rsi > 80 ------ I'm not sure I programmed it well
- Current price = + 10 pips above previous high ------ I don't know how to add this condition
-------------------------------------------------------------------
double PreviousClose = iClose(NULL, 0, Current + 0);
double SMA10 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, Current + 0);
double RSI10 = iRSI(NULL, 0, 10, PRICE_CLOSE, Current + 0);
double CurrentRSI10Value = 80;
/+------------------------------------------------------------------+
//| Enter long signal |
//+------------------------------------------------------------------+
if (PreviousClose> SMA10 && RSI10 > CurrentRSI10Value) Order = SIGNAL_BUY;
Here is the graph
Thanks for your help.
Joe