PROTECTED SOURCE SCRIPT
CyberFlow [Probabilities] | Fractalyst

What's the indicator's purpose and functionality?
CyberFlow quantifies, per chosen higher-timeframe “Period 1/2/3”, what happens after price first taps the midpoint (Mid) of the previous period’s range. Specifically, it estimates P(High first | Mid tap) versus P(Low first | Mid tap): which side (previous High “PH” or previous Low “PL”) is typically reached first after that mid activation.
It extends a previously shared OrderFlow concept that used market structure; here it conditions on higher‑timeframe previous‑period PH/PL with the Mid as the explicit trigger.

Note: It's specifically designed to exports raw probabilistic series for algorithmic/system developers to integrate a probabilistic layer into strategies and to build/backtest ideas directly from those series.
What is “Mid activation”?
The Mid is the average of the previous period’s PH and PL. Activation occurs on the first bar in the current period whose high–low range includes the Mid. The first bar of a new period cannot activate Mid; activation can only start from the second bar of the period onward.

What counts as “first hit” after activation?
After a Mid activation, the script waits for a subsequent bar that touches either the previous High (PH) or previous Low (PL). The first side touched after the activation bar is recorded as that period’s first hit. Once decided, the other side is ignored for first‑hit statistics.

Which periods does it use?
You can select three custom reference timeframes (Period 1/2/3) in the UI (defaults: D/W/M). All logic—PH/PL/Mid, activation, first‑hit stats—runs independently per selected period.

Do the display controls change the calculation?
No. The “Show” selector only controls visuals:
Period 1/2/3: show only that period’s plots/barcolors.
OFF: shows all periods. Statistics and exported series are unaffected by this selector.

What do the bar/line colors mean?
Activation (first Mid tap): yellow bar.
Delivered to previous High after activation: blue
Delivered to previous Low after activation: red
Plots stop showing PH/PL once delivery happens (for that side) within the period.
What do the status symbols in the table mean?
■ Inactive — Mid not tapped this period.
▶ Activated — Mid tapped; awaiting delivery to PH or PL.
● Delivered — PH or PL was hit first after the Mid tap.
How are probabilities computed?
For each period, the script counts samples where the Mid was tapped and one side was hit first. It reports:
P(High first | Mid tap) and P(Low first | Mid tap).
Two‑sided p‑value vs 50% (H0: p = 0.5). These appear in the stats table with detailed tooltips.
What is “Bias” in exports?
Bias is a ternary signal derived from P(High first | Mid tap):
Bias = 1 if > 0.5
Bias = -1 if < 0.5
Bias = 0 if exactly 0.5 or no sample Source can be per period or “Merged” (simple average of available period probabilities).
Note: the UI uses a simple average; no weighted option is exposed.

What is “Entry” in exports?
Entry = 1 on bars where the selected period’s Mid activates (first tap), else 0. “Merged” emits 1 if any of the three periods activates on the bar.
What is “Exit” in exports?
Exit is the previous period’s Mid price (PH/PL average) for the selected period. “Merged” is the average of the three previous‑period Mid prices.
How do I integrate this into strategies? How to use the indicator?
CyberFlow is designed for algorithmic/system developers to add a probabilistic layer for entries and market‑regime detection.
What CyberFlow exports
- Bias (−1, 0, 1): from P(High first | Mid tap) vs 50% per your chosen source (Period 1/2/3 or Merged simple average).
- Entry (0/1): 1 only on the bar where the selected period’s Mid first activates (the “mid tap” bar).
- Exit (price): the previous period’s Mid price (average of previous High/Low) for the selected source.
- These appear in the Data Window as series named Bias, Entry, and Exit.

Connecting from your strategy (input.source)
- Add inputs in your strategy so users can select CyberFlow’s outputs:
- Bias source input: pick the indicator’s Bias.
- Entry source input: pick the indicator’s Entry.
- Exit source input: pick the indicator’s Exit.
In TradingView’s UI, users link these inputs to CyberFlow’s plots via the source picker.
Does this use request.security?
No. CyberFlow reconstructs your selected higher timeframes (Period 1/2/3) directly on the chart without request.security().
It detects new period boundaries via timeframe.change(tf), rolls the last period’s extremes into Previous High/Low (PH/PL), computes their Mid, then waits for a “Mid activation” (a bar after the first bar of the period whose range crosses the Mid).
From activation onward, it records which side (PH or PL) is reached first to build conditional probabilities per period.
Because levels and events are derived locally from the live bar stream, there are no cross-timeframe fetch artifacts or repaint nuances from request.security().
The exported series (Bias −1/0/1, Entry 0/1, Exit price) are produced natively and can be wired into strategies via TradingView’s input.source() for robust, low-latency integration.

What markets and assets does the indicator Extension work best on?
CyberFlow is market- and timeframe‑agnostic: it computes conditional probabilities (which side of the prior range is reached first after a mid tap) directly from price, so it can be applied to crypto, FX, indices, equities, futures, and commodities across intraday to higher timeframes. In practice, robustness depends on liquidity and sample size: higher timeframes usually yield more stable estimates (fewer activations, lower noise), while lower timeframes give more activations but can be noisier (spreads/fees matter more).
Because the study itself provides probabilities—not PnL—assess profitability in your context by integrating the exported series (Bias −1/0/1, Entry 0/1, Exit price) into your strategy via TradingView’s input.source(), then backtest with your fills, costs, and risk model to measure performance efficiency on your specific markets and settings.

What makes this script unique?
Custom higher-timeframes (beyond D/W/M)
You can pick any three reference periods (Period 1/2/3), not just Daily/Weekly/Monthly. The script rebuilds these periods directly on the chart and analyzes each independently.
True conditional probability (why it matters)
It measures P(High first | Mid tap) vs P(Low first | Mid tap) — i.e., “after the previous period’s midpoint is first tapped, which side is typically reached first?”
Conditioning on the mid‑tap event isolates the path that follows a specific trigger. Unconditioned counts (e.g., “how often PH/PL is hit”) mix pre‑ and post‑activation behavior and can be misleading. This conditional framing turns vague hit‑rates into decision‑grade odds tied to a clear setup.
Statistical confidence in‑context (p‑value in tooltips)
Tooltips show a Wilson 95% confidence interval and a two‑sided p‑value versus 50/50. This helps you judge whether an observed edge is likely signal or noise at your chosen periods.
Exports built for algorithmic integration
Three clean outputs in the Data Window for strategies:
Bias (−1/0/1) from the conditional probability versus 50%.
Entry (0/1) on the activation bar (first mid tap).
Exit (price) as the previous period’s Mid.
Hook these into your backtests via TradingView’s input.source(), then evaluate profitability with your own fills, costs, and risk model. This turns the probabilities into measurable performance you can optimize.
Disclaimer
This tool provides statistical estimates only and is not financial advice. Historical probabilities are not guarantees of future results. Always backtest with your own costs, fills, and risk model before using in live trading.
CyberFlow quantifies, per chosen higher-timeframe “Period 1/2/3”, what happens after price first taps the midpoint (Mid) of the previous period’s range. Specifically, it estimates P(High first | Mid tap) versus P(Low first | Mid tap): which side (previous High “PH” or previous Low “PL”) is typically reached first after that mid activation.
It extends a previously shared OrderFlow concept that used market structure; here it conditions on higher‑timeframe previous‑period PH/PL with the Mid as the explicit trigger.
Note: It's specifically designed to exports raw probabilistic series for algorithmic/system developers to integrate a probabilistic layer into strategies and to build/backtest ideas directly from those series.
What is “Mid activation”?
The Mid is the average of the previous period’s PH and PL. Activation occurs on the first bar in the current period whose high–low range includes the Mid. The first bar of a new period cannot activate Mid; activation can only start from the second bar of the period onward.
What counts as “first hit” after activation?
After a Mid activation, the script waits for a subsequent bar that touches either the previous High (PH) or previous Low (PL). The first side touched after the activation bar is recorded as that period’s first hit. Once decided, the other side is ignored for first‑hit statistics.
Which periods does it use?
You can select three custom reference timeframes (Period 1/2/3) in the UI (defaults: D/W/M). All logic—PH/PL/Mid, activation, first‑hit stats—runs independently per selected period.
Do the display controls change the calculation?
No. The “Show” selector only controls visuals:
Period 1/2/3: show only that period’s plots/barcolors.
OFF: shows all periods. Statistics and exported series are unaffected by this selector.
What do the bar/line colors mean?
Activation (first Mid tap): yellow bar.
Delivered to previous High after activation: blue
Delivered to previous Low after activation: red
Plots stop showing PH/PL once delivery happens (for that side) within the period.
What do the status symbols in the table mean?
■ Inactive — Mid not tapped this period.
▶ Activated — Mid tapped; awaiting delivery to PH or PL.
● Delivered — PH or PL was hit first after the Mid tap.
How are probabilities computed?
For each period, the script counts samples where the Mid was tapped and one side was hit first. It reports:
P(High first | Mid tap) and P(Low first | Mid tap).
Two‑sided p‑value vs 50% (H0: p = 0.5). These appear in the stats table with detailed tooltips.
What is “Bias” in exports?
Bias is a ternary signal derived from P(High first | Mid tap):
Bias = 1 if > 0.5
Bias = -1 if < 0.5
Bias = 0 if exactly 0.5 or no sample Source can be per period or “Merged” (simple average of available period probabilities).
Note: the UI uses a simple average; no weighted option is exposed.
What is “Entry” in exports?
Entry = 1 on bars where the selected period’s Mid activates (first tap), else 0. “Merged” emits 1 if any of the three periods activates on the bar.
What is “Exit” in exports?
Exit is the previous period’s Mid price (PH/PL average) for the selected period. “Merged” is the average of the three previous‑period Mid prices.
How do I integrate this into strategies? How to use the indicator?
CyberFlow is designed for algorithmic/system developers to add a probabilistic layer for entries and market‑regime detection.
What CyberFlow exports
- Bias (−1, 0, 1): from P(High first | Mid tap) vs 50% per your chosen source (Period 1/2/3 or Merged simple average).
- Entry (0/1): 1 only on the bar where the selected period’s Mid first activates (the “mid tap” bar).
- Exit (price): the previous period’s Mid price (average of previous High/Low) for the selected source.
- These appear in the Data Window as series named Bias, Entry, and Exit.
Connecting from your strategy (input.source)
- Add inputs in your strategy so users can select CyberFlow’s outputs:
- Bias source input: pick the indicator’s Bias.
- Entry source input: pick the indicator’s Entry.
- Exit source input: pick the indicator’s Exit.
In TradingView’s UI, users link these inputs to CyberFlow’s plots via the source picker.
Does this use request.security?
No. CyberFlow reconstructs your selected higher timeframes (Period 1/2/3) directly on the chart without request.security().
It detects new period boundaries via timeframe.change(tf), rolls the last period’s extremes into Previous High/Low (PH/PL), computes their Mid, then waits for a “Mid activation” (a bar after the first bar of the period whose range crosses the Mid).
From activation onward, it records which side (PH or PL) is reached first to build conditional probabilities per period.
Because levels and events are derived locally from the live bar stream, there are no cross-timeframe fetch artifacts or repaint nuances from request.security().
The exported series (Bias −1/0/1, Entry 0/1, Exit price) are produced natively and can be wired into strategies via TradingView’s input.source() for robust, low-latency integration.
What markets and assets does the indicator Extension work best on?
CyberFlow is market- and timeframe‑agnostic: it computes conditional probabilities (which side of the prior range is reached first after a mid tap) directly from price, so it can be applied to crypto, FX, indices, equities, futures, and commodities across intraday to higher timeframes. In practice, robustness depends on liquidity and sample size: higher timeframes usually yield more stable estimates (fewer activations, lower noise), while lower timeframes give more activations but can be noisier (spreads/fees matter more).
Because the study itself provides probabilities—not PnL—assess profitability in your context by integrating the exported series (Bias −1/0/1, Entry 0/1, Exit price) into your strategy via TradingView’s input.source(), then backtest with your fills, costs, and risk model to measure performance efficiency on your specific markets and settings.
What makes this script unique?
Custom higher-timeframes (beyond D/W/M)
You can pick any three reference periods (Period 1/2/3), not just Daily/Weekly/Monthly. The script rebuilds these periods directly on the chart and analyzes each independently.
True conditional probability (why it matters)
It measures P(High first | Mid tap) vs P(Low first | Mid tap) — i.e., “after the previous period’s midpoint is first tapped, which side is typically reached first?”
Conditioning on the mid‑tap event isolates the path that follows a specific trigger. Unconditioned counts (e.g., “how often PH/PL is hit”) mix pre‑ and post‑activation behavior and can be misleading. This conditional framing turns vague hit‑rates into decision‑grade odds tied to a clear setup.
Statistical confidence in‑context (p‑value in tooltips)
Tooltips show a Wilson 95% confidence interval and a two‑sided p‑value versus 50/50. This helps you judge whether an observed edge is likely signal or noise at your chosen periods.
Exports built for algorithmic integration
Three clean outputs in the Data Window for strategies:
Bias (−1/0/1) from the conditional probability versus 50%.
Entry (0/1) on the activation bar (first mid tap).
Exit (price) as the previous period’s Mid.
Hook these into your backtests via TradingView’s input.source(), then evaluate profitability with your own fills, costs, and risk model. This turns the probabilities into measurable performance you can optimize.
Disclaimer
This tool provides statistical estimates only and is not financial advice. Historical probabilities are not guarantees of future results. Always backtest with your own costs, fills, and risk model before using in live trading.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
📥 | Build, Backtest & Automate ➙ fractalyst.net
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
📥 | Build, Backtest & Automate ➙ fractalyst.net
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.