OPEN-SOURCE SCRIPT
Weighted Average Entry (Nearest 0.25)

“If I add more contracts here, how much does it actually improve my position — and how much additional risk am I taking?”
This tool was designed to answer that exact question.
When traders are already inside a position and begin scaling in with additional entries, the average position price changes depending on:
* where the new entry is placed
* how many contracts are added
* the size of the existing position
Most traders understand that adding another entry changes the average price, but many do not fully understand how much their position actually improves compared to how much additional exposure and risk they are taking on.
This tool automatically calculates the weighted average entry price of a position using multiple contract sizes and multiple entry prices. It allows traders to instantly see how every new scale-in affects:
* the true average entry
* the breakeven level
* the distance to stop loss
* unrealized drawdown
* overall position exposure
* risk-to-reward efficiency
The primary purpose of the tool is risk management while already inside a trade.
For example:
a trader may already be short from a higher level and decide to add another short position lower in price. The additional entry may improve the average position price, but it may also increase overall risk significantly depending on the size added and the distance to the stop loss.
The tool helps traders visualize how far their position “slips” as more contracts are added and whether the improvement in average price is actually worth the increase in exposure.
Instead of manually calculating averages and contract weighting, the script instantly updates the true average position price directly on the chart.
This makes it especially useful for:
* futures trading
* ICT-style scaling entries
* laddering into Fair Value Gaps (FVGs)
* pyramiding positions
* execution-based trading models
* ES and NQ contract management
In simple terms, the tool helps traders make smarter decisions about scaling into positions by showing whether an additional entry genuinely improves the trade or simply increases risk without meaningful benefit.
This tool was designed to answer that exact question.
When traders are already inside a position and begin scaling in with additional entries, the average position price changes depending on:
* where the new entry is placed
* how many contracts are added
* the size of the existing position
Most traders understand that adding another entry changes the average price, but many do not fully understand how much their position actually improves compared to how much additional exposure and risk they are taking on.
This tool automatically calculates the weighted average entry price of a position using multiple contract sizes and multiple entry prices. It allows traders to instantly see how every new scale-in affects:
* the true average entry
* the breakeven level
* the distance to stop loss
* unrealized drawdown
* overall position exposure
* risk-to-reward efficiency
The primary purpose of the tool is risk management while already inside a trade.
For example:
a trader may already be short from a higher level and decide to add another short position lower in price. The additional entry may improve the average position price, but it may also increase overall risk significantly depending on the size added and the distance to the stop loss.
The tool helps traders visualize how far their position “slips” as more contracts are added and whether the improvement in average price is actually worth the increase in exposure.
Instead of manually calculating averages and contract weighting, the script instantly updates the true average position price directly on the chart.
This makes it especially useful for:
* futures trading
* ICT-style scaling entries
* laddering into Fair Value Gaps (FVGs)
* pyramiding positions
* execution-based trading models
* ES and NQ contract management
In simple terms, the tool helps traders make smarter decisions about scaling into positions by showing whether an additional entry genuinely improves the trade or simply increases risk without meaningful benefit.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.