Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 297
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
work with the history of transactions via
OrdersHistoryTotal()
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)
Thank you for your reply. I understand that if an order has closed, it has to be selected from the history (as the last order in the history), but I don't know how to set this condition (after we have found it), if it closed at Take Profit, then... and if it closed at Stop Loss, then...?
Good day, I have a question like this.... I thought for some reason that function Init () in EA starts not only at the moment of attaching or compiling EA, but also during break of connection, or more precisely after reconnection. Can you tell me how to start init() function after connection is restored????
Please advise us on the correct way and where to put parentheses. Is bool specified correctly? What is its difference from external bool? (or something like this)
place cursor on Volume and press F1.
Volume is an operator.
The variable bool f;
Basically, you can put cursor on any operator and press F1 - everything is described there in details.place the cursor on Volume and press F1.
Volume is an operator.
The bool variable is f;
In principle, you can put the cursor on any operator and press F1 - everything is described there in details.Good day, I have a question like this.... I thought for some reason that function Init () in EA starts not only at the moment of attaching or compiling EA, but also during break of connection, or more precisely after reconnection. Please advise how to start init() function after connection is restored????
You cannot start Init, it is started automatically once when you start the indicator/expert, like DeInit.
As an alternative, you can make a static boolean variable and use it together withIsConnected(). And when the connection is restored at the arrival of a new tick, it must be launched first, some initialization function of its own. ButIsConnected() should be applied not inOnCalculate(), but in OnTimer().
place the cursor on Volume and press F1.
Volume is an operator.
The bool variable is f;
Basically, you can put cursor on any operator and press F1 - everything is described there in details.Screenshot of the error
First time I've seen a screenshot like this =)
Don't you have the possibility to make a screenshot with Windows internal means?
By code.
Make a simple return if the volume is low, i.e. interrupt execution of further code
Screenshot of the error
MQL syntax is broken. In this case there is an extra semicolon after bool Volume and the compiler also wants brackets (), but I already wrote you that this is logic in this case, not code for Expert Advisor.