OPEN-SOURCE SCRIPT

Position Size Tool

Updated
Updated - Version 2

This tool is used to calculate the size of a trade.

Settings - Type in total account size and % of capital that can be risked on each trade.

The table will display:
Column 1 - Stop placement based on low, mid or high value of the current candle.
Column 2 - Percent risk on the trade.
Column 3 - Amount of shares that can be traded (calculated from account size, risk and selected stop placement).

Green color is intended for long position, stop at the low of the candle.
Red color is intended for short position, stop at the high of the candle.
Middle value can shift between either color since its measured from open to close.
Release Notes
Table size option.
Release Notes
Added a movable stop line for specific stop placement, can for example be helpful on shorter timeframes or custom values. The line have its own size / risk input which can be accessed from the inputs tab. You can hide the function via the styles tab. Line have two colors, in case above current price will be Green (buy stop order) or below price Red (sell stop order).
Release Notes
Labels
Release Notes
Added checkbox for the option to remove the main table information or movable line based on preference. This can be used in case one does not use both functions and want to have more space / clearer information.
Release Notes
Account Input: Account size and risk are now entered in one place.

Table: Added headers and the option to show or hide individual sections to make it more customizable.

Manual Stop Line: You are now prompted to enter an initial value to make the line visible, which can be re-opened from the indicator settings (simply select reset points). This can be helpful when switching between charts and the line falls outside of vision due to the price difference.

Layout: More user friendly settings tab and added some tooltips.
Release Notes
Labels
candleCandlestick analysisPortfolio managementpositionpositionsizeriskriskamanagementriskrewardsharesSIZEstatisticstool

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer