-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
Forum rules and recommendations - General - MQL5 programming forum (2023)
Messages Editor -
Count your braces and match them.
void OnTick() { '{' - unbalanced parentheses IROBOT.mq5 line 64 ⋮ // Check if a trade is open and update stop loss if necessary if (isTradeOpen) { ⋮ } '}' - unexpected end of program IROBOT.mq5 141 5 <<<<<<<<< OnTick continues here.
-
input string tradingStartTime = "13:30:00"; // NY session start time input string tradingEndTime = "20:00:00"; // NY session end time
When dealing with time, a lot of people use strings; they can not be optimized. Using (int) seconds or (double) hours and fraction can be inputs.
See also Dealing with Time (Part 1): The Basics - MQL5 Articles (2021.10.01)
Dealing with Time (Part 2): The Functions - MQL5 Articles (2021.10.08)
MQL5 Programming Basics: Time - MQL5 Articles (2013.04.26)Remember to handle the case where start > end (e.g. 2100 … 0200
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
Forum rules and recommendations - General - MQL5 programming forum (2023)
Messages Editor -
Count your braces and match them.
Hi William,
Thanks for the instructions,
Are you familiar with this types of errors ?
Hello Comunity,
I need your help I created this short code EA(Expert Advisor) but i can not figure out why is giving me this 2 errors can anybody help? (ERRORS highlighted IN RED)
'{' - unbalanced parentheses IROBOT.mq5 line 64
'}' - unexpected end of program IROBOT.mq5 line 141
Thanks in advance for your expertise :)
Was this code generated from ChatGPT?
How will the program know when a trade is open?
You only set it to bool Tradeopen() = false
Yes, usually it is result of someone who does not know how to code and expecting ChaGPT to generate code for them (which it does very poorly).
The solution is to learn to code properly yourself (which can take many months or even years) or to hire a human programmer to code it properly.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Comunity,
I need your help I created this short code EA(Expert Advisor) but i can not figure out why is giving me this 2 errors can anybody help? (ERRORS highlighted IN RED)
'{' - unbalanced parentheses IROBOT.mq5 line 64
'}' - unexpected end of program IROBOT.mq5 line 141
Thanks in advance for your expertise :)