Free margin problem

 

Hi,

 

I want to know how many contracts i can take with my account.

If i use :  NormalizeDouble((AccountFreeMargin()/MarketInfo(NULL,MODE_MARGINREQUIRED)),0)

the answer is  (int)0.89, so less than 1 contract but i can buy 1 contract .

Why ? 

 

Thanks for your answers. 

 
  • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
  • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip)
  • Do NOT use TickValue by itself - DeltaPerLot
  • You must normalize lots properly and check against min and max.
  • You must also check FreeMargin to avoid stop out
 

thanks but that is not what i ment.

i just want to know how to know the biggest number of contracts i can take with my account.

so if my account is 10.000 $ and required margin for 1 contract is 4.000 : 2 x 4.000 < 10.000

i think i can take 2 contracts but not 3.

if account free margin is < required margin, why can i take 1 contract ?

I thought that required margin for 1 contract must be < my free margin account. 

 
Frédéric LEBRE:

thanks but that is not what i ment.

i just want to know how to know the biggest number of contracts i can take with my account.

so if my account is 10.000 $ and required margin for 1 contract is 4.000 : 2 x 4.000 < 10.000

i think i can take 2 contracts but not 3.

if account free margin is < required margin, why can i take 1 contract ?

I thought that required margin for 1 contract must be < my free margin account. 

Print individual values and not only the quotient.
Reason: