Average Entry Price Break-Even Guide | SG Group
Skip to content
Japanese page

FreeOpen sourcePine Script v6

TradingView Free Indicator

Reconstruct quantity-weighted AVG from a known average or up to eight individual fills, then include entry and exit fees, exit friction, fixed costs, carry or funding, and other cost or credit in a fee-adjusted break-even.

Risk / Position Cost
Real chart published on TradingView: Average Entry Price and Fee-Adjusted Break-Even Workbench
Real chart image from the published TradingView page. The symbol, timeframe, settings and prices shown are a captured example, not current data or a trading result.
PurposeCalculate average entry and cost-adjusted break-even
Best forUsers manually auditing position costs
Primary outputAVG, break-even, Cost Gap and position panel
Chart placementPrice-chart overlay
01 — Overview

Read it as arithmetic from the entered cost model

Weighted Average divides total fill-price times quantity by total quantity. Direction-specific equations apply fees and friction, then displayed long break-even rounds upward and short break-even downward to the minimum tick. The current public interface is English-only with no Language input.

What it visualizes

Cyan solid AVG, orange dashed break-even, the Cost Gap between them, optional fill markers and historical paths, a position panel, and Campaign Recovery, Next Fill and Target Calculation scenarios.

How it works

PRICE ONLY uses percentage fees and price friction. FULL CASH uses a valid point value to convert fixed, carry and other cash costs and P&L. Cash costs without point value produce POINT VALUE NEEDED, and a failed residual health check suppresses break-even output.

Quantity-weighted AVG

Individual fills sum valid price times Qty and divide by total Qty. With dated fills, each row activates only after its Fill time.

Direction-specific break-even

Entry and exit fees, exit friction and per-unit cash cost enter separate long and short net equations. The result is substituted back into the same equation for a residual check.

Scenarios are hypothetical

Campaign Recovery applies realized P&L, Next Fill adds a hypothetical fill, and Target Calculation solves added Qty for a requested AVG or break-even. It is not recommended size.

02 — Install and start

Add it to TradingView

Add the public script to a chart and identify every drawing in the default configuration first. Change only one input at a time.

Average Entry Price and Fee-Adjusted Break-Even Workbench

Open the public Average Entry Price and Fee-Adjusted Break-Even Workbench page and add it to a TradingView chart. No SG Group account is required.

  1. Open the “Use on TradingView” link below.
  2. Select “Use on chart” on TradingView to add the script to your chart.
  3. Open the gear icon, then Settings → Inputs, and observe the default configuration first.
  4. Change one input at a time for the symbol and timeframe you are studying.
Observe the defaults firstChange one input at a timeVerify symbol, timeframe and feed

Prevent misreads when indicators overlap

Overlapping lines, bands, backgrounds or tables can be duplicate drawings of the same kind of information. Never treat visual overlap by itself as stronger evidence or signal agreement. A broker average-price line, TradingView position drawing or another break-even or fee calculator can duplicate AVG, break-even and Cost Gap. Historical paths, Campaign break-even, Next Fill break-even and target scenarios can also be mistaken for the current break-even.

  • Hide the broker or position-tool average and entry lines while identifying the cyan AVG and orange break-even.
  • Check Label layout so AVG, break-even and Cost Gap labels do not cover order or position labels.
  • Enable Historical paths, Fill markers, Campaign Recovery, Next Fill and Target Calculation one at a time.
  • Do not infer live position P&L from color or line location without reading INPUT, MODEL and STATUS in the panel.
03 — How to read it

A practical reading order

Do not turn one value or color into a conclusion. Check the condition, persistence and relationship to price in order.

Check INPUT and STATUS

Identify KNOWN AVG or FILLS, LONG or SHORT, Quantity, and any Insufficient input or No active position state.

Verify COST BASIS and model

Read PRICE ONLY, FULL CASH or POINT VALUE NEEDED and confirm which fees, friction and cash costs are included.

Separate VS BE from scenarios

Positive VS BE means the favorable side for either long or short; negative means unfavorable. Campaign, Next Fill and Qty required are separate hypothetical results.

Status and display terms

PRICE ONLY

Model using percentage fees and price friction without cash-cost conversion.

FULL CASH

Model converting fixed, carry and other cash costs and P&L with a valid point value.

POINT VALUE NEEDED

A valid point value is required to convert cash costs into price units.

NEAR BE / ABOVE BE / BELOW BE

Raw price location around break-even; use VS BE for direction-aware favorability.

Favorable side / Unfavorable side

Direction-aware VS BE is positive / negative.

Insufficient input / Calculation check failed / No active position

Missing inputs / residual validation failed / no active position.

04 — Settings reference

Settings reference

The labels below match the published script’s English Inputs panel. Defaults reflect the public source at the time of review and may change in a later TradingView update.

On small screens, each input is reformatted as a readable stacked card.

01 – Position

4 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[P1] Input methodKnown average; Known average / Individual fillsSelects a known position average or reconstruction from individual fills.
[P2] Position sideLong; Long / ShortSelects the long or short break-even equation and directional comparison.
[P3] Average price0.0Sets the known average entry price; zero leaves the position undefined.
[P4] Position quantity0.0; min 0, step 0.0001Sets the remaining open position quantity.

02 – Costs – Optional

9 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[C1] Entry fee (%)0.0; −50–50, step 0.001Sets the entry fee as a percentage of entry notional; negative values represent rebates.
[C2] Exit fee (%)0.0; −50–50, step 0.001Sets the estimated exit fee as a percentage of exit notional.
[C3] Exit friction (ticks)0.0; min 0, step 0.1Sets expected exit spread or slippage in minimum-tick units.
[C4] Detailed cash costsOffIncludes fixed, carry, and other cash costs in break-even calculations.
[C5] Fixed entry cost per order0.0; min 0, step 0.01Sets the fixed entry cost per order parameter used by 02 – Costs – Optional.
[C6] Entry orders1; min 0Sets the entry orders parameter used by 02 – Costs – Optional.
[C7] Fixed exit cost0.0; min 0, step 0.01Sets the fixed exit cost parameter used by 02 – Costs – Optional.
[C8] Carry / funding0.0; step 0.01Sets the carry / funding parameter used by 02 – Costs – Optional.
[C9] Other cost or credit0.0; step 0.01Sets the other cost or credit parameter used by 02 – Costs – Optional.

03 – Individual Fills

17 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[F1] Number of fills1; 1–8Selects how many of the eight fill rows participate in the calculation.
[F2] Fill 1price 0.0Sets the execution price for fill 1.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F3] Fill 2price 0.0Sets the execution price for fill 2.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F4] Fill 3price 0.0Sets the execution price for fill 3.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F5] Fill 4price 0.0Sets the execution price for fill 4.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F6] Fill 5price 0.0Sets the execution price for fill 5.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F7] Fill 6price 0.0Sets the execution price for fill 6.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F8] Fill 7price 0.0Sets the execution price for fill 7.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.
[F9] Fill 8price 0.0Sets the execution price for fill 8.
Qty0.0; min 0, step 0.0001Sets the quantity assigned to the corresponding fill row.

04 – Research – Optional

9 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[R1] Campaign recoveryOffShows an alternative recovery break-even adjusted for realized profit or loss.
[R2] Realized P&L0.0; step 0.01Sets realized profit or loss used by the optional campaign-recovery calculation.
[R3] Next fillOffEnables a hypothetical next-fill break-even scenario.
[R4] Next price0.0Sets the price used for next.
[R5] Next quantity0.0; min 0, step 0.0001Sets the quantity used for next.
[R6] Target calculationOffEnables the solver for a target average price or fee-adjusted break-even.
[R7] Target typeAverage price; Average price / Fee-adjusted Break-EvenSelects whether the solver targets average price or fee-adjusted break-even.
[R8] Target price0.0Sets the price used for target.
[R9] Additional fill price0.0Sets the price used for additional fill.

05 – Display

22 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[D1] LayoutOverview; Clean / Minimal / Overview / Research / CustomSelects a display preset for lines, bands, labels, history, and panels.
[D2] Position PanelOverview; Off / Compact / Overview / DetailedSelects the amount of information shown in the position panel.
[D3] Panel positionBottom Left; Bottom/Top/Middle × Left/RightSelects where the position panel is placed on the chart.
[D4] Bottom-left clearanceAuto; Auto / Extra / OffControls transparent clearance around TradingView’s lower-left interface.
[D7] Contrast modeAuto; Auto / High / SoftSelects automatic, high, or soft chart-theme contrast.
[D8] Label layoutAuto; Auto / Split / Combined / Right edge / OffSelects how average and break-even labels are arranged.
[D9] Show Current vs BE chart noteOffShows or hides current vs be chart note.
[D10] Show setup guideOffShows or hides setup guide.
[D11] Panel meter range (%)1.0; 0.01–100, step 0.01Sets the panel meter range (%) parameter used by 05 – Display.
[D12] Average color#00b0ffSets the color used for average.
[D13] Break-even color#ff9800Sets the color used for break-even.
[D14] Average width2; 1–5Sets the average width parameter used by 05 – Display.
[D15] Break-even width3; 1–5Sets the break-even width parameter used by 05 – Display.
[D16] Gap visibility10; 0–100Sets the gap visibility parameter used by 05 – Display.
[D17] Label text colorwhiteSets the color used for label text.
[D18] Panel sizeSmall; Tiny / Small / Normal / LargeSets the displayed size of text.
[D19] Base label offset3; 0–400Sets the offset used for base label offset.
[D20] Label lane spacing5; 1–30Sets the label lane spacing parameter used by 05 – Display.
[D21] Minimum separation (ticks)8; 1–500Sets the minimum separation (ticks) parameter used by 05 – Display.
[D22] Historical pathsOffSets the historical paths parameter used by 05 – Display.
[D23] Fill markersOffSets the fill markers parameter used by 05 – Display.
[D24] Show Cost Gap labelOffShows or hides cost gap label.

06 – Advanced

21 inputs
Input labelDefault / optionsWhat it controls and when to adjust it
[A1] Point value override0.0; 0–1e9, step 0.0001Overrides the symbol point value used for cash-cost and P&L conversion; zero uses automatic metadata.
[A2] Fill validationRequire all selected rows; Require all selected rows / Use valid rows onlySelects whether every chosen fill row must be valid or only valid rows are used.
[A3] Position timingCurrent state; Current state / From start timeSelects whether the known position applies to all history or only after a start time.
[A4] Position start time2024-06-03 00:00 UTC equivalent (1717372800000)Sets when a known-average position becomes active in From start time mode.
[A5] Current line span (bars)150; 10–5000Sets the current line span (bars) parameter used by 06 – Advanced.
[A6] Use dated fillsOffActivates each fill only after its assigned timestamp.
[A7] Exit friction unitTicks; Ticks / Price unitsSelects ticks or direct price units for detailed exit friction.
[A8] Exit friction (price)0.0; min 0, step 0.0001Sets the exit friction (price) parameter used by 06 – Advanced.
[A9] Fill 1 time2024-06-03 00:00 UTC equivalentSets the activation timestamp for fill 1 when dated fills are enabled.
[A10] Fill 2 time2024-06-04 00:00 UTC equivalentSets the activation timestamp for fill 2 when dated fills are enabled.
[A11] Fill 3 time2024-06-05 00:00 UTC equivalentSets the activation timestamp for fill 3 when dated fills are enabled.
[A12] Fill 4 time2024-06-06 00:00 UTC equivalentSets the activation timestamp for fill 4 when dated fills are enabled.
[A13] Fill 5 time2024-06-07 00:00 UTC equivalentSets the activation timestamp for fill 5 when dated fills are enabled.
[A14] Fill 6 time2024-06-10 00:00 UTC equivalentSets the activation timestamp for fill 6 when dated fills are enabled.
[A15] Fill 7 time2024-06-11 00:00 UTC equivalentSets the activation timestamp for fill 7 when dated fills are enabled.
[A16] Fill 8 time2024-06-12 00:00 UTC equivalentSets the activation timestamp for fill 8 when dated fills are enabled.
[A17] Panel price modeLive price; Live price / Confirmed closeSelects live price or the last confirmed close for panel comparisons.
[A18] Use current price on non-standard chartsOffAllows synthetic-chart prices in Current vs BE calculations; alerts remain disabled.
[A19] Visual separation lookback (bars)150; 10–1000Sets the visual separation lookback (bars) parameter used by 06 – Advanced.
[A20] ATR separation factor0.20; 0–5, step 0.01Sets the atr separation factor parameter used by 06 – Advanced.
[A21] Range separation (fraction)0.01; 0–1, step 0.001Sets the range separation (fraction) parameter used by 06 – Advanced.
05 — Alerts

Alerts report events, not decisions

Alerts are state, touch or transition events defined in the public source. They are not trade instructions.

  • Price crossed Average Entry.
  • Price crossed Break-Even.
  • Price entered Cost Gap and Price exited Cost Gap.
  • Price crossed Campaign Recovery Break-Even.
  • Price crossed Next-Fill Preview Break-Even.
  • Alerts require a valid position, healthy calculation, standard chart and a stable prior-bar level; they are disabled on non-standard charts.
06 — Limitations and responsible use

Not a buy/sell signal

This tool is for analysis and visualization. It is not investment advice, a trade recommendation, a forecast, or a promise of profit or accuracy. Results depend on inputs, symbol, timeframe, and data feed. You remain responsible for every trading decision.

No broker connection

All inputs are manual. The script does not read or modify a Trading Panel, account, live position, partial exit, position flip or order.

Costs and point value are user-supplied

It does not calculate tax or currency conversion. Accuracy depends on fees, spread, slippage, funding and contract point value.

Scenarios are not advice

Campaign, Next Fill and Target are arithmetic assumptions. They do not recommend adding capital, averaging, recovery, safe size or expected profit.

Important

AVG, break-even, Cost Gap, Campaign break-even, Next Fill break-even and Qty required all derive from the same manual position and cost assumptions. Do not count them as independent trade reasons or guaranteed execution outcomes.

07 — FAQ

Frequently asked questions

Clarify weighted AVG, cost models, point value and direction-aware VS BE.

Is Average Entry Price and Fee-Adjusted Break-Even Workbench free to use?

Yes. It is a free, open-source indicator published by SG Group on TradingView. Review TradingView’s terms and the conditions attached to the public script before reuse or redistribution.

Should I change the settings immediately?

Start with the published defaults and observe the drawings and state changes first. Then change one input at a time for the symbol, timeframe and data feed so you can identify what caused each visual change.

Can I display it with other indicators?

Yes, but similar lines, bands, backgrounds and tables can overlap and obscure their source. Isolate each indicator first and hide duplicate components. Visual overlap alone is not stronger evidence or signal agreement.

Does the display provide trade signals?

No. It is analysis and visualization context consistent with the public description. It does not provide entries, exits, targets, stops, price forecasts, or promises of profit, win rate or accuracy.

Why does POINT VALUE NEEDED appear?

Fixed costs, carry, other cash adjustments and realized P&L require a valid point value for conversion into price units. Remove inapplicable cash costs or verify the contract point value.

Source basis and update policy

This guide is grounded in SG Group’s live catalogue, the script’s published TradingView description, and the user-facing inputs in its open source. Labels and defaults can change after a script update.