![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 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