Download MetaTrader 5
To add comments, please log in or register
Have you made a screenshot in MetaTrader? Share it with friends!
Ali Gokay Duman
907
Ali Gokay Duman 2015.09.02 16:09 
when i use OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1,SymbolInfoDouble(Symbol(),SYMBOL_BID),CalcMargin) function in XAUUSD return me 0.01 Why? 
Alain Verleyen
Moderator
30243
Alain Verleyen 2015.09.02 19:10  
Ali Gokay Duman:
when i use OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1,SymbolInfoDouble(Symbol(),SYMBOL_BID),CalcMargin) function in XAUUSD return me 0.01 Why? 

What is the value return by OrderCalcMargin() true or false ? If false what is the error ?

If true, where is placed this code, which broker-server ?

Ali Gokay Duman
907
Ali Gokay Duman 2015.09.02 21:18  
Alain Verleyen:

What is the value return by OrderCalcMargin() true or false ? If false what is the error ?

If true, where is placed this code, which broker-server ?

function return true. i m trying Alpari-Demo server and i think the problem is caused Alpari-Demo server. Because another server in metatrader5 result is different 

Thank you for your information (If true, where is placed this code, which broker-server ?)

Alain Verleyen
Moderator
30243
Alain Verleyen 2015.09.02 21:30  
Ali Gokay Duman:

function return true. i m trying Alpari-Demo server and i think the problem is caused Alpari-Demo server. Because another server in metatrader5 result is different 

Thank you for your information (If true, where is placed this code, which broker-server ?)

I confirm. I tried with an other broker and got a normal value (226.69 USD).
Ali Gokay Duman
907
Ali Gokay Duman 2015.09.02 21:43  
Alain Verleyen:
I confirm. I tried with an other broker and got a normal value (226.69 USD).

I still get true and 0.01 USD in Alpari-Ltd-Demo Server (XAUUSD). My code is placed in My EA's OnTick() function 

void OnTick()
  {
   double CalcMargin;
   bool   status;
   status=OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1,SymbolInfoDouble(Symbol(),SYMBOL_BID),CalcMargin);
   Print(status+" - "+CalcMargin);   
  }
result : "true - 0.01"
/
To add comments, please log in or register