How to calculate which price will be stop out?

 
Any broker for example, leverage 500, . . . . If equity $1000, stop out level 20%,  and I order gbpusd 1 lot standard, sell@1.2000 which price will be stop out? 
How to code it? Thanks all

 

I used the price where free margin goes to zero (didn't understand level and mode.)

  • 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 but it takes account of the exchange rates of the pair vs. your account currency.)
  • 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

If you do your risk properly $1K * 1% with reasonable SL means your maximum lot size should be around 0.01. You are risking a huge percentage.

 
whroeder1:

I used the price where free margin goes to zero (didn't understand level and mode.)

If you do your risk properly $1K * 1% with reasonable SL means your maximum lot size should be around 0.01. You are risking a huge percentage.


got it, Thank you , whroeder1     .