PROTECTED SOURCE SCRIPT
업데이트됨 Distrodisco_v1.4

What it does:
Defines a “distribution session” (customizable time window) and tracks that session’s high/low to compute its distribution width as a percentage.
Compares the current session’s distribution to historical same-day-of-week distributions to detect when it crosses above the median (i.e., a meaningful breakout in context).
Tags the breakout direction (long or short) based on wick extremes and prior-session pivots.
After a tagged break, tracks the pullback/retrace: how far price reverses back toward the tag (used for SL tuning).
Simultaneously measures how far price extends beyond the break before the retrace begins—this “extension before retrace” can be used to calibrate realistic take-profit targets.
Maintains historical accumulators for both retrace sizes and extensions so you can see distributions over time.
Key metrics shown in the table:
Total Days / Median Hits: Coverage of historical samples and how often distribution crosses its median.
Pullback Rate: Percentage of median breaks that produced a pullback (including live/active ones if the session ends mid-retrace).
Current / Historical Distribution Stats: Current session’s width vs. historical median/average for that weekday.
Reversion Ret (revAbs): The largest pullback after a break (live for the session), used as a de-facto stop-loss gauge.
Hist Median Ret: Median of completed historical retraces (and active ones at session end if not closed).
90%ile Ret: Upper-bound reference for retrace size—what the larger retraces look like.
>= X% PBs: User-defined threshold (e.g., enter 0.05 for 0.05%) showing the percentage of historical retraces that met or exceeded that magnitude.
Extension Median / 90%ile / Last Ext: How far price typically runs past the break before reversing—used for take-profit calibration. (If not yet enabled, these are forthcoming additions.)
Inputs:
Distribution Session / Timezone: Define the intra-day window to consider for distribution measurement.
Max Distribution % to Include: Caps abnormally wide distributions from polluting historical buckets.
Filter Out Abnormally Large Days: Toggle to exclude outliers.
Min Pullback to Count (%): Threshold to count “meaningful” retraces in the historical percentage bucket. Enter e.g. 0.05 to represent 0.05%.
Table styling: Color and positioning for easy visibility.
Defines a “distribution session” (customizable time window) and tracks that session’s high/low to compute its distribution width as a percentage.
Compares the current session’s distribution to historical same-day-of-week distributions to detect when it crosses above the median (i.e., a meaningful breakout in context).
Tags the breakout direction (long or short) based on wick extremes and prior-session pivots.
After a tagged break, tracks the pullback/retrace: how far price reverses back toward the tag (used for SL tuning).
Simultaneously measures how far price extends beyond the break before the retrace begins—this “extension before retrace” can be used to calibrate realistic take-profit targets.
Maintains historical accumulators for both retrace sizes and extensions so you can see distributions over time.
Key metrics shown in the table:
Total Days / Median Hits: Coverage of historical samples and how often distribution crosses its median.
Pullback Rate: Percentage of median breaks that produced a pullback (including live/active ones if the session ends mid-retrace).
Current / Historical Distribution Stats: Current session’s width vs. historical median/average for that weekday.
Reversion Ret (revAbs): The largest pullback after a break (live for the session), used as a de-facto stop-loss gauge.
Hist Median Ret: Median of completed historical retraces (and active ones at session end if not closed).
90%ile Ret: Upper-bound reference for retrace size—what the larger retraces look like.
>= X% PBs: User-defined threshold (e.g., enter 0.05 for 0.05%) showing the percentage of historical retraces that met or exceeded that magnitude.
Extension Median / 90%ile / Last Ext: How far price typically runs past the break before reversing—used for take-profit calibration. (If not yet enabled, these are forthcoming additions.)
Inputs:
Distribution Session / Timezone: Define the intra-day window to consider for distribution measurement.
Max Distribution % to Include: Caps abnormally wide distributions from polluting historical buckets.
Filter Out Abnormally Large Days: Toggle to exclude outliers.
Min Pullback to Count (%): Threshold to count “meaningful” retraces in the historical percentage bucket. Enter e.g. 0.05 to represent 0.05%.
Table styling: Color and positioning for easy visibility.
릴리즈 노트
Distrodisco_v1.6.1- Normalized all percent metrics to decimals and cleaned up table formatting (uses format.percent correctly).
- Unified extension logic with lastExtension and centralized calculation helper; fixed inconsistent pushes.
- Refactored retrace start/end flow (separate start/update/end) so PB end tags fire reliably.
- Updated session highlight to a stable live+final box pattern to eliminate floaty visuals.
- Miscellaneous bug fixes around tagging and pullback measurement.
릴리즈 노트
Temporarily removed flags 릴리즈 노트
- Added toggled to enable/disabled Table Cells (declutter) 릴리즈 노트
- adjusted on chart name (sorry) 릴리즈 노트
Added mode calculation for historical retraces and extensions with adaptive binning (configurable bin size) to surface the most frequently occurring move. Handles NaNs and empty data safely.Fixed extension tracking so only real numeric extensions are pushed into history.
Robustified mode logic to avoid array errors (proper bin creation/increment and invalid bin size guarding).
Added visibility toggles so users can show/hide individual stats (median, average, current dist, retrace, mode, etc.).
Miscellaneous stability improvements around distribution/session handling and edge-case guards.
릴리즈 노트
- Forgot to adjust on chart name 🤦♂️릴리즈 노트
- Fixed a bug where Retraces were measured even after price had been reclaimed- Fixed Extension math so it no longer shows N/A (wasn't handling 0 well previously)
릴리즈 노트
🔹 Functional UpdatesBreak Candle Flagging
Added an optional showFlags input to plot a "Break ↑" / "Break ↓" label on the bar where the median break occurs.
Retrace Entry/Exit Flags
Plots an "Entry" label when the retrace starts.
Plots an "Exit (New HH / LL)" or "Exit (Sess End)" label when the retrace ends.
Extension Tracking Fix
Ensured extensions are cleaned (f_clean) before calculating median/mode, so NA values don’t skew stats.
Mode Calculation Toggle
Added inputs showModeRet & showModeExt so mode rows can be toggled on/off in the table.
Table Row Visibility Toggles
Added a bunch of show_____ inputs to selectively show/hide rows (e.g., Total Days, Median Hits, Pullback Rate, Curr Ret, etc.).
🔹 Internal Logic Improvements
Refined TAG DETECTION so breakout direction is decided via prior session high/low, falling back to midpoint if unclear.
Reset all extension/retrace tracking variables properly at each new median break.
Used clean arrays when computing extension stats to avoid incorrect numbers from NA pollution.
릴리즈 노트
Small update: - Added next bar tracking
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.