OPEN-SOURCE SCRIPT

Average Price Calculator / Visualizer

68
DCA Average Price Calculator - Visualize Your Breakeven & TP!

Ever wished you could visualize your trades and instantly see your average entry price right here on TradingView? Especially if you're a DCA (Dollar-Cost Averaging) trader like me, tracking multiple entries can be a hassle. You're constantly switching to a spreadsheet or calculator to figure out your breakeven and take-profit levels. Well I've developed this DCA Average Price Calculator to solve exactly that problem, bringing all your position planning directly onto your chart.

What It Does

This indicator is a interactive tool designed to calculate the weighted average price of up to 10 separate trade entries. It then plots your crucial breakeven (average price) and a customizable take-profit target directly on your chart, giving you a clear visual of your position.

Key Features

Up to 10 Order Entries: Plan complex DCA strategies with support for up to ten individual buys.
Flexible Size Input: Enter your position size in either USD Amount or Number of Shares/Contracts. The script is smart enough to know which one you're using.
Instant Average Price Calculation: Your weighted average price (your breakeven point) is calculated and plotted in real-time as a clean yellow line.
Customizable Take-Profit Target: Set your desired profit percentage and see your take-profit level instantly plotted as a green line.
Detailed On-Chart Labels: Each order you plot is marked with a detailed label showing the entry price, the number of shares purchased, and the total USD value of that entry.
Clean & Uncluttered UI: The main Average and TP labels are intelligently shifted to the right, ensuring they don't overlap with your entry markers, keeping your chart readable.

How to Use It - Simple Steps

Add the indicator to your chart.
Open the script's 'Settings' menu.
In the 'Take Profit' section, set your desired profit percentage (e.g., 1 for 1%).
Under the 'Orders' section, begin filling in your entries. For each 'Order #', enter the Price.
Next, enter the size. You can either fill in the 'Size (USD)' box OR the '/ Shares' box. Leave the one you're not using at 0.
As you add orders, the 'Avg' (yellow) and 'TP' (green) lines, along with the blue order labels, will automatically appear and adjust on your chart!

Who Is This For?

DCA Traders: This is the ultimate tool for you!
Position Traders: Keep track of scaling into a larger position over time.
Manual Backtesters: Quickly simulate and visualize how a series of buys would have played out.
Any Trader who wants a quick and easy way to calculate their average entry without leaving TradingView.

I built this tool to improve my own trading workflow, and I hope it helps you as much as it has helped me. If you find it useful, please consider giving it a 'Like' and feel free to leave any feedback or suggestions in the comments!

Happy trading

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.