FX MT4:
I would like to check with you to make sure that the net balance and risk code works in both directions
//Maximum amount of money to risk
double moneyToRisk = NormalizeDouble((AccountBalance()-Total_Current_Risk()) * RiskInPercent / 100, 7);
Can Total_Current_Risk() be negative?
that is, the sum of all orderers in plus profit?
double moneyToRisk = NormalizeDouble((AccountBalance() MINUS MINUS -> PLUS? Total_Current_Risk()) * RiskInPercent / 100, 7);
sounds like, to me that the next step is to debug the code, and then to check that it works how you think it should. We are coders of many levels of experience and skill. We are not mathmaticians! hahahahaha
double moneyToRisk = NormalizeDouble((AccountBalance() MINUS MINUS -> PLUS? Total_Current_Risk()) * RiskInPercent / 100, 7);That is nonsense code. Equivalent nonsense:
double ab = AccountBalance() MINUS MINUS; // Nonsense
(Boolean? Total_Current_Risk()) // Nonsense: B? X : Y
NormalizeDouble(aValue, 7); // Nonsense there is no money with 7 places

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
that is, the sum of all orderers in plus profit?
double moneyToRisk = NormalizeDouble((AccountBalance() MINUS MINUS -> PLUS? Total_Current_Risk()) * RiskInPercent / 100, 7);