Brendan:
Hi,
im having trouble with something.
I want to calculate remaining free available Margin (Not as a % but in dollars)
double margin_level() {
double value =0;
if(AccountFreeMargin()>0) value = NormalizeDouble(AccountBalance()-AccountProfit()-AccountMargin(),2);
return(value);
If my profit is minus, i cant get it to calculate the correct free margin figures.
My coding knowledge is very limited.
Thanks for your help.
Hi,
im having trouble with something.
I want to calculate remaining free available Margin (Not as a % but in dollars)
double margin_level() {
double value =0;
if(AccountFreeMargin()>0) value = NormalizeDouble(AccountBalance()-AccountProfit()-AccountMargin(),2);
return(value);
If my profit is minus, i cant get it to calculate the correct free margin figures.
My coding knowledge is very limited.
Thanks for your help.
double FreeMargin() { double Margin = 0; if(AccountMargin()==0) Margin = AccountBalance(); else Margin = AccountFreeMargin(); return Margin; }
Mohamad Zulhairi Baba:
Hi and thank you!

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
im having trouble with something.
I want to calculate remaining free available Margin (Not as a % but in dollars)
double margin_level() {
double value =0;
if(AccountFreeMargin()>0) value = NormalizeDouble(AccountBalance()-AccountProfit()-AccountMargin(),2);
return(value);
If my profit is minus, i cant get it to calculate the correct free margin figures.
My coding knowledge is very limited.
Thanks for your help.