




Stop out is a different matter. AFMC just tells you if you have enough margin to open the order. As the trades go against you AccountEquity and AccountFreeMargin drop.
at.risk.equity += Direction( OrderType() ) * (OrderClosePrice()OrderStopLoss())*perPoint;Summed for all open orders. 

If I know the account balance, the dollar amount I am willing to risk, and the stop loss in pips, how do I calculate the order size in lots? For example: Account balance ($USD): 1,000.00 Amount of risk (%): 0.02 Total dollar risk ($USD): 1,000 * 0.02 = 20.00 Stop loss (pips): 50 Dollar risk per pip ($USD): 20.00 / 50 = 0.40 Order size (lots): ? Thank you. 


Hi guys,
Im new here, i've read many articles about some estrategies and money management.
Well, i have studied some about lots calculation (exponential and others), then i just think in some strategy that could be calculate using some relation of Volume (ATR), risk per trade and tick value.
#extern variables
The TradeAtRisk variable is used by another function to calc SL price. This represent the quantity of money that i accepted to loss for each order.
extern double TradeAtRisk = 2.0;
#functionThe result maybe like this:
Thanks
Daniel Niero