Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1554

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
You have it all wrong, besides, an order can't be closed/open, it can be set/deleted.
A position can be closed.
I apologise for my MQL4 experience. Of course, we are talking about closed positions.
The function
HistoryDealsTotal
returns exactly the value of closed positions. But when debugging, I see that the required ticket is not passed to my function. (in the tester). And accordingly, the information about orders is incorrect. And the calculation of profit due to incorrectly passed Magic does not come at all.
Friends, help to fix the error, it gives'SymbolInfoDouble' - no one of the overloads can be applied to the function call, what to do?
Here in this table find POSITION_PRICE_OPEN
I don't understand what is wrong with this conditional expression?
This is what I get in the debug. Why pos_profit_pts == 0 ? diff_pts - same logic and correct value.
Greetings. Can you tell me how to make a time interval in seconds between closing and opening a new position?
Remember the closing time in a variable and before opening the next position check the difference between the current time and the closing time. If it is greater than the specified value, then it can be opened.
Store the closing time in a variable and before opening the next position, check the difference between the current time and the closing time. If it is greater than the set value, then it can be opened.
How does it look like in code? I'm not a programmer. I can only copy and paste something)
How does it look in code? I'm not a programmer. I can only copy and paste things.)
Then all questions here. There are many more nuances besides that.
Greetings. Can you tell me how to make a time interval in seconds between closing and opening a new position?
There is one more option. Post the code of your EA on the Forum and there is a chance that someone will help you, even for free. The code can be posted as a file, but only with the mq5 extension or by copy-paste in the text of a new message (to do this, press Alt+S and paste your code). And if you do not want to show the secret code of your Expert Advisor, then, as Alexey advised, contact Freelance.
Regards, Vladimir.
Hello everyone in this thread. When I wrote a little bit on 4 now I want to try on 5
I took the robot from the base and want to modify it to my desires, perhaps it will work with your help (if you really want a link and code I can give, but it is there 1-2 thousand lines)
There is a function for setting trailing stops and so on. How to introduce there an external bool variable that will switch it off and the robot will become:
1 close a position only upon receiving the opposite signal
2 take and stop will become virtual (i.e. when the specified values are reached, the position will be filled/reversed) and this variable that sets stop and stop will not work.
It is supposed to be a fork that will switch different types of strategies within one bot how best to realise such a switch ?