Karl Robeck:
hello, is this code right? I'm trying to use percentage on my Profit so when the AccountEquity() >= DailyProfitTarget it will close all of the trades I'm not sure on how to code the DailyProfitTarget tnx for the help
double DailyProfitTarget=AccountEquity()+InpDailyProfitInPercentage;
if(AccountEquity>=DailyProfitTarget)
CloseAllTrades();
No, think about it. If your equity is 1000 and daily profit is 100, your target is 1,100
How will 1000 ever be larger than 1,100 ?
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Karl Robeck #:
My daily profit is on percentage if account equity gain %target percentage it will close all trades
My daily profit is on percentage if account equity gain %target percentage it will close all trades
As I said, think about it
double DailyProfitTarget=AccountEquity()+InpDailyProfitInPercentage;
if(AccountEquity>=DailyProfitTarget)
CloseAllTrades();
double DailyProfitTarget= X + Y;
if(X>=X+Y)
CloseAllTrades();
Karl Robeck:
Yes is correct… you put 2 paranteses on AccountEquity() and is good…. It won’t do anything but is good…
hello, is this code right? I'm trying to use percentage on my Profit so when the AccountEquity() >= DailyProfitTarget it will close all of the trades I'm not sure on how to code the DailyProfitTarget tnx for the help

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, is this code right? I'm trying to use percentage on my Profit so when the AccountEquity() >= DailyProfitTarget it will close all of the trades I'm not sure on how to code the DailyProfitTarget tnx for the help