Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1227
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
Hello! Please explain or point fingers how to programmatically Close Open Positions with Hedge/Hedg account type. how to close hedged positions in mql5? only found this material. https://www. mql5.com/ru/articles/4830
Example from the Close all positions code
When working with positions, it is necessary to loop through all positions to zero:
Example from the Close all positions code
When dealing with positions, it is necessary to loop through all positions to zero:
This is the kind of thing I made. To close the selves for a hedge.
But sometimes there is one position left open for some reason. If we set condition: Close if there are more than five positions.This is the kind of thing I made. To close the selves for a hedge.
But sometimes there is one position that is not closed for some reason. If we set a condition: close if there are more than five positions.It's already right then:
and if it fails to close, look in the log file. There could be a million reasons: redirect, no trade, no price, proximity of stop levels...
Hello. Why do you need to delete the class objects in deinitialization? Will they remain in memory after the terminal is closed? Or they will remain in memory while the terminal is running, without the Expert Advisor? What else needs to be deleted except the class objects?
For example, you delete the Expert Advisor from the chart, but all drawings (objects) remain on the chart. In deinitialisation, delete all unnecessary things to have a clean chart. It goes like this.
For example, you delete the Expert Advisor from the chart, but all drawings (objects) remain on the chart. In deinitialisation, delete all unnecessary things to have a clean chart. It goes like this.
Hi !
How do I assign an id to an indicator? I bought an EA, it is oriented to a higher timeframe to trade on a lower one. The developer wrote that I have to put the indicator on the higher chart and assign an id to it. I am new to MT, i dont know how to do it. Please advise me, if someone knows how to do it. (I am using version MT5)
How can I prevent trades from other charts from appearing on the chart?
Only the trades of the robot that is on the given chart.
Am I the only one who is bothered by a jumble of trades from many robots on one chart? No one else has bothered?