Forum

Open position using whole free margin

Hello guys, I've tried this way: double acFree = AccountFreeMargin () ; int acLev = AccountLeverage () ; double maxVol = (( acFree * acLev ) / Ask ) / 10000 ; int ticket = OrderSend ( Symbol () , OP_BUY , maxVol , Ask , 3 , 0 , 0 , " expert comment " , 255 , 0 , CLR_NONE ) ; but never whole margin