username1 :
I'm trying to write a money management class in mql5. (Its a library actually). Here it is:
could someone please point out the compilation errors i get, what is actually wrong ? (mostly variable expected error)
I declared variable type, name and initialized them.
You can't initialise member variables in their declaration. You should declare them like this
private:
double max_pos_mgn_set;
double max_use_mgn_set;
double current_balance;
// etc
And initialise them in the constructor
public:
MoneyManagement()
{
max_pos_mgn_set = 2.0;
max_use_mgn_set = 5.0;
current_balance = AccountInfoDouble(ACCOUNT_BALANCE);
// etc
}
phampton :
You can't initialise member variables in their declaration. You should declare them like this
And initialise them in the constructor
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'm trying to write a money management class in mql5. (Its a library actually). Here it is:
could someone please point out the compilation errors i get, what is actually wrong ? (mostly variable expected error)
I declared variable type, name and initialized them.