Position Size Calculator (EzAlgo)

Upon adding the indicator to the chart, you will be prompted to place entry price lines, stop loss price line, and multiple take profit price lines by clicking at the desired price level on the chart.

Section Summaries

Table Settings: Allows users to select position and font size from drop-down menus. Displays current settings and potential profit/loss values.

Price Points: Users can set their Entry and select whether they want to include a DCA entry, Stop Loss price, Liquidation Buffer %, Take Profit levels and the amount of position to close at each level.

Risk Management: Users fill out their Account Size, set their Risk % (or fixed $ amount) for each Entry, set Manual Leverage, or allow the indicator to automatically choose the leverage based on the Stop Loss price distance from Entry and the Risk % per Entry.

User-Input Descriptions

DCA Price: The price at which users initiate their second, equally sized and leveraged position when using a Dollar-Cost Averaging (DCA) strategy. Upon reaching the DCA Price, the Entry Price adjusts to the Avg Price, calculated as the midpoint between initial and DCA entries.

Liquidation Buffer: A pre-set percentage that determines how close to the Stop Loss a position can get before it's liquidated. This assists the Auto Leverage feature in optimizing the leverage amount according to risk tolerance.

Risk per Entry: The proportion of the account, in % or a fixed dollar amount, that users are willing to risk for each trading position. If DCA is checked, this will assume users are entering with half of the total position size per entry.

Automatic Leverage: Auto Leverage automatically determines the optimal leverage level for a trade based on the user's Stop Loss price distance from the Entry point and the user-defined risk percentage per Entry. It also considers a user-defined Liquidation Buffer, which is a preset percentage determining how close to the Stop Loss a position can get before it's liquidated. This tool allows traders to optimize their leverage amount according to their risk tolerance.

Max Leverage: The highest leverage level users are willing to use, even if the exchange permits higher. This limit applies when the Auto Leverage feature is enabled.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?