hi buddy how are you
if(AccountEquity()<=(accountbalance - accountbalance/100*FLUSH_Percent)){
goverkms:
hi buddy how are you
if(AccountEquity()<=(accountbalance - accountbalance/100*FLUSH_Percent)){
hey there!
big thanks!
you are welcome
goverkms:
you are welcome
you are welcome
big thanks again, it works like a charm!
i dont, however.
thing is - now i tried to make it separate from the first code, but it ignores it.
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { if(time+FLUSH_Time_Seconds<TimeCurrent()){ time=TimeCurrent(); if(FLUSH){ if(AccountEquity()>=(accountbalance/100*FLUSH_Percent)+accountbalance){ Sleep((SleepXMinutes*60)*1000); first=true; nAll=nBuy=nSell=0; LastBuy=LastSell=0.0; close=CloseOrders(); Sleep(3000); accountbalance=AccountBalance(); MagicNumber=MagicNumber+1; }} } {{ if(time+FLUSH_Time_Seconds<TimeCurrent()){ time=TimeCurrent(); if(REBOO){ if(AccountEquity()<=(accountbalance - accountbalance/100*REBOO_Percent)){ Sleep((SleepXMinutes*60)*1000); first=true; nAll=nBuy=nSell=0; LastBuy=LastSell=0.0; close=CloseOrders(); Sleep(3000); accountbalance=AccountBalance(); MagicNumber=MagicNumber+1; }}}} }
you want to use both conditions?
goverkms:
you want to use both conditions?
trying to, yes.
you want to use both conditions?
sorry too busy today remind me tomorrow please if i forget about it
i'll see only one error here if(AccountEquity()>=((accountbalance/100*FLUSH_Percent)+accountbalance))
can you tell me more whats going wrong
none of the conditions is not met?

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
hi there, guys!
i have this little piece of code here that does the following - records your balance, and once equity reaches a specific percent growth over that mark, it closes all trades.
could some one maybe edit it just a bit so it would do the same, but in the opposite direction?
if equity falls a specific percent below the recorded balance, it closes all trades?
all i can do, is tell it to close the trades once equity is below the recorded balance, so it closes all trades right away..
if(AccountEquity()>=(accountbalance/100*FLUSH_Percent)+accountbalance){
big thanks to any support!