
- www.mql5.com
Hello please look for code examples in codebase here: https://www.mql5.com/en/search#!keyword=close%20all&module=mql5_module_codebase

- www.mql5.com
anybody help to CLOSE ALL TRADE at trade tab using mt5 EA.
int i=PositionsTotal()-1;
while (i>=0)
{if (trade.PositionClose(PositionGetSymbol(i))) i--;}
this code are not working/nothing happens even there is no error after compiled.
any source code suggestion please...
Use SRC button, please.
Use SRC button, please.
I am using mt5 EA. my problem is the source code NOT functional (source code/idea credit to mql5 forum) or NOTHING happens to close my trade. now i use SRC button(Sorry i am biggener). i am beginner also in Forex trading and I try to make own EA because in my 3days trade I am loss 35 usd in EURUSD currency.
//-----------------------bof AUTO CLOSED ALL TRANSACTION------------------------------------ void CloseEverything() { // CTrade c_trade; for(int i=PositionsTotal()-1;i>=0;i--) { { int ticket=PositionGetTicket(i); //Attached PlaySound("ok.wav"); } } } //-----------------------eof AUTO CLOSED ALL TRANSACTION------------------------------------ //toolbars error Description code generated 1 1 0 error(s), 81 warning(s), 1925 msec elapsed 1 82 noted-------------as far as my research I found this below. dated 2019-08-21 12:33 PM +gmt
ERR_TRADE_DISABLED |
4752 |
Trading by Expert Advisors prohibited |
|
MikelDavao:
ERR_TRADE_DISABLED |
4752 |
Trading by Expert Advisors prohibited |
Click the AutoTrading button.
to all moderator who attend my needs. I am very thankful to all you. I am very happy today 2019-08-21 7:43 PM +8 GMT. I am very proud that I have now my own Auto Trading. This is what I need today to "CLOSE" all trade when profit reach from minimum of 0.01 until max(when trading sending a reversal signal). This is a FIRST step of my Auto trading... Happy coding to all. GOOD LUCK to FOREX TRADING.
hello
I can close all position however if I just want to close sell position only it can not work well even complie ok. Can you have any suggestion

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
<Trade\Trade.mqh>
//--- object of class CTrade
CTrade trade;
Void ontick()
trade.PositionClose(_SYMBOLS)
//I AM beginner of mql5 (myself study based on here in forum)