Position Size Calculation with Fees - Handle any LeverageExample:
The account size is $4500.
We risk 2%, 90 cash, for this 2R trade.
If the trade idea is a success
we would now have 4678 cash in our account
a profit of: 178 cash
And if loss, a total of 4410 cash, 90 cash loss)
Is this correct?
Explanation:
The example seems correct but only without the fees in calculation.
Even small fees like e.g. 0.04% Taker (market orders) and 0.02% Maker (limit orders) add up a lot. A lot!
The example does need a position size of $56250 , which would be $22.5 in fees just to open the position and the same amount again when the stop loss (market order) triggers or $11.25 when exit with a limit order.
The example does clearly need a leverage of 15 or higher to open that position size.
- Tradeable balance with 15x leverage: 4500 * 15 = 67500
- And to get a loss of 90 cash within 0.16 %: 56250 / 100 * 0.16 = 90
See Image on Chart: Calculation without fees
We will be fine with any kind of Leverage if we calculate it like that on every trade. The PnL is calculated from the real account balance. So we are on the right track to not blow our account.
If we calculate it with the Fees in mind, the example with 0.04% fees for open and close, then the position size would be $28125
See Image on Chart: Calculation with fees
The calculations show, even when it hits the Profit Target, the real Risk Reward lowers by a large amount . (The Example uses the same taker fee for open and close)
I personally recommend to automate those ever recurring calculations and set the orders via an API. Relative easy to code in e.g. Python.
I'm not allowed to link any external links here but some tools can be found on my Twitter (I'm not really active there otherwise):
- Some link to a Microsoft Excel sheet, which was used for the calculation images. It may be useful for some, just make a copy.
- And a public open source API Trade App can be found on my GitHub, link in the same Twitter feed.
No other funny links else.
And as last goodie: A small snippet example used in my automated strategies in PineScript, strategy.equity represents the account balance:
//Example 0.001 is minumum order
varip input_mathround = input(3, 'Decimal Math Round Size')
varip pnllosspercent = input(2, 'Dynamic PnL Loss - Percent of Balance')
getLongSizeDynamic(_entry, _sl) =>
pnl = strategy.equity / 100 * pnllosspercent
sl_percent = (_entry - _sl)/_entry
size_cash = pnl / (sl_percent*100) * 100
size_r = 1 / _entry * size_cash
size = math.round(size_r, input_mathround)
size
There are for sure different ways to optimise the math for the own liking.
This 'tutorial' is meant to give small insight into a proper position sizing, that you may too will not fear the leverage as useful tool when used correct.
With the calculations above, no matter if 10, 50, 100 or even crazy 1000x Leverage shall not blow our accounts! Still always keep the fees in mind, they take our money!
Positionsizecalculator
Position sizing 101 - how to avoid crippling lossesPosition sizing is determining the correct size of the position based on the amount of money you risk on the particular trade.
Before you can do that, you need to figure out what is the maximum acceptable risk of the trade.
That risk is usually expressed as a % of your balance, that you are willing to lose.
To make sure you don’t lose more than this amount traders set a Stop Loss order which is the real maximum exposure of your position.
If you don’t use a stop loss, you are exposing your entire portfolio!
Where to put a stop loss?
That’s where Technical Analysis can be handy. The majority of retail traders would look at the chart to find out – usually behind some support/resistance level or based on some volatility indicator, such as ATR
Rule of thumb:
Risk between 1-3% of your portfolio balance on each position. This way any single individual loss won’t wipe your account and break your spirit. And more importantly, even a string of losses will leave you with enough ammunition to recoup the losses.
Have a clear approach to risk:
1. Set a risk limit for each trade, asset in general, day, week, and month (you won’t risk more than X account)
2. Determine the right position size and start small
3. Increase the position size of trades slowly if your account grows
4. Lower size or switch back to paper trading if your account doesn’t
Two types of position sizing methods: Fixed and flexible
Fixed position size
Using the same position size for every trade
Good for finding out if your strategy has an edge
Make sure you come back and reevaluate position size periodically.
Flexible position size
Using a percentage of the current balance
Cluster of wins makes every following win larger
Cluster of losses makes every following loss smaller
How to calculate the correct position size:
You need to know
1. Trading account size
2. Acceptable risk (in % per each trade)
3. Invalidation point (in form of a distance from the open price)
The formulae:
Position size = Trading account size x Acceptable risk / Invalidation
Example:
1. Trading account size = $10,000
2. Acceptable risk = 1%
3. Invalidation point = 4% drop in market price
Position size = $10,000 * 0,01 / 0,04 = $2,500
This way you will always risk losing $100 no matter where your Stop Loss goes! If Stop Loss must be wider, say 8%, the calculation is:
Position size = $10,000 * 0,01 / 0,08 = $1,250
Doubling the distance to our stop loss has us reducing our position size by half to maintain the same possible loss.
How to set position size in Tradingview
1. Use the Long position or Short position drawing tool
2. Input your account balance
3. Select the risk you're willing to undertake - either as a % of your account balance or as a monetary value
4. Enter the market price of your Stop Loss
5. Look at the "Quantity" field in the drawing tool = that is the position size you should use to adhere to your risk settings.