pseudocode:
....
// flag management
equity = AccountEquity( );
balance = AccountBalance();
if( loss is above 15%)
GlobalVariableSet("full_house_close",1);
if(OrdersTotal()==0) // or you can put flag full_house_close to 0/1 directly in "terminal->tools->Global Variables"
GlobalVariableSet("full_house_close",0);
....
//positions closing
bool full_house_close = GlobalVariableGet("full_house_close");
if(full_house_close)
{
....
}
/*
it is necessary to keep the flag to close persistent because, after closing some positions the difference between balance and equity goes below 15% and remaining orders will not be shut.
*/
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
I have been trying to find a close all ea the uses a percentage eg if the account equity is 15% lower than the account balance close all positions.
any help would be great
cheers
kiwi