polamin:
Hi everyone,
This is my first post about my first Ea.
These code modified from "Moving Average.mql4" default file from Metatrader4.
In backtest it works fine but when doing real trade it doesn't work.
I did tick the "Allow automated trading" and "Allow live trading" and Smiley face on the screen.
Alert doesn't even show up when RSI goes below 30 now I'm really confusing.
if(rsi <= 30 && lastRSI > 30) { res=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Open[0] - StopLoss,0,"",MAGICMA,0,Blue); if(res<0) Print(); Alert("OPEN BUY" ,Open[0]); return; }Use print function to get error codes. Only then can we help you.
- "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- Check your return codes (OrderSend) and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

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 everyone,
This is my first post about my first Ea.
These code modified from "Moving Average.mql4" default file from Metatrader4.
In backtest it works fine but when doing real trade it doesn't work.
I did tick the "Allow automated trading" and "Allow live trading" and Smiley face on the screen.
Alert doesn't even show up when RSI goes below 30 now I'm really confusing.