I do not know if it is possible for this EA to exit at X dollars above the "high water mark" of the equity...instead of the generic "close all" set to minumum profit. I can always calculate it manually with this current EA (great EA)..but to introduce "high water mark thinking" would be revolutionary! Also wouldn't it be awesome to automate the steps with ATR? instead of manually and statically setting them? This would allow this EA to become "self-adjusting" during the slow times.
mb
Hi,thanks for EA
it would be possible to separate the entry parameter to just sell, or just buy? ATT
Hello Vladimir, thanks for your code. It's interesting.
I am new to MT5 coding.
How could i understand the function of void CloseAllPositions ()?
It seem that the function do not close all position but only the position which hit the take profit pips.
Hope you won't mind to explain me step by step. And how should i change it so that it will close all positions once the biggest opened trade hit the profit pips?
Thanks.
Void CloseAllPositions() { for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of current positions if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic) m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbol }
Hello Vladimir, thanks for your code. It's interesting.
I am new to MT5 coding.
How could i understand the function of void CloseAllPositions ()?
It seem that the function do not close all position but only the position which hit the take profit pips.
Hope you won't mind to explain me step by step. And how should i change it so that it will close all positions once the biggest opened trade hit the profit pips?
Thanks.
This function closes ALL positions (taking into account the name "Symbol" and "Magic")
Each line has a description. Start asking what exactly you don't understand. I will answer your questions.
This function closes ALL positions (taking into account the name "Symbol" and "Magic")
Each line has a description. Start asking what exactly you don't understand. I will answer your questions.
Hi, thanks for reply.
Will the function will close all open position at the same direction?
for example the EA opened 0.01, 0.02, 0.04, 0.08 lots.how could I change the code so that once the trade of 0.08 lots take profit, it will close all other open positions (0.01, 0.02, 0.04)?
Thanks.
Hi, thanks for reply.
Will the function will close all open position at the same direction?
for example the EA opened 0.01, 0.02, 0.04, 0.08 lots.how could I change the code so that once the trade of 0.08 lots take profit, it will close all other open positions (0.01, 0.02, 0.04)?
Thanks.
The function 'CloseAllPositions' closes ALL positions opened by the EA. This is clear?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Martin for small deposits:
Martingale based Expert Advisor specially designed for small deposits.
Author: Vladimir Karputov