You can declare "initEquity" as a static variable:
static double initEquity = 0.0;
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
I have trouble to stating the initial AccountEquity before any trade opened. Below code is not working because once a trade was opened the initEquity return 0.0 again.
What i want to achieve is the initEquity = AccountEquity() and no changing after a trade was open. So i can calculate :
double targetEquity = initEquity+(percentTarget*initEquity); if(nowEquity >= targetEquity) CloseAll();
can anyone give me a clue?