- it possible to run parameters on different periods in the same EA?
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- BB on MA
-
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemWe can't see your broken code.
Always post all relevant code (using Code button) or attach the source file.
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
-
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemWe can't see your broken code.
Always post all relevant code (using Code button) or attach the source file.
-
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
my code run yin 15 miu period
- 47803124 #: my code run yin 15 miu period
-
double close3=iClose(Symbol(),60,3); double close4=iClose(Symbol(),60,4); double close5=iClose(Symbol(),60,5); double close6=iClose(Symbol(),60,6);
Don't hard code constants. Use the proper symbol (PERIOD_H1). Code breaks on MT5.
Your code bool rsijinduo=false; bool rsijinkong=false; if((rsi1>rsi2)&&(rsi2<rsi3)) rsijinduo=true; if((rsi1<rsi2)&&(rsi2>rsi3)) rsijinkong=true;
Simplified bool rsijinduo = rsi1>rsi2 && rsi2<rsi3; bool rsijinkong= rsi1<rsi2 && rsi2>rsi3;
-
if((OrderMagicNumber()==magicx)||(是否开有单))
Code breaks if you forget to change the magic number when puting it on a different symbol.
Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number/symbol filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum (2013)
PositionClose is not working - MQL5 programming forum (2020)
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles (2006)
Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles (2011)
Limit one open buy/sell position at a time - General - MQL5 programming forum (2022)You need one Magic Number for each symbol/timeframe/strategy.
Trade current timeframe, one strategy, and filter by symbol requires one MN.
If trading multiple timeframes, and filter by symbol requires use a range of MN (base plus timeframe).
Why are MT5 ENUM_TIMEFRAMES strange? - General - MQL5 programming forum - Page 2 #11 (2020)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use