OPEN-SOURCE SCRIPT
Updated

AG Pro Position Planner [AGPro Series]

8 920
AG Pro Position Planner [AGPro Series]

OVERVIEW

AG Pro Position Planner is a structured trade-planning and risk-organization tool designed for traders who want to map a position before execution. It focuses on four core elements of trade preparation: entry location, stop placement, target mapping, and position sizing. Instead of trying to predict direction or generate automated entries, the script helps organize a plan around levels that the user defines manually.

The purpose of this tool is not to tell the user what to buy or sell. Its purpose is to turn a discretionary plan into a visible, measurable framework on the chart. By combining entry, stop, risk budget, capital usage, and target structure in one view, the script helps reduce planning ambiguity and makes the trade idea easier to review before any order is placed.

The script supports both long and short planning. It can also operate in two different target modes. In R-Based mode, targets are derived from the distance between entry and stop. In Manual mode, the user can input exact target prices directly and the script will convert those targets into their implied R-multiples. This allows the same tool to support both systematic planning and discretionary scenario mapping without changing the underlying workflow.

The visual design is intentionally restrained. The chart shows entry, stop, and target levels, along with optional reward and risk zones. A compact panel summarizes the key planning information, including direction, mode, risk per unit, risk budget, sizing, exposure, and target statistics. The result is a planning layout that remains readable on both light and dark themes while keeping the focus on structure rather than decoration.

snapshot

WHAT THIS SCRIPT DOES

This script helps the user:

• define a planned entry price
• define a planned stop price
• convert account risk into a position size estimate
• map one to three targets on the chart
• compare manual targets to the initial risk distance
• review exposure before execution
• validate whether a manual target structure is logically ordered
• visualize the reward zone above entry and the risk zone below entry for long scenarios, or the inverse logic for short scenarios

The script is designed as a planning layer. It does not attempt to replace the user’s analysis process. It assumes the user already has a trade idea and needs a cleaner way to structure and review that idea.


UNIQUE EDGE

The distinguishing feature of this script is not signal generation. Its edge is organizational clarity.

Many tools focus on entries, signals, or directional interpretation. This one focuses on plan construction. The user chooses the key prices, and the script translates them into a coherent risk model. That distinction matters. The script does not present itself as a forecasting engine, a market-timing system, or an automated decision model. It is a position-planning framework.

A second differentiator is the dual target workflow. Some users think in fixed R-multiples. Others think in exact price objectives. AG Pro Position Planner supports both approaches in the same interface. In Manual mode, the script still reports the effective R-value of each target, which helps the user compare discretionary targets against the initial stop distance without losing consistency.

A third differentiator is the built-in validation behavior. The script checks whether the trade structure is logically valid for the chosen direction. In Manual mode, it also checks whether the targets are placed in the correct direction and in the correct order. This helps the user detect plan errors before execution rather than after the fact.


METHODOLOGY

The planning model is straightforward by design.

1) Entry and stop define the base risk distance.
The script measures the absolute distance between entry and stop. That distance becomes the reference risk per unit.

2) Account risk defines the risk budget.
The user enters an account size and a percentage risk per trade. The script converts this into a monetary risk budget.

3) Position size is estimated from the risk budget.
The script divides the risk budget by effective risk per unit and rounds the resulting quantity down to the selected quantity step.

4) Optional fee adjustment can be included.
An estimated fee percentage can be added to the per-unit risk as a conservative sizing buffer.

5) Targets are then mapped in one of two ways.
In R-Based mode, each target is calculated from the entry-to-stop distance using the selected R-multipliers.
In Manual mode, the user provides exact target prices and the script calculates the implied R-value of each target relative to the original stop distance.

6) Exposure statistics are summarized in the panel.
The panel shows stop distance, capital usage, risk budget, and sizing information so the trade can be evaluated as a complete plan rather than as isolated levels.

This methodology is intentionally transparent. The script is not using hidden directional filters, prediction logic, or undisclosed entry models. The calculations are derived from the user’s own inputs.


TARGET MODES

R-Based Mode

R-Based mode is intended for users who want a consistent structure around initial risk. The user defines entry and stop, then sets target multipliers such as 1R, 2R, or 3R. The script projects those levels automatically from the base risk distance. This is useful when the user wants standardized scenario planning and fast comparison between multiple setups.

Manual Mode

Manual mode is intended for users who work with exact price objectives. In this mode, the user enters target prices directly. The script then converts those levels into implied R-values. This allows discretionary targets to be measured against the same initial risk model.

To reduce planning mistakes, the script validates whether manual targets are placed in the correct direction and in the correct order for the chosen trade direction. Invalid target structures are flagged in the panel instead of being silently accepted.


PANEL AND VISUAL STRUCTURE

The chart can display:

• entry line
• stop line
• target lines
• reward zone
• risk zone
• right-side labels for entry, stop, and targets
• a compact summary panel

The panel is designed to keep the most useful information visible without taking over the chart. Its goal is to support review, not to dominate the screen.

The compact panel includes:

• plan summary
• validation badge
• entry and stop
• risk per unit
• risk budget
• sizing
• exposure
• target statistics

This structure is meant to help the user answer practical questions quickly:
How much is being risked?
How large is the position?
How much capital is being used?
How far is the stop?
What does each target represent in both price and R terms?


KEY INPUTS

Trade Setup
• Trade Direction
• Target Mode
• Entry Price
• Stop Price
• R-based targets
• Manual targets

Risk Model
• Account Size
• Risk Per Trade (%)
• Estimated Fees (%)
• Quantity Step

Visual Settings
• Panel visibility
• Panel position
• Panel theme
• Panel text size
• Level label size
• Label offset
• Risk/reward zone visibility
• Zone transparency
• Individual target visibility

These inputs are separated by function so the planning workflow stays readable and predictable.


VALIDATION AND SAFETY LOGIC

The script validates several conditions before presenting a plan as valid.

For direction:
• Long plans require stop below entry
• Short plans require stop above entry

For base structure:
• Entry must be positive
• Stop must be positive
• Account size must be positive
• Risk percentage must be positive
• Quantity step must be positive
• Entry and stop must not be identical

For manual targets:
• Targets must be in the correct direction relative to entry
• Targets must be logically ordered for the selected direction

If the structure is invalid, the panel reflects that status instead of presenting the setup as a clean plan. This behavior is intentional. The script is designed to help organize decisions, but also to prevent simple construction errors from being overlooked.


WHO THIS SCRIPT IS FOR

This script is intended for users who already make their own directional decisions and want a cleaner way to structure position plans on the chart.

It may be useful for:
• discretionary traders
• swing traders
• intraday traders
• users who plan entries and stops manually
• users who prefer fixed-R target mapping
• users who want manual targets translated into risk terms
• users who want better visual discipline before execution

It is less relevant for users who are looking for:
• automated entries
• hidden directional logic
• predictive signals
• scanner behavior
• portfolio automation
• strategy backtests


SIGNALS AND ALERTS

This script does not generate buy signals or sell signals.
This script does not publish automated trade calls.
This script does not attempt to identify market direction.
This script does not include alert logic for execution decisions.

Its purpose is planning, visualization, and risk organization.


LIMITATIONS AND TRANSPARENCY

This script is a planning tool, not an execution engine.

It does not know whether the selected entry will be filled.
It does not know whether slippage will occur.
It does not know whether the market will reach the defined targets.
It does not account for instrument-specific margin rules, liquidation mechanics, funding costs, or exchange-specific order behavior unless the user adjusts inputs manually.

The sizing output is an estimate based on the values entered into the script. Real-world execution may differ due to slippage, fees, order type, spread, partial fills, and instrument-specific trading conditions.

In Manual mode, the script evaluates the price structure entered by the user, but it does not claim that those targets are likely to be reached. It only expresses them relative to the initial risk distance.

The chart zones are visual planning aids. They are not probability forecasts and should not be interpreted as predictive boundaries.


WHAT THIS SCRIPT IS NOT

This script is not:
• a strategy tester
• a signal service
• an automated trade system
• a forecasting model
• a promise of profitability
• a replacement for independent analysis
• a substitute for execution judgment
• a guarantee of risk control in live market conditions

It is a structured chart tool for planning and reviewing position scenarios.


RISK DISCLOSURE

Trading and investing involve risk. Any planned setup can fail, and losses can exceed expectations due to slippage, volatility, or execution conditions. This script is provided as an organizational and visualization tool only. Users remain fully responsible for their own analysis, trade selection, order placement, and risk management decisions.

No indicator can remove market risk. A visually clean plan is still only a plan. Position sizing, stop placement, and target mapping should always be reviewed in the context of the instrument, timeframe, liquidity conditions, and the user’s own trading process.


FINAL NOTE

AG Pro Position Planner is built around a simple idea: a trade plan should be measurable before it is actionable. By turning entry, stop, risk budget, sizing, and targets into a single visible structure, the script aims to make discretionary planning more disciplined, more transparent, and easier to review.

The script does not attempt to decide for the user. It helps the user define the plan clearly enough to evaluate it.
Release Notes
UPDATE NOTES - V1.6

This update focuses on presentation quality, visual hierarchy, and first-glance readability across the chart.

AG Pro Position Planner continues to serve the same core purpose: helping users structure a trade idea around entry, stop, targets, and position sizing in a clean and practical planning layout. This release does not change that purpose. Instead, it refines how the plan is displayed so the chart can communicate the scenario more clearly and with less visual friction.

The main goal of this update is to make the planner easier to read at a glance while preserving its rules-based planning framework. The script remains a planning tool, not an execution engine and not a predictive system. The underlying objective is still to help users translate a trade idea into a structured risk-defined scenario.

What changed

• Refined summary panel presentation
The planning panel has been visually upgraded to improve clarity and information hierarchy. Key rows such as plan direction, risk budget, exposure, and targets are now easier to scan without overwhelming the chart.

• Improved panel value formatting
Numeric presentation has been cleaned up so sizing and value rows appear more structured and easier to interpret. This helps the panel look cleaner while keeping the same planning logic intact.

• Stronger visual separation between reward and risk areas
The chart zones between entry, stop, and targets have been refined to improve contrast and visual balance. This makes the planned trade structure easier to understand directly from the chart.

• Better target ladder readability
Target levels now present a clearer visual progression so the planned path from entry to higher reward objectives is easier to follow.

• Enhanced right-side label hierarchy
Entry, stop, and target labels have been adjusted for a more balanced visual structure. This improves readability on the right side of the chart and helps the plan remain understandable when viewed quickly.

• Clearer entry emphasis
The entry level has been visually strengthened so the center of the plan is easier to identify. This helps users orient themselves more quickly around the core decision level of the setup.

• More polished chart appearance
Several small visual refinements were applied across the overall layout to improve the presentation quality of the script without changing its analytical intent.

How to interpret the script

• Entry defines the planned participation level.
• Stop defines the invalidation level for the scenario.
• Targets outline the projected reward map relative to the selected planning method.
• The panel summarizes risk per unit, capital at risk, position sizing, and scenario exposure based on user inputs.
• The chart zones are intended to visually separate planned reward space from planned risk space so the structure of the scenario is easier to review.

What did not change

• The script remains a position-planning tool.
• The core planning workflow remains centered on entry, stop, target structure, and risk-based sizing.
• This release does not attempt to turn the script into a signal generator or trade recommendation engine.
• The purpose is still to support structured planning and scenario visualization.

Transparency and limitations

This script is designed to assist with planning and visualization. It does not know future price movement, does not guarantee outcomes, and does not replace independent judgment, risk management, or execution discipline.

Values shown by the script depend on user-defined inputs such as entry, stop, targets, account size, risk percentage, fee assumptions, and quantity step. Different settings can produce materially different planning outputs.

Risk disclosure

This script is for analytical and educational use only. It is intended to help users organize a trade plan visually and numerically. It should not be interpreted as financial advice, investment advice, or a promise of performance.
Release Notes
AG Pro Position Planner [AGPro Series]
Update Notes - V1.7

This update focuses on visual organization and chart readability while keeping the script centered on trade planning, position sizing, and structured risk mapping.

• Refined the on-chart plan layout to make the active trade structure easier to read.
• Added a more focused risk/reward box presentation between entry, stop, and projected targets.
• Updated the summary panel header to the standardized AG Pro single-row blue title format.
• Set the default panel text size to Small for a cleaner chart footprint.
• Kept level labels at a Normal default size to preserve readability on publish screenshots and live charts.
• Improved overall visual hierarchy so entry, stop, and target levels behave more like one unified planning block.
• Applied general presentation cleanup for a more compact and balanced overlay.

This update is primarily visual and organizational. The script remains a planning and risk-structure tool and does not change its core purpose.
Release Notes
AG Pro Position Planner — v1.8 Update Notes
============================================

This update expands the planner into a full trade-execution cockpit while keeping the
interface clean and intuitive. Focus is on professional risk management, leverage-aware
margin calculation, fee-adjusted breakeven tracking, and sequential take-profit simulation.

Not a strategy. This tool is a visual planning aid; it does not place orders, generate
signals, or forecast price direction.

-----------
What's new
-----------

Leverage input (1x–125x)
Margin calculation now reflects the real capital blocked when trading on leverage.
Spot traders simply leave leverage at 1x. Futures traders enter their intended leverage
to see the actual margin requirement and capital usage ratio.

Fee-adjusted breakeven level
A new breakeven line shows the exact price where the trade closes at zero net P&L after
round-trip execution fees. Rendered as a thin amber line with its own right-side label.

Sequential TP allocation engine
Four allocation modes for splitting position size across active targets:
- Equal Split: divides evenly
- Front Loaded: 50/30/20 (takes more at T1)
- Back Loaded: 20/30/50 (holds more for T3)
- Custom: set your own weights

Blended exit metric
The panel now shows the quantity-weighted average exit price and blended R multiple
across all active targets, giving a realistic picture of expected return when laddering out.

R-Ladder bands
Intermediate R levels (0.5R, 1.5R, 2.5R depending on spacing) render as thin horizontal
bands between entry and the farthest target. Creates a clean S/R-style reference grid
without duplicating the active target lines.

Adaptive Focus Box
New "Focus Box Width Mode" input. Auto mode adapts the plan box width to the current
timeframe so intraday and higher timeframes both render cleanly. Manual mode keeps the
classic bar-count control.

Redesigned summary panel
The panel is reorganized into three clear blocks:
- Plan header (direction, target mode, allocation mode)
- Risk Cockpit (risk budget, sizing, margin, breakeven, max loss)
- Target Ladder (per-target price, R, quantity, weight, P&L, plus blended average exit)

Theme & position options
Dark and Light panel themes. Five panel positions including Middle Right. Panel and label
font size are independently adjustable with Normal as default.

Refined visual hierarchy
Naming standard, header block, and color palette updated for consistency across the
AGPro Series. Anti-overlap label spacing refined for busier charts.

-----------
How to use
-----------

1. Enter your planned entry price and stop price.
2. Choose R-Based targets (default) or Manual target prices.
3. Set account size, risk percentage, and leverage.
4. Pick a TP allocation mode that matches your exit style.
5. Read the panel: confirm status is PLAN VALID, review sizing and margin, then execute
on your broker of choice.

-----------
Notes
-----------

Does not place orders. Does not generate signals. Does not forecast direction.
Position sizing and fee estimates are approximations for planning purposes only.
Always verify margin, fees, and execution sizes with your broker before trading.
Release Notes
## Update Notes - V2.0

This update upgrades Position Planner into a cleaner execution cockpit for risk-defined trade planning. The workflow remains simple: define entry, stop, targets, risk percentage, fees, leverage, and quantity step; the script converts that structure into position size, required margin, breakeven, allocation, average exit, blended R, and a compact plan quality score.

### What Changed

- Added a Plan Quality Score to summarize the structure of the setup from a risk-discipline perspective.
- Added weighted Average Exit plotting based on active targets and take-profit allocation.
- Added extended rectangular risk/reward zones for a cleaner S/R-style planning map.
- Added Label Detail control with Minimal, Balanced, and Full modes.
- Improved right-side label spacing so labels stay clear of candles and crowded levels.
- Added fee drag visibility in the panel as Cost % of R.
- Capped R-ladder rendering to keep the chart clean and the script fast.
- Updated script naming standard: the published script title no longer starts with “AG Pro”; the AG Pro brand remains only in the panel title.
- Refined the panel into the AGPro standard format with a single merged blue header row.
- Improved visual hierarchy using the AGPro color palette for a cleaner premium chart appearance.

### Positioning

Position Planner is not a signal generator, optimizer, or automated trade system. It is a professional planning layer for traders who already have a setup and want to review the full execution structure before acting.

The panel brings together the most important planning metrics in one glance: position size, stop distance, risk budget, fee-adjusted breakeven, required margin, weighted target allocation, average exit, blended R, and plan quality.
Release Notes
UPDATE NOTES - V2.1

This update focuses on execution-planning clarity, chart readability, and a stronger decision-engine workflow.

The core purpose of the script remains unchanged.
This release improves how the existing Position Planner logic is presented, organized, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Added a cleaner Plan Quality model
The planner now converts geometry, risk distance, target room, stop quality, fee drag, margin load, and target-balance structure into a 0-100 score.

• Added a clearer next-action state
The panel can now show READY, MONITOR, WAIT, RISK REVIEW, MANAGE, BLOCKED, or INVALIDATED based on the active plan context.

• Added active invalidation emphasis
The stop area is treated as an active invalidation zone with a centered zone label and a dedicated right-side STOP / INV label.

• Strengthened target-stack planning
The target stack now links active targets, weighted allocation, average exit, and blended R into one chart-first planning workflow.

• Added fee-drag visibility
The breakeven label and panel action row show fee drag as a percentage of initial R so users can evaluate whether cost is consuming too much of the plan.

• Added screenshot-led invalidation polish
The chart badge now prioritizes the current action state and keeps the quality score compact, so INVALIDATED plans do not visually read as active high-confidence setups.


------------------------
Visual Improvements
------------------------

• Improved chart readability by using cleaner plan zones, right-side labels, and a capped R ladder.

• Reduced visual clutter while keeping enough labels visible for a premium, non-empty chart.

• Refined visual hierarchy so entry, stop, target stack, weighted exit, breakeven, and plan quality stand out clearly.

• Adjusted label positioning with anti-overlap spacing so labels stay clear of candles, tight level clusters, and the upper target label stack.


------------------------
Interface & Usability
------------------------

• Optimized the panel into the required AGPro decision layout: Plan Quality, Entry, Stop, Target Stack, and Action.

• Preserved the AGPro standard merged blue header row with only the script name in the first row.

• Added panel show/hide, panel location, panel theme, panel font size, and label font size controls.

• Kept the public title clean as Position Planner [AGPro Series], with AG Pro reserved for the panel title.


------------------------
Behavior Notes
------------------------

This update does not turn Position Planner into a signal generator or a complete Trading Suite.

The goal is to improve risk-defined execution planning, not to introduce predictive behavior.

Users should interpret outputs as structured planning context: plan validity, score, risk edge, target stack, fee impact, and next review state.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, spread, fees, slippage, and timeframe differences may affect how a plan should be interpreted.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
🔧 UPDATE NOTES - v2.2

This update focuses on readability of the in-zone labels.

The core purpose of the script remains unchanged.
This release improves how the existing logic is presented on the chart.

This script continues to function as an analytical and planning tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• In-zone labels are now contrast-safe badges
The "ACTIVE INVALIDATION" and "TARGET STACK | AVG R" texts inside the risk and
reward zones were previously drawn as plain text directly on the transparent
zone fill, which could be hard to read against candles. They are now rendered as
opaque, centered badges with a luminance-based ink rule, so the text stays
crisp and legible at any zoom level.

• No change to the planning map
The risk and reward zones, entry, stop, target, weighted-exit, breakeven, and R
ladder lines, the right-side level labels, and the summary panel are all
unchanged. Only the two in-zone texts were upgraded to centered badges.


------------------------
Visual Improvements
------------------------

• Improved readability of the in-zone labels against candles and zone fills

• Kept the in-zone labels vertically and horizontally centered inside each zone

• Preserved the existing visual hierarchy of the planning map


------------------------
Interface & Usability
------------------------

• Improved label readability for better chart interaction

• Enhanced overall first-glance clarity without changing core logic


------------------------
Behavior Notes
------------------------

This update does not change the core planning, scoring, or invalidation logic of
the script.

Only the presentation of the two in-zone labels was changed. Users should
interpret all outputs exactly as before.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based planning and visualization tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how a plan should be interpreted.

Outputs should always be reviewed within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.

Disclaimer

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.