Hi! Could someone help me solve these errors, identifying the shortcomings and making the necessary corrections.
These two errors usually occur when there is an error in the syntax of a code, usually caused by missing closing brackets or quotes. Only, no matter how carefully I go through my code and check that all brackets, parentheses and quotes are properly balanced and closed, I can't find anything. I'm not a programming expert. Is it possibly a simple spacing/column error?
Here is the full code below :
I will be very grateful!
Mustafa Z.
You have a mixture of MT4 and MT5 code. Stop using chatGPT.
MT5 code. That is not an assignment; it's initialization of a common (globally declared), or static variable with a constant. | double Bid = SymbolInfoDouble(_Symbol, SYMBOL_BID); |
MT5 code returns a handle (an int) not a double. | double atr = iATR(_Symbol, PERIOD_CURRENT, AtrPeriod); |
MT4 code | OrderSend(_Symbol, OP_BUY, LotSize, Bid, 3, StopLoss, TakeProfit1, "EA Buy", MagicNumber); |
MT4 code No order selcted. | int ticket = OrderTicket(); double openPrice = OrderOpenPrice(); |
ChatGPT (the worst), EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, ForexEAdvisor (aka. ForexEAdvisor STRATEGY BUILDER, and Online Forex Expert Advisor Generator), ForexRobotAcademy.com, forexsb, FX EA Builder, fxDreema, Forex Generator, FxPro, Molanis, Octa-FX Meta Editor, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
-
Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
If we tell you what you need, you can't code it.
If we give you the code, you don't know how to integrate it into yours.We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.
ChatGPT - Mixing MT4 and MT5 code together.
- Creating multiple OnCalculate/OnTick functions.
- OnCalculate returning a double.
- Filling buffers with zero in OnInit (they have no size yet). Setting buffer elements to zero but not setting Empty Value to correspond.
- Calling undefined functions.
- Sometimes, not using strict.
- Code that will not compile.
- Creating code outside of functions.
- Creating incomplete code.
- Initialization of Global variables with non-constants.
- Assigning a MT5 handle to a double.
- Useing MT4 Trade Functions without first selecting an order.
EA builder - Counting up while closing multiple orders.
- New bar code: Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
- Not adjusting for 4/5 digit brokers, TP/SL and slippage.
- Not adjusting for ECN brokers. pre-Build 500)
- Not checking return codes.
EATree Uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.) ForexEAdvisor FX EA Builder - Not checking return codes.
- Loosing open tickets on terminal restart. No recovery (crash/power failure.)
- Not adjusting stops for the spread.
- Using OrdersTotal directly.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi! Could someone help me solve these errors, identifying the shortcomings and making the necessary corrections.
These two errors usually occur when there is an error in the syntax of a code, usually caused by missing closing brackets or quotes. Only, no matter how carefully I go through my code and check that all brackets, parentheses and quotes are properly balanced and closed, I can't find anything. I'm not a programming expert. Is it possibly a simple spacing/column error?
Here is the full code below :
I will be very grateful!
Mustafa Z.