How To Calculate Number Of Lots Per Trade (Position Sizing)


How many lots do you need to enter if you only wanted to lose a fixed amount?

There are several numbers you wanted to calculate a dynamic lot amount for each trade, these are:

  • Entry Price
  • Stop Loss Price
  • Amount to Risk
  • Value per pip (or point, tick) in account currency

How many lots do you need to enter if you only wanted to lose a fixed amount? There are several elements that are needed to calculate the quantity of contracts you can buy when opening a forex position, these are: Entry Price, Stop Loss Price, Amount to Risk and Value per pip (or point, tick) in account currency.

How many lots should I trade?

The number of lots to buy when trading a currency is dependent on the size of your account, position size and leverage. Generally speaking, an average trader will trade between one standard lot (100K units) or two mini-lots (50K).

The best way to find out what works for you is through experimentation. Track your trades over time: this could be in terms of profitability per trade, and max drawdown, depending on which valuation metric suits you personality best.

If you find you stay awake at night because of the wild swings of your account’s profit and loss, this is an indicator that you’re trading too big relative to your pain threshold. You want to be able to trade by trading an amount that you’re comfortable with losing. If your position sizes are too large and you’re making large losses on your account then you need to reduce your position size.

What does 0.01 lot size mean?

A lot size of 0.01 is known as a mini-lot and means that for every unit traded, you will trade 100,000 x 0.01 = 10,000 units per position. A mini-lot is a great way for smaller accounts to dip their toe into the forex trading market. If the mini-lot were not available then traders would only be trading in 100,000 contract sizes which at 20:1 leverage would mean a standard position in the EURUSD would require capital of (100,000 x 1.20) / 20 = 6,000 USD.

What lot size is good for $1,000 forex account?

To remain in the forex game long enough you will want to keep the risk per trade around 2% per trade. If you trade higher than 2% and your system has multiple trades open at the same time, you could be increasing your portfolio risk to more than this, and this is why it’s important to know your portfolio position risk.

If you’re trading with just 2% of a $1,000 account then this would mean each trade you would be risking $50 ($1,000 x 0.02). Therefore, depending on the distance between the entry and exit price and the pip value you could calculate your lot size.

Formula for calculating lot size

Lots = abs(EntryPrice - StopLossPrice) / (TickValue * 100,000)

As an example, if I were to enter a currency pair at 1.44935, have my initial stop loss at 1.44750, and the tick value of the currency pair being traded is 1.11288, and I’m prepared to lose $50 for this trade, then to calculate the number of lots to buy would be as follows:

Lots = Loss / (abs(1.44935 - 1.44750) * 1.11288 * 100,000
Lots = 50 / 0.00185 * 111,288
Lots = 0.242856616

So for this currency pair you would be looking to trade around 0.25 lots.

MetaTrader Formula

Now we have the concept, and the formula which underpins our position sizing calculation we can translate this into MetaStock code.

However, there are a few more things to consider, before launching directly into the code from our formula. Ponder these thoughts:

  • Does my broker impose a minimum or maximum distance between my Entry Price and my Stop Loss Price for each trade?
  • Does my broker impose a minimum lot size quantity?
  • Does my broker impose a maximum lot size quantity?
  • Do I want to impose limits on the amount of margin that is consumed in each trade?

When we consider these additional thoughts in our coding we are now modifying our resulting output to suit these restrictions and limitations.

With our above function we are now able to calculate the amount of lots per trade provided we enter the following parameters:

  • entryPrice – enter your entry price
  • stopLossPrice – enter where your stop is going (whether or not you manually insert this into the OrderSend method or not)
  • riskAmount – the amount you are willing to risk/lose per trade.
  • maxMarginAmount – the amount of margin you’re willing to use per trade.

To reference this function in our other code we would use it something like this:

double entryPrice = ...
double stopLossPrice = ...
double riskPerTrade = AccountEquity() * 0.02; // 2% per trade risked
double maxMarginAmt = AccountEquity() * 0.10; // 10% per trade used as margin
double lots = getLotSize(entryPrice, stopLossPrice, riskPerTrade, maxMarginAmt);
if (lots > 0) {
   // continue with placing trade
}

Conclusion

Hopefully with this article you’ve been better able to understand how to calculate lot size and how to implement this within your MetaTrader code. Be mindful to test your code thoroughly before using this code on any live production accounts.

Recent Posts