Top Strategy Finder [SpokoStocks]Top Strategy Finder
What if your chart could tell you which trading rule has actually worked on it?
Add this script to any symbol, any timeframe, and it backtests up to 2,304 complete strategies on that exact chart, ranks them, and shows a leaderboard you can read like a sentence: "Buy when RSI(2) drops below 10, only in calm volatility, exit on the reverse signal." Pick a row. Its trades appear on your price chart, its open position shows entry, stop and target, and its alerts are ready. No coding, no settings to tune.
Then it does something most strategy finders never show you: it walks forward and reports, without hindsight, whether trusting its own picks would have made money.
The problem it solves
Every strategy finder finds a winner. That is the easy part. Test enough rules on the same data and something always looks brilliant. The question that decides whether you make money is different: would that rule have worked from the moment you picked it?
This script answers it on the chart. On every bar it re-ranks all strategies using only the bars seen so far and follows a basket of the current leaders. The blue curve is what following those picks, bar by bar, would have produced. The gold curve is the champion's in-sample record. The gap between them is selection bias, drawn in the open. When both rise, the edge survived being chosen. When only the gold one does, you were looking at luck.
What you get
Leaderboard
• The top strategies (6 by default, up to 10) in plain language: entry on the first line, exit and filter on the second
• Trades and win rate as a bar, profit factor, net and max drawdown, all heat-coloured, in a table kept narrow so the chart stays visible
• Rank 1 starred, your selected row highlighted
• A trading plan for the selected row: exactly when to buy or sell, in which market condition, and how to exit
• A walk-forward line: what following the top basket would have earned, and how often the champion changed
• A "now" line: what your selected strategy and the basket hold on this bar
Performance pane
• Growth from the same start bar: buy & hold, the walk-forward basket, the champion, your selected row
• Each curve named with its result at the right edge
• Basket profit or loss area, optional drawdown shading, optional log scale
Price chart
• The selected strategy's recent trades drawn as green or red segments
• Its open trade with entry, stop and target lines
• Exposure shading and markers whenever the followed strategy turns long, short or flat
Alerts
• Selected strategy enters long, enters short, exits
• Basket turns long or short
• Champion enters long or short, champion changed
What is tested
Each strategy = one entry signal × one direction × one exit rule × one market filter.
24 entries, each with a long and a mirrored short version: EMA 9/21 and 20/50 crosses · close crossing SMA 20 and SMA 50 · RSI(2) beyond 10/90 and 5/95 · RSI(14) leaving 30/70 and crossing 50 · close beyond the 2σ and 2.5σ Bollinger bands · 10, 20 and 55-bar breakouts · MACD histogram crossing zero · MACD line crossing signal · Supertrend (3,10) and (2,14) flips · Stochastic leaving 20/80 · inside-bar breakout · three closes against the trade · ADX above 20 with a DI cross · Williams %R beyond −90/−10 · fresh 10-bar extreme with a reversal close · gap continuation.
8 exits: after 5, 10 or 20 bars · stop 2 ATR / target 3 ATR · stop 1 ATR / target 2 ATR · stop and target 1.5 ATR · trailing stop 3 ATR · exit on the reverse signal.
6 filters: any market · with the 200-bar trend · against it · calm volatility · high volatility · with 20-bar momentum.
Search sizes: Quick 288 · Standard 768 · Deep 1,536 · Max 2,304.
How the backtest works
• Entries at the close of the signal bar.
• Stops and targets are checked against the following bars' highs and lows; if both are touched in one bar, the stop is assumed.
• Every side pays the cost you set (default 0.05%).
• A strategy must reach the minimum number of trades (default 30) and, by default, be net profitable to rank at all.
• Rank by Win %, SQN, profit factor, net profit, expectancy, return / drawdown, or average win / average loss.
• The champion keeps its title until a challenger beats it by a margin you set, so the title does not flip on noise.
• The walk-forward basket follows the top K (default 5) equally weighted, chosen at each bar's close and exposed to the next bar's move.
Repainting and data
All signals are evaluated on the chart's own OHLC data, with no higher-timeframe requests. Entries, exits and rankings are confirmed at the close of each bar; the walk-forward curve and every trade in the logs are built only from closed bars and do not change afterwards. The leaderboard order can change as new bars close, because new trades change the statistics; that is the ranking updating, not a redraw of history.
How to use it in five minutes
1. Add it to the chart you trade. Start with the Standard size.
2. Read the leaderboard. Favour rows with many trades and a modest drawdown over rows with a large net and few trades.
3. Look at the pane. Blue rising with gold: the edge survived being chosen. Blue flat while gold soars: the leaders are curve-fit to this chart.
4. Pick the row you want to trade. Read its plan under the table, check its drawn trades, set its alerts.
5. Switch the ranking metric. Rules that stay on top under several metrics are the robust ones.
What it is not
An indicator, not a strategy() script, so there is no order-by-order report from the built-in tester. It is a discovery tool: it tells you which rule to build and shows you, without hindsight, whether choosing that rule would have paid. Results depend on the bars tested (default the last 2,500) and on your cost setting. Past results do not guarantee future performance. This is not financial advice.
Indicatore

Filter Reality Check# Filter Reality Check — does your condition actually select anything?
My last script measured what entering at random would have produced on a
chart at a given reward-to-risk. The question everybody asked next was the
obvious one: *fine — does my filter beat that?*
Almost nobody measures it. This does.
It resolves every bar in the sample exactly once, then counts the outcome
twice: into the baseline, and into the filtered set if your condition was
true on that bar. Same bars, same distances, same resolutions — so the
difference between the two rates is the filter and nothing else.
## What the table shows
**All bars.** The baseline. What entering at random would have produced
here at your reward-to-risk.
**When condition true.** The same measurement, restricted to bars where
your filter passed.
**The filter is worth.** The difference, in percentage points of hit rate.
This is the number you came for.
**Bars it kept.** What share of the sample survived the condition. This
matters more than it looks: a filter true on 97% of bars is not selecting
anything, and its hit rate will match the baseline for that reason alone.
If this figure is near 100%, the filter is decoration.
**Filtered vs break-even.** Whether the filtered rate clears what your
reward-to-risk actually demands, after costs.
## Conditions you can test
Price above or below a moving average (EMA or SMA, any length), ADX above
a level, RSI above or below a level, volatility rising (ATR above its own
average), volume above a multiple of average, inside a session window, or
**any custom source above a level** — which lets you point it at another
indicator on your chart and test that.
## What you should expect to find
Most filters are worth nothing.
That is the finding, not a failure of the tool. A condition that moves the
hit rate by half a point is a condition you can delete, and knowing which
of yours those are is worth more than adding another indicator. The script
says so plainly when it happens.
Occasionally you will find one that costs you points — where you would
genuinely do better entering at random. Those are worth knowing about
before they are load-bearing in a strategy.
## Method, and its limits
**The condition is read on the entry bar itself**, using only data that
existed then. A filter evaluated with information that arrived later would
flatter itself and the result would be worthless.
**A bar spanning both stop and target counts as a loss.** There is no way
to know which came first from bar data, and being wrong pessimistically is
the only honest way to resolve it.
**Samples that reach neither level within the holding window are reported
as timed out**, not quietly dropped.
**Distances can scale with each historical bar's own ATR**, so the test
uses the volatility of the time rather than today's.
**The table states the period covered.** Six hundred bars is two days on a
5m chart and two years on a daily one, and a percentage with no period
attached invites more confidence than it has earned.
**Thirty resolved samples is the floor.** Below that the script refuses to
draw a conclusion, and it will tell you when your condition was true too
rarely to judge — which happens often with tight filters on short samples.
## What it is not
It places no trades, gives no signals and predicts nothing. It measures
what a condition would have selected on the history in front of you, on
this instrument, over this window. Run it across several windows before
you believe any single number, and check whether the direction you are
testing happened to be the way the market was going.
A filter that improves the hit rate may still be worthless for other
reasons — overfitting, costs, or a sample too small to mean anything.
This measures one thing and only claims that one thing.
Open source. Companion to *Edge Reality Check*, which measures the
baseline this compares against. Indicatore

Machine Learning Statistics: kNN Win Rate vs Random EntriesBefore you trust a "machine learning" indicator - or pay for one - you
can test it. This script measures the method most published ML
indicators are built on against entries taken at random, on your
instrument, your timeframe, your chart.
Why random entries are the comparison that matters. A win rate
on its own tells you very little. Buy anything at any moment, put a
target above and a stop below, and you will win roughly half the time.
That is arithmetic, not skill. So the useful question about a signal is
not "how often does it win" but "how often does it win compared with
entering at a random moment instead". This script answers that
question. For every signal the method produces, it also places matched
random entries - same direction, same target and stop distances,
anchored at bars where no signal happened - then scores both and
reports the difference.
The measurement is tested before it is trusted. The script can
replace price with artificial data that contains one deliberate,
repeating pattern - put there on purpose, so there is definitely
something to find. A plain RSI rule - the relative strength index, a
standard overbought and oversold gauge - reads that pattern directly
and won 75.7% of its trades. Randomly timed trades on the same bars won
50.6%. The pattern was there, and a simple rule found it.
The same test then handed the widely published machine-learning method
the same data, with the pattern sitting in the exact measurements it
looks at. It won 39.9%. Randomly timed trades won 49.3%. It did not
merely fail to find the pattern. It finished 9.4 percentage points
behind random timing - a percentage point being the plain difference
between two percentages, so 51% against 50% is one point - and the gap
grew wider the stronger the pattern was made.
That is the demonstration this script exists to make possible: an
instrument that finds an edge when one is really there, and reports
nothing when there is not. What it reports on live market data is
below.
The script on a live chart, with both populations drawn. The green and
red pins are signals from the machine-learning method - green below the
bar for long, red above it for short - created only once the bar has
closed, so nothing is moved or redrawn afterwards. The grey dots are
the control: matched random entries, three for every signal, taken in
the same direction with the same target and stop distances but at bars
where no signal happened. Those are what the signals get measured
against, and the key in the corner names both. The panel reports the
two win rates and the gap between them: 50.1% for the signals against
49.5% for random entries, a difference of 0.6 percentage points across
812 signal trades.
What to Use It For
Checking an ML indicator before you trust it. The method measured
here is the one most published ML indicators are built on: nearest-
neighbor classification over oscillator readings. If you use one, this
tells you what its timing was worth on your instrument, over a window
you choose.
Seeing what a win rate is worth without a control. Every cell in
this study has a raw win rate near 50% and a controlled result near
zero. The raw number and the meaningful number look nothing alike. Run
the script with the control switched off and back on to see it.
Testing the measurement itself. Everything here can be checked.
The synthetic mode lets you plant a pattern and confirm the instrument
finds it, before you believe anything it says about a real market.
The Result in Plain Language
Across three instruments at the default settings, the method's signals
won 48.8% of the time. Matched random entries on the same instruments
won 49.9%. The difference is -1.1 percentage points.
That difference is smaller than what this test could reliably detect.
On this sample the smallest difference the measurement could resolve is
about 2.9 percentage points. So the honest statement is not "the method
is worthless" - it is this:
On this sample, the method's signal timing cannot be told apart from
random timing, and any real advantage larger than about 3 percentage
points would have shown up.
The same answer came back on every configuration tested: different
numbers of neighbors, fewer features, different training lengths,
different targets, both timeframes, and a separate year of data that
shares no bars with the main window. Twenty configurations, and not one
of them produced a result large enough to be distinguished from chance.
The sharpest single test came from switching both of the method's
filters off, which produces far more signals and therefore a finer
measurement. 2,782 signal trades against 8,181 random ones:
Signals 49.784%
Random 49.786%
Difference -0.002 percentage points
How the Test Works
The signal. The script rebuilds the published method from its
open source: five oscillator readings per bar, a search for past bars
whose readings look similar, and a vote among those neighbors. When
the vote changes sign, that is the signal, and that is the entry.
The trade. Every entry is taken at the close of the bar where
the signal appeared. A target and a stop are placed the same distance
above and below, measured in average true range, which is roughly how
far price travels in one bar. Whichever is reached first decides the
outcome. Trades that reach neither within the time limit are reported
separately and left out of the win rate.
The control. Each signal also creates three random entries, at
fixed distances later on the chart, in the same direction, with the
same target and stop distances. Nothing about them is tied to a signal.
They answer the question "what would any trade of this shape have
returned over this sample".
The comparison. Signals minus random entries, in percentage
points. That is the number this script exists to produce.
The same chart and run as above, with the full accounting shown. Every
signal the method produced is followed down the panel into exactly one
outcome, and every random entry alongside it: 862 signals, 821 of them
inside the chosen date window, and 2,430 matched random entries built
from those. Nothing is discarded quietly - each rejected signal is
counted on its own line, the trades still running when the window ended
are counted too, and the error counter near the bottom has to read zero
for the run to be valid.
Validation
Two tests with known answers, both built into the script.
The blank test. Price is replaced with a random walk containing
no pattern at all. Both signals and random entries must then land at
50%. Across sixteen different random walks, signals came in at 49.88%
and random entries at 49.52%, a difference of 0.27 percentage points.
Nothing was found, because there was nothing there.
The planted test. A pattern is added to the artificial data, at
three strengths, sitting in exactly the measurements the method reads.
A simple rule that looks at that pattern directly gains more as the
pattern gets stronger:
Pattern strength Simple rule beats random by
none +0.45 points
weak +3.90 points
medium +11.60 points
strong +25.15 points
This is what makes the market result believable. The measurement finds
a real edge when one is put there, and reports nothing when there is
nothing to find.
What the method did on the planted data. It went the other way.
The stronger the pattern, the further behind random timing it finished:
-2.48, then -6.75, then -9.40 percentage points. On the same bars, with
the same targets, the simple rule was gaining 25 points.
This is a result on artificial data with one setting per strength, and
it is reported as an observation, not an explanation. There is a
candidate reason in how the published method picks which past bars to
vote - it may keep the least similar ones rather than the most similar
- but that has not been tested and no claim is made here.
The test with a known answer. Price has been replaced by artificial
data carrying one deliberate, repeating pattern, so there is certainly
something to find. The lower block of the panel is a plain RSI rule
reading that pattern directly: it wins 75.9% against 50.6% for random
entries, a gap of 25.3 points. The upper block is the machine-learning
method given the same data: 39.7% against 49.3%, a gap of -9.6 points.
A simple rule found the pattern; the method finished behind random
timing. These figures move by a few tenths of a point as a chart loads
more bars, because this test uses all of them. The candles behind the
panel are artificial and show nothing meaningful.
Results
Baseline configuration, 30 minutes, 2025-01-01 to 2026-08-01, the
method's own default settings throughout:
Instrument Signals Random Difference
BTCUSDT 50.12% 49.52% +0.60 pts
EURUSD 47.24% 51.35% -4.11 pts
ES1! 48.68% 49.03% -0.35 pts
Pooled 48.84% 49.93% -1.10 pts
The three instruments do not disagree by more than ordinary sampling
variation, so the pooled figure stands. The range of plausible values
around the pooled -1.10 runs from -3.6 to +1.5 percentage points, and
includes zero.
Every other configuration tested, all on BTCUSDT at 30 minutes:
Neighbors 2 / 8 / 32 +0.77 / +0.60 / +0.19 pts
Two features only +0.71 pts
Training length 4 bars +0.42 pts, 8 bars +0.52 pts
Shorter memory +1.13 pts
Targets 1x / 3x +0.71 / +1.58 pts
On the hourly chart, across the same three instruments, +0.94 points.
Over calendar 2024, a window sharing no bars with the main one, -1.01
points. Both ranges of uncertainty include zero.
To reproduce these figures: the script's defaults match the
baseline. Switch the date range on, set 2025-01-01 to 2026-08-01, turn
compact panel mode off, and load the full chart history.
Terms Used in the Panel
Signals. Entries taken where the method's vote changed sign.
Random / placebo. Matched entries at fixed offsets later, same
direction and same target distances, anchored where no signal occurred.
Ambiguous outcome. A bar whose range contains both the target
and the stop. Bar data cannot show which came first, so the trade is
counted against the win rate - the cautious choice.
Censored outcome. A trade that reached neither target nor stop
before the time limit. Reported on its own and kept out of the win rate.
95% interval. The range of values the true answer plausibly sits
in. When it includes 50%, the result cannot be told apart from a coin
flip.
Smallest detectable difference. How small a difference this test
could have found on data with no edge. Anything smaller than it is not
evidence.
Settings
Classifier. Number of neighbors, training length, how many
oscillator readings to use, how far ahead the training labels look, and
which of the two labeling conventions to use. The method's own filters
can each be switched off.
Measurement. Target and stop size, the averaging length behind
them, and the time limit.
Control. How many random entries per signal and how far ahead
they are placed.
Sample. The date range uses explicit year, month and day fields
rather than a date picker, so a published sample can be reproduced
exactly.
Validation. Synthetic mode, seed, step size, drift, and the
planted-pattern strength.
Display. Compact panel, signal markers, marker size.
Limitations
The sample is smaller than intended. The target set before any
run was 1,000 completed trades per test. The main test produced 812,
and the platform's history limit made 1,000 unreachable at the
published settings on any instrument, timeframe or date range tried.
Every figure above is reported with the precision it actually achieved:
about 4.6 points for a single instrument and 2.9 points pooled.
The measurement has a small bias of its own. On data with no
edge, random entries come in at 49.62% rather than exactly 50%. Signals
carry the same offset, so it cancels when the two are subtracted, and
the difference on that data sits at +0.27 points. It is disclosed here
because it is real.
One decision was made after seeing data. When the validation
missed one of its own criteria by a small margin, the rule for what to
do next was written before the additional runs but after the result
that prompted them. That is a weaker guarantee than deciding everything
in advance, which is what the rest of this study did.
What was and was not measured. The classifier itself: readings,
similarity, neighbor vote, filters, entry when the vote flips. Not
included are the extra entry conditions and exit rules that individual
published indicators layer on top. Outcomes here are scored by a fixed
target-and-stop race, not by any indicator's own exits.
One family of method. Nearest-neighbor classification is one
class of ML indicator. These numbers apply to the method measured.
Loaded history bounds every test. How many bars your chart loads,
not only the calendar range, limits each run.
Direction splits are descriptive only. In a trending sample the
long and short win rates separate by around 20 points while the overall
comparison holds steady. Read the combined rows.
This is a measurement of the past. It reports what happened
under stated rules on stated samples. It does not predict anything.
Disclaimer
This script and its description are provided for educational and
research purposes only. They do not constitute financial, investment,
trading or other professional advice, and they do not recommend buying,
selling or holding any asset. Historical and simulated results do not
guarantee future performance. Trading involves risk, including the
possible loss of capital. You are solely responsible for your trading
and investment decisions and should conduct your own research and,
where appropriate, consult a qualified financial professional.
Indicatore

Fair Value Gap (FVG) Statistics with Placebo Control█ OVERVIEW
On the same instrument, measured against a 50% baseline, fair value gaps looked significantly profitable in one period and significantly unprofitable in another. Both readings were artifacts of a baseline that was never 50%.
This indicator measures what actually happens after price returns to a gap, then compares the result against fake, or placebo, zones of the same size placed at bars where no gap occurred. Because a hit rate tells you nothing until you know what a meaningless zone scores on the same chart.
The following description consists of two parts. Part 1 is written in plain English and covers everything most readers need. Part 2 contains the full methodology and results for anyone who wants to examine the numbers in detail.
═══════════════════════════════════════
PART 1 — WHAT THIS IS AND WHY
═══════════════════════════════════════
█ THE PROBLEM
Zone-based tools are everywhere: fair value gaps, order blocks, breakers, imbalances. Yet almost none of them tell you how often a zone actually led anywhere. And when a number is quoted, it is often built on one of three flawed foundations.
1. The zone is counted before it could have been known.
This problem is easiest to see with order blocks. An order block is commonly defined as the last opposite candle before a move that breaks structure. That means the block cannot be identified until the structure break occurs, often several bars later. Yet it is drawn back on the earlier candle as though it had been known at the time.
Any hit rate measured from that earlier candle therefore counts a zone that nobody could actually have traded.
Fair value gaps suffer less from this problem because their three-bar pattern completes quickly, but the same principle applies: a zone becomes active only when it becomes knowable, and nothing before that bar should be counted.
2. Failed zones disappear.
Many tools remove a zone from the chart once price has passed through it. That makes sense for keeping a chart clean. It is disastrous for statistics, because the zones being removed are disproportionately the ones that failed.
Count only what remains on the chart and you are counting the survivors.
3. The hit rate is compared with 50%.
This is the most important problem, and it is extremely common.
The reasoning seems straightforward: if the target and stop are equally far from the entry, then no edge should mean a 50/50 outcome.
But a rule that enters when price reaches a level inherits a baseline from the way price moves. That baseline is not necessarily 50%. It changes with the instrument, direction, and market conditions. Across the three markets tested here, it ranged from roughly 45% to 55%.
A hit rate by itself therefore tells you very little.
What matters is how the same measurement performs on zones that have no informational meaning at all.
█ WHAT THIS INDICATOR DOES
For every real fair value gap the indicator identifies, it also generates placebo zones of the same height, direction, and distance from price, anchored at bars where no fair value gap occurred.
Real and placebo zones are then measured by exactly the same rules.
The difference between them — real minus placebo — is the result that matters.
If real gaps perform like the placebo zones, then the pattern is not adding anything, regardless of how attractive the raw hit rate may look.
The placebo comparison does not ask whether fair value gaps win more than 50% of the time.
It asks a harder question:
Do fair value gaps perform better than comparable zones that carry no fair value gap information at all?
█ HOW THE COMPARISON IS KEPT FAIR
Statistical libraries for Pine already exist, and many indicators will draw fair value gaps. What is not otherwise available is a matched control built into the measurement itself, so that every figure the indicator reports arrives together with the baseline it should be judged against.
Three design choices make that possible, and they only work together.
A matched placebo control. Each placebo zone has the same height, the same direction, and the same distance from price as the real zone it is meant to compare with. Both are scored by identical rules.
Confirmation-honest timing. A zone enters the sample only when it becomes knowable, never earlier. Every confirmed zone remains in the sample from that point onward, including zones that fail immediately.
Bias controls that are reported rather than hidden. Cases that are genuinely difficult to score — such as bars that touch both exits and trades that never resolve — are counted and displayed for real and placebo zones side by side. Ambiguous cases are treated conservatively rather than silently discarded.
The combination matters. A matched control is useful only if both sides are measured under the same timing and scoring rules.
█ WHAT THE TESTS FOUND
Across three asset classes, three timeframes, and two separate periods — fourteen measurements in total — fair value gaps showed no detectable advantage over size-matched zones placed at meaningless bars.
The difference remained below about one percentage point of hit rate, and none of the fourteen individual measurements reached conventional statistical significance.
That is a bound on what was observed, not a claim that the true effect is exactly zero.
A different market or a different period could produce a different result. That is precisely why the comparison is built into the tool rather than left as an assumption or a footnote.
The broader conclusion is more useful:
A hit rate quoted without its baseline does not tell you whether something works. On the same instrument, measured against 50%, this pattern looked significantly profitable in one period and significantly unprofitable in another. Both readings were created by the baseline, not by the gaps.
That lesson applies to zone-based tools generally, not only to fair value gaps.
If you take one thing from this script, take that.
█ HOW IT WAS TESTED
A single result on a single chart is easy to produce and easy to overinterpret. Before publication, the same measurement was therefore repeated while changing one assumption at a time.
Three asset classes — crypto, currencies, and equity index futures
Three timeframes — 5 minutes, 30 minutes, and 1 hour
Two separate, non-overlapping time periods
Three different target and stop distances
Two different limits on how long a trade could remain open
Each of these choices is partly arbitrary. If a finding appears only under one particular setting, it may belong to the setting rather than to the market.
Fourteen separate measurements were made in total.
Two standard statistical tools are used. A confidence interval shows the range in which the underlying value plausibly lies, which is more informative than a single headline estimate. Results from independent markets are also combined so that their evidence can be considered together rather than one chart at a time.
The measurement procedure was additionally checked against artificial data for which the correct answer was known in advance. This allowed the method itself to be tested independently of any market result.
█ HOW TO READ AND USE THE INDICATOR
Add the indicator to any chart. It works on any symbol and any timeframe and needs no configuration to produce a result.
The panel
By default, the panel shows a compact view: the number of zones found, the number revisited by price, the hit rate with its confidence interval, the placebo baseline, and the difference between real and placebo.
Turn off Compact panel for the full breakdown: wins, losses, unresolved cases, the direction split, and side-by-side rates for the cases that are hardest to score.
Everything used to produce the headline result is available for inspection.
Reading the result
Check the sample size first. Below roughly 1000 resolved zones, the confidence interval is usually too wide to conclude much. Recognizing that the sample is inconclusive is a valid result, not a failure of the indicator. Lower timeframes and longer histories both increase the sample.
Then read real − placebo . That is the headline result.
A positive number means the gaps outperformed the placebo zones. A negative number means they underperformed them.
The z-score beside it indicates how far the observed difference sits from what chance alone can produce. As a rough guide, an absolute z-score below 2 is not conventionally distinguishable from noise.
The raw hit rate is shown for context, not as the answer. Judging the pattern from that number alone is the mistake this indicator is designed to expose.
Setting up a measurement
To measure a specific period, turn on Limit to date range and set the dates.
The panel reports the sample actually achieved. This can be shorter than the requested period if the chart has not loaded enough historical data, so scroll left when necessary to load more history.
To check whether a result depends on your choice of exits, change Barrier size and run the measurement again. A finding that appears only at one setting may belong to the setting rather than to the pattern.
As a chart indicator
Zones are drawn as they form and can also be used in the usual visual way.
A zone that price has not yet returned to is drawn solid and continues extending to the right while it remains open.
When price reaches the zone, the box stops extending and fades to a dotted outline. The width of a completed box therefore shows how long that gap survived before price returned to it, while the chart makes it easy to see which zones remain active.
Turning off Draw real zones leaves only the statistics panel.
█ SETTINGS
Measurement — Risk unit selects whether exit distance scales with ATR or with the zone's own height. Barrier size sets that distance. Time limit controls how many bars a trade may remain open before being recorded as unresolved.
Entry price and Evaluate exits on the entry bar provide alternative scoring conventions so their effect can be measured rather than assumed. Both are labeled where they introduce a known bias.
Minimum zone height filters out small gaps. Exclude overlapping zones and Overlap lookback prevent several gaps created by the same move from being treated as independent observations.
Sample — restricts the measurement to a date range, entered as year, month, and day so the sample remains reproducible.
Placebo control — Placebos per zone sets how many comparison zones each real zone generates; more placebos produce a tighter estimate of the baseline. Placebo offset controls how far from the original bar the comparison zones are anchored.
Validation — replaces market price with a random walk so the measurement can be checked against data whose correct answer is known in advance rather than only against real markets.
Display — Compact panel shows the headline rows only; turning it off reveals the full breakdown. Draw real zones toggles the boxes on the chart.
═══════════════════════════════════════
PART 2 — DETAILED ANALYSIS
═══════════════════════════════════════
█ HOW A ZONE IS SCORED
A gap becomes active on the bar after its three-bar pattern closes. From that point onward, every confirmed zone remains in the sample, including zones that fail immediately.
When price returns to a zone, the entry is recorded at that bar's close , not at the zone edge.
This matters more than it may appear.
A touch condition means that price reached or passed the edge, so the bar may have overshot it by an unknown amount. Assuming a fill at the edge while beginning the measurement only from the following bar would start the trade from an artificial price and can systematically distort the result.
Two exits are then placed at equal distances on either side of the entry. Because the exits are symmetric, real and placebo zones can be compared directly.
If one bar touches both exits, its open, high, low, and close do not reveal which level was reached first. Those cases are shown separately and counted as losses, making the published result the conservative one.
Zones that reach neither exit within the time limit are excluded from the hit-rate calculation. They did not resolve, so they provide no evidence for either outcome.
█ RESULTS
Results below use the following settings. The sample ends 1 August 2026.
SETTING VALUE
Risk unit (R) ATR(14) at confirmation
Barrier 2.0 R each side
Time limit 100 bars after entry
Entry close of the touch bar
Overlapping zones excluded
Placebos per zone 3
Three markets, 30-minute charts, 2025-01-01 to 2026-08-01:
INSTRUMENT RAW NAIVE z PLACEBO REAL-PLAC
BTCUSDT 49.5% -0.67 49.0% +0.5
EURUSD 51.4% +1.65 51.7% -0.2
ES1! 49.2% -0.92 49.9% -0.7
POOLED -0.04
The panel on the chart above is not restricted to that fixed window — it runs to the most recent bar — so its figures differ slightly from the table. That is expected: it is a different sample, not a different result.
Read the raw column alone and the markets appear different: 49.5% for crypto versus 51.4% for currencies, a spread of 1.9 percentage points.
Now look at the placebo column. Its spread is 2.7 points.
The apparent difference between markets is therefore better explained by the baseline than by the fair value gaps themselves.
One example makes the problem especially clear:
BTCUSDT, 1 hour, calendar year 2024
Raw hit rate 54.0% (n = 1390)
Naive z vs 50% +2.95 "significant"
Placebo baseline 51.5%
Real minus placebo +2.5% z 1.49, not sig.
Against an assumed 50% baseline, a 54% hit rate gives a p-value near 0.003 — exactly the kind of number that can look compelling when published in isolation.
Against its observed control baseline, however, the evidence is not statistically significant.
The same indicator, on the same instrument, over a different period and with a tighter target, produced a raw hit rate of 48.4% with a z-score of -2.25 — apparently significant in the opposite direction.
Both apparent conclusions arise from comparing with an assumed 50% baseline rather than the observed control baseline.
█ ROBUSTNESS
DIMENSION TESTED RESULT
Barrier size 1R / 2R / 3R no change
Time limit 50 / 100 bars no change
Asset class crypto / FX / index no change
Timeframe 5m / 30m / 1h no change
Period 2024 / 2025-26 no change
Across fourteen separate estimates of real minus placebo, the largest result was 1.49 standard errors from zero.
With fourteen estimates, even if the true effect were zero, the largest absolute result would be expected to reach roughly 1.9 standard errors by chance alone.
Pooled across three independent markets, the estimate was -0.04 percentage points, with a 95% interval of approximately -1.2 to +1.1 points.
█ LIMITATIONS
One symbol and one timeframe can be analyzed per chart. Pine cannot pool results across markets, so each chart represents one sample rather than proof by itself. The pooled figures reported above were combined separately.
Trading costs are not included. Entries assume execution at the bar close with no spread, commission, or slippage. Real-world trading costs would make absolute performance worse.
Ambiguous bars are counted as losses. This lowers both real and placebo hit rates by roughly the ambiguous-case rate and therefore tends to cancel when the difference between them is calculated.
The bull and bear rows should not be interpreted independently in a trending market.
The placebo control matches zone size, direction, and distance from price, but it cannot match the fact that a real gap forms immediately after a strong move in the same direction.
For example, in an uptrend, a fake bearish zone is more likely to be run over by the prevailing trend, whereas a real bearish gap can only form after an actual downward move. These effects work in opposite directions and largely cancel in the combined result.
For that reason, the total should be treated as the primary statistic rather than the directional split.
This limitation was identified during testing and is the main known weakness of the methodology.
Finally, all results come from a sample. Another market or another period may produce a different estimate. That uncertainty is the reason the placebo comparison is built into the indicator rather than assumed away.
█ METHOD AND PRIOR WORK
None of the statistics here are new, and it is worth being clear about that.
Assigning a treatment to units or moments where it did not actually occur, then checking that no effect appears, is a standard falsification test in causal inference, where it is usually called a placebo test. The placebo zones in this indicator are that idea applied to bars instead of subjects.
The trading application is not new either. David Aronson's Evidence-Based Technical Analysis (2006) argues that a rule should be judged against the returns of random entry signals rather than against zero, and uses Monte Carlo permutation and White's Reality Check to do it.
The scoring rule — a target, a stop, and a time limit, whichever is reached first — is the triple-barrier method described by Marcos López de Prado.
What this script adds is not the method but its availability. The control is generated and scored automatically alongside the real zones, on any chart and any symbol, so the baseline arrives together with the number instead of requiring a separate study that most people will never run.
█ OPEN SOURCE
The source is open. Every figure above can be reproduced — or shown to be wrong — by anyone who wants to check it.
Order blocks are next, measured by the same rule: from the bar that breaks structure, not from the earlier candle on which the block is drawn.
Indicatore

Fractal Memory Strategy [Jayadev Rana]Fractal Memory Strategy trades the same engine as the Fractal Memory Projection indicator: it looks for the historical episode most similar to current price action, and only takes trend flips that agree with how that episode played out. Exits scale out at three volatility-adaptive targets.
HOW IT DECIDES
An ATR trailing stop tracks the trend. When it flips, the last 30 closes are converted to normalized log returns and compared against past windows by mean squared distance. The bars that followed the best analog give a net direction; the flip is only traded when the analog direction agrees (the filter can be disabled). Orders are processed on bar close, so no lookahead is involved. For visual context the strategy also draws the 50-candle ghost projection beyond the last bar - it is display-only and never affects order logic.
ENTRIES AND EXITS
On a confirmed bullish flip with agreement the strategy closes any short and enters long; the mirror applies to shorts. One unit of risk R equals ATR times (1.2 plus the ATR percentile rank over 200 bars), so targets and stops widen in volatile regimes and tighten in quiet ones. Position exits: one third at 1R, one third at 2R, the remainder at 3R, with a stop at 1.5R (all adjustable). Direction can be restricted to long-only or short-only.
PROPERTIES USED IN THE PUBLISHED BACKTEST
10,000 initial capital, 10 percent of equity per trade, 0.01 percent commission per order, 2 ticks slippage, no pyramiding, orders on close. These are deliberately conservative; adjust them to match your own broker before drawing any conclusion.
PANEL
Match similarity, volatility regime, forecast direction, closed trade count and win rate.
NOTES
The analog projection is a statistical reference, not a prediction, and past behaviour does not guarantee anything about the future. Results vary by symbol and timeframe; test on your own market with realistic costs before considering any live use. This is an educational tool, not financial advice. Strategia

HalfTrend Long/Short Signal Engine [BigBeluga]HalfTrend Long/Short Signal Engine is an institutional-grade trend tracking toolkit built for TradingView. It filters out minor market noise to deliver definitive, non-repainting long and short entry signals based on asset volatility and structural swing pivots.
Instead of displaying standard lag-heavy moving averages, this system uses an adaptive directional engine to lock onto clean trend lines and overlay automatic risk-management matrices directly onto your chart. It calculates real-time win rates and scans multiple assets simultaneously so you can trade with systematic statistical backup.
🔵 MAIN ENGINE & MARKET CALCULATION MECHANICS
1. Pure HalfTrend Price Filter Matrix
Swing Pivot Trackers: The engine scans local high and low data using an adjustable lookback filter ( Amplitude ) to find actual structural swing points rather than temporary price spikes.
Volatility-Adjusted Bands: It establishes dynamic outer channel boundaries using a 100-period Average True Range calculation divided by two ( ATR/2 ). The total channel width automatically scales using your custom risk buffer parameter ( Channel Deviation ).
Regime Flip Architecture: The system locks into a Bullish Regime when price crosses above structural highs, shifting the main tracking baseline to Green. When price slips below structural lows, it forces a Bearish Regime and changes the tracking baseline to Red.
2. Automated Risk Matrix & Multi-Asset Scanner
Algorithmic Trade Execution: The moment a new trend regime initializes, the engine projects a strict trade tracking matrix showcasing an entry line, a clear stop-loss boundary, and three tiered profit targets (TP1, TP2, and TP3).
Live Performance Dashboard: An integrated on-screen table calculates real-time historical metrics, tracking active wins, losses, current target risk-to-reward ratios ($1:3$), and overall system win rate percentages.
Screener Security Matrix: The background engine leverages real-time multi-asset queries to stream concurrent trend statuses for five separate configurable symbols directly into a secondary visual dashboard.
// Automated Trade Risk & Multi-Asset Tracking Snippet
if buySignal
float dist = atr2 * baseRiskMult
activeSL := close - dist
activeTP1 := close + dist
activeTP2 := close + (dist * 2)
activeTP3 := close + (dist * 3)
tradeState := 1
entryPx := close
t1 = request.security(sym1, timeframe.period, trend)
🔵 WHY IT IS USEFUL
Elimination of Market Noise: Standard moving averages constantly whip back and forth during consolidations. The HalfTrend calculation filters out minor intraday fluctuations, only shifting when a definitive structural high or low is broken.
Mathematical Execution Blueprint: It takes the emotion out of trade management. Every signal comes equipped with dynamic, visually mapped stop losses and a $1:3$ risk-reward profit map that fills with real-time gradient paths.
Macro Market Synchronicity: The multi-asset side-panel allows you to keep an eye on major market drivers (like BTC, ETH, Gold, or major FX pairs) simultaneously, ensuring your trades line up with broader institutional market direction.
🔵 HOW TO USE THE SYSTEM
Trading Long Breakouts: When the system transitions from a bearish regime into a bullish regime, a Green LONG label will print beneath the breakout candle. Execute your position at the white entry line, setting your dynamic stop-loss boundary inside the red risk gradient.
Trading Short Breakdowns: Monitor the system for a shift into a bearish regime, indicated by a Red SHORT label appearing above the asset price. Execute short orders relative to the entry line and utilize the upper red gradient zone to map your protective risk ceiling.
Managing Exits and Targets: Take partial profits sequentially as the asset price moves through the Green target lines (TP1, TP2, and TP3). If a sudden trend reversal prints an opposing signal before your final targets are satisfied, the script automatically triggers a reversal exit rule to preserve accumulated gains.
Streamline your trade execution, manage portfolio risk systematically, and screen multiple sectors at once with the HalfTrend Long/Short Signal Engine workspace. Indicatore

Verdict Calibrator Edge vs Base RateOverview
A meta-tool that answers one honest question about any signal: does it actually beat chance?
Point it at another indicator's output (via the source input) or use a built-in reference signal, and it forward-tests every long/short call with a triple-barrier outcome, compares the hit rate to the unconditional base rate of the same move, and only calls an edge "proven" when a confidence-interval lower bound clears that base rate. It splits the result by side (long vs short) and by regime (trend vs range).
It grades a signal; it does not make one.
Why this exists
Most "win rate" readouts are misleading. 60% right means nothing until you know how often the same move happened anyway — if price rose 60% of the time regardless, your signal has an edge of exactly zero. And a 60% on 12 samples is noise, not evidence.
This tool is built so it can only ever say "no proven edge" when there isn't one. The base-rate comparison and the significance gate make false confidence structurally hard to produce.
Why these parts are ONE tool
Signal as a parameter. Connect any plot on your chart through the source input, or pick a built-in reference. The signal is an input, not baked in — so you can audit your indicators, not just this one. The ten built-ins span the families traders actually use:
FamilyBuilt-insTrend-followMA cross · MACD cross · Supertrend flipMomentumRSI 50-cross · Stochastic crossBreakoutDonchian breakout · VWAP crossMean-reversionRSI 30/70 reversal · Bollinger fadeControlRandom (coin flip)
The random control — the tool's own self-test. A deterministic coin flip that by construction has no edge. Grade it and the verdict should read "Not proven" with an Edge near zero. If a random signal ever comes back "PROVEN", the harness is broken — distrust the tool, not the market. No other calibrator on TradingView ships with a falsification test built in. It is also the single fastest way for a sceptical user to satisfy themselves that this thing is honest.
Triple-barrier outcome. From each signal: did price reach +target, −target, or neither within the horizon? A well-defined outcome, not a vague "did it go up eventually".
Base-rate comparison. The honest yardstick — the unconditional rate of the same outcome, matched to the signal's own side and regime mix. Edge = Hit% − Base%, never raw Hit%.
Significance gate. A score-interval lower bound must clear the base rate before an edge is called proven — which matters most at small samples, exactly where point estimates lie.
Regime and side split. Edge is reported for long vs short and trend vs range separately, because a real edge usually lives in one and not the other.
Remove any one and the tool can be fooled into reporting confidence it hasn't earned.
How to use it
Pick the signal (external source or a built-in), set the outcome (horizon + target in ATR), and read the verdict: PROVEN +X% ★ / Not proven / Gathering data.
The two plotted lines are the running Hit % (of the signal) and Base % (unconditional) — the gap between them IS the edge, and you can watch it stabilise as samples accumulate. Switch the dashboard to Pro to see where the edge lives (long/short, trend/range).
If it says "no proven edge", believe it. That's the tool working, not failing.
Data & scope
Works on any symbol and timeframe — it needs only OHLC, no volume. Give it enough history to reach the minimum sample count, or the verdict will honestly read "Gathering data". Because the base rate is measured on the same chart, the yardstick always matches the instrument you're on.
Non-repainting & honest limits
Confirmed-bar reads; samples log at the signal bar and resolve on closed bars.
This is an in-sample, forward-from-signal study aid — NOT a walk-forward backtest. No costs or slippage. Overlapping forward windows correlate samples (the minimum-gap setting mitigates this; it does not eliminate it). Small-n edges are provisional even when starred. A proven in-sample edge is not a guarantee out-of-sample. Nothing here predicts price.
Concept credits
Built on standard, published techniques — triple-barrier forward labelling (M. López de Prado), base-rate / skill-vs-chance evaluation (a long tradition in forecast verification), the efficiency-ratio regime read (Perry Kaufman), and the Wilson score interval for a proportion (Edwin B. Wilson). The signal-agnostic intake, the coupling and the plain-language verdict are this script's own. No third-party Pine code is reused.
Disclaimer
Research and educational tool only. Not financial advice, no recommendation, no guarantee of results. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability. Indicatore

DCA + DRIP Simulator [WynTrader]DCA + DRIP Simulator
Hello my friend
This tool simulates real effect of an investment plan when a disciplined DCA+DRIP strategy compounds growth, compared to simply investing and pocketing the dividends. It applies to all kind of security with or without dividend paid, so you can compare what tickers you want..
This isn't a simplified estimate. It reads real price, dividend, and split data directly from TradingView — bar by bar, month by month — and reconstructs what a real investor would have experienced. Apply it to any security — dividend-paying or not, stock, ETF, closed-end fund — and see the picture side by side: with DRIP and no DRIP.
█ CONCEPTS
This indicator illustrates clearly that DCA+DRIP can build more wealth over time than a standard monthly investment approach where dividends are simply cashed out with no plan in mind.
— Dollar Cost Averaging (DCA) means investing a consistent amount every single month, no matter what the market does. When prices drop, your money buys more shares automatically. Over time, this discipline lowers your average cost and keeps emotion out of the equation.
— Dividend Re-Investment Plan (DRIP) means every dividend payment goes straight back into buying more shares, instead of sitting idle. Those extra shares generate their own dividends, which buy more shares — a compounding effect that grows the longer you stay invested.
Together, DCA + DRIP compound together over time.
█ HOW IT WORKS
Set your chart to MONTHLY intervals, else the table is set to zero.
Once configured, the indicator reads price, dividend, and split data directly from TradingView and simulates what a real investor would have experienced: buying every month (DCA), collecting dividends, reinvesting them automatically (DRIP) and adjust data with Splits.
█ FEATURES
Configurable DCA Parameters
Set your initial deposit, monthly contribution, and an optional annual DCA increase (e.g. +5%/yr to reflect salary growth and inflation over time). A withholding tax rate can also be applied for US-listed securities (e.g. 15% for ZQQ).
Flexible Date Range
The simulation runs from your chosen: a) Number of years to date; b) Start date to date; c) Visible chart from Start/End dates of your chart screen.
Side-by-Side Comparison
Every result is shown in two columns simultaneously — With DRIP and No DRIP. Capital, monthly dividend income, total dividends received, net gain, and share count — all at a glance.
Fully Customizable Table Display
Position, text size, and all colors are adjustable directly from the settings panel, so the table fits cleanly on any chart layout.
█ CONCLUSION
Load this indicator on any security — stock, ETF, closed-end fund, with or without dividends. DCA+DRIP Simulator applies to all of them, though DRIP's effect is most visible on dividend-paying securities, where reinvested dividends compound over time.
The difference between With DRIP and No DRIP can be significant over time.
█ WynTrader
I am not a Pine Script programmer — I am an investor who builds tools to support my own analysis, and maybe helps others. A few anomalies may have slipped through and there is likely room for improvement.
Hope you find this little tool useful. Enjoy!
WynTrader Indicatore

Indicatore

Supertrend Parameter Sensitivity 3D [LuxAlgo]The Supertrend Parameter Sensitivity 3D indicator is a powerful optimization tool that executes 100 simultaneous Supertrend backtests bar-by-bar to visualize how different ATR Lengths and Multipliers impact performance across various metrics.
By projecting this data onto a 3D surface and a heatmap dashboard, it allows traders to identify "stable" parameter zones and avoid over-optimized "peaks" that may lead to curve-fitting.
🔶 USAGE
This tool is designed to help traders find the most robust settings for the Supertrend indicator on any given timeframe or asset. Instead of manually guessing settings, users can see a holistic view of the parameter space.
🔹 3D Surface Projection
The 3D surface is rendered directly on the chart, where the X-axis represents the Multiplier, the Y-axis represents the ATR Length, and the Z-axis (height) represents the chosen performance metric.
Gold Highlight: Marks the absolute "Best" parameter combination based on the selected metric.
Blue Highlight: Marks the "Stable Area," which is the region where the average performance of a 3x3 parameter window is highest. This helps identify settings that remain profitable even if market conditions shift slightly.
🔹 Optimization Dashboard
The dashboard provides a detailed heatmap of the 100 tested combinations.
Value Distribution: An ASCII histogram at the top shows the distribution of all results, helping you understand if the "best" setting is an outlier or part of a consistent trend.
Heatmap Matrix: Displays the exact values for every combination. Hovering over any cell in the table reveals a tooltip with specific data, including the total number of trades for that combination.
Color Scaling: The colors are normalized relatively. Green represents the best results in the current set, while red represents the worst, allowing for clear visual distinction even if all results are negative or positive.
🔶 DETAILS
🔹 Bar-by-Bar Evaluation
The script manages 100 independent Supertrend states simultaneously. On every bar, it calculates the ATR and trailing stop levels for every combination in the sensitivity matrix. It simulates "Always-in-Market" trades (flipping long/short on direction changes) to track performance data without needing a separate strategy execution.
🔹 Optimization Metrics
Users can choose from 9 different metrics to optimize the 3D surface and Dashboard:
Win Rate: Percentage of trades that resulted in a profit.
Net Profit: Total gross profit minus total gross loss.
Profit Factor: Ratio of gross profit to gross loss.
Total Trades: The raw volume of signals generated.
Average Trade: The mean percentage return per trade.
Reward/Risk Ratio: The average win divided by the average loss.
Gross Profit: Total sum of all winning trades.
Total Wins: The absolute count of profitable trades.
Win/Loss Ratio: The count of wins divided by the count of losses.
🔶 SETTINGS
🔹 Main Indicator
ATR Length: The length used for the primary Supertrend line plotted on the chart.
Multiplier: The multiplier used for the primary Supertrend line plotted on the chart.
🔹 Sensitivity Ranges
Length Start: The starting ATR length for the 10x10 matrix.
Length Step: The increment added to the length for each subsequent row.
Multiplier Start: The starting Multiplier for the 10x10 matrix.
Multiplier Step: The increment added to the multiplier for each subsequent column.
🔹 Optimization
Metric: Selects the performance data used to determine the Z-height of the surface and the colors of the heatmap.
🔹 3D Surface Style
High/Low/Wire/Stable Colors: Customize the visual appearance of the 3D projection.
X/Y/Z Spacing & Scale: Adjusts the physical dimensions and height of the 3D surface on the chart.
🔹 Dashboard
Enable Dashboard: Toggles the visibility of the heatmap table.
Position/Size: Controls where the dashboard appears and how large it is on the screen.
Indicatore

Apex Edge - Trend Breakout V1.1Apex Edge — Trend Breakout
A with-trend channel breakout system with a 30-symbol radar and a dual-window, cost adjusted backtest.
Indicator Guide · Apex Edge
This guide explains exactly what the indicator does, how every number is calculated, why the backtest is built the way it is, and how to trade it. Nothing here is hidden behind a black box — the whole point of the tool is that you can see the workings and judge the edge for yourself.
1. What it is
Apex Edge — Trend Breakout is a single overlay indicator that does four jobs at once:
• Signals trades when price breaks the recent range in the direction of the dominant trend.
• Manages the trade with a chandelier trailing stop, so winners are allowed to run and losers are cut quickly.
• Scans a 30-symbol watchlist (the Radar), ranking what is trending and flagging what is about to break.
• Tests the rules on the chart symbol across two separate date windows and reports the result as average R and sample size — then auto-grades it Red, Amber or Green.
The thesis. Most price action is noise. Occasionally a market trends, and when it does, a break of the recent range tends to continue. The edge of such a system does not come from being right often — it comes from a fat right tail: many small losses when breaks fail, paid for by the occasional large runner that the trailing stop rides for multiples of the initial risk. The tool is built end-to-end to find that behaviour and to stop you fooling yourself about whether it is really there.
2. What appears on your chart
• Green and red rails — the upper and lower edges of the breakout channel. A close beyond a
rail is a potential trigger.
• Up / down triangles — confirmed entries (a close-break that agrees with the trend).
• Orange line — the live trailing stop for the most recent signal. This is where your protective
order goes.
• HUD (top-right by default) — the chart symbol's trend, distance to its rail, current setup state, last signal and a running long/short signal count.
• Radar (top-left) — the 30-symbol scanner with score, direction, state and a Red/Amber/Green
“Go” column.
• Backtest panel (bottom-right) — two date windows side by side, each showing average R and
trade count per side, plus an automatic verdict.
3. The entry signal — how it is calculated
3.1 The breakout channel
The rails are the highest high and lowest low of the last N bars (default 20), measured up to the
previous bar so they never repaint:
upBreak = highest(high, 20) of the prior bar
dnBreak = lowest(low, 20) of the prior bar
A long trigger is a close crossing above the upper rail; a short trigger is a close crossing below the lower rail. Because the test is on the close, an intrabar wick through a rail that closes back inside does not trigger — only a genuine close beyond the range counts.
3.2 The dominant-trend filter
A breakout alone is not enough; it must agree with the trend. Trend is defined by a long EMA (default 200) and that EMA's slope, so a flat market counts as no trend:
Uptrend = close > EMA(200) AND EMA(200) rising over the last 5 bars
Downtrend = close < EMA(200) AND EMA(200) falling over the last 5 bars
Requiring both price position and EMA slope filters out the chop that ruins most breakout systems: if the EMA is flat, neither condition is true and no trades are taken.
3.3 Optional higher-timeframe agreement
You can additionally require the higher timeframe (default daily) to agree, using its last closed bar's EMA so it cannot repaint. With it on, a 4H long also needs the daily to be pointing up. Off by default.
3.4 The final rule
Long = close-break of the upper rail AND dominant uptrend
Short = close-break of the lower rail AND dominant downtrend
With “with-trend only” enabled (the default), counter-trend and flat-market breaks are blocked entirely.
The triangle only prints when both halves line up.
4. The exit — chandelier trailing stop, and what “R” means
Risk is defined the moment you enter. The initial stop sits a multiple of Average True Range away from entry (default 1.5 × ATR(14)). That distance — entry to initial stop — is one R.
Every outcome the tool reports is measured in multiples of that initial risk.
Once in the trade, the stop trails using a chandelier: it hangs a multiple of ATR (default 3 × ATR)
below the highest high reached since entry (mirrored for shorts). It only ever moves in your favour - it ratchets, never loosens. You exit when price touches the line.
• A loss is roughly −1R: the break fails and price falls back to the initial stop.
• A win is whatever the trail captures — often small, occasionally very large when a real trend
develops. There is no fixed profit target; capping the winners would throw away the exact tail
the system exists to harvest.
Note Live, you place a resting stop on the orange line and step it along as the line moves. The
backtest exits on the same intrabar touch, so what you test is what you trade.
5. The Market Radar — how the scan is built
The Radar pulls 30 symbols on the scan timeframe (default 4H) and ranks them so you watch the right markets. Four numbers drive it.
5.1 Trend-strength score
The score blends how cleanly a market is moving with how strongly:
• Efficiency Ratio (ER) — net distance travelled divided by the total path taken, over a lookback
(default 20). A straight move scores high; a market that thrashes back and forth to end up in the same place scores low.
ER = |close − close | / sum of |bar-to-bar moves over 20| (as a %)
• ADX — the standard directional-strength index (default 14).
The two are scaled and blended 55% ER / 45% ADX, calibrated so a market in a genuine trend reads roughly 60–70. Only symbols above the score threshold (default 50) are shown, strongest first.
5.2 Direction, NEAR and the Go grade
• Direction comes from the same dominant-EMA logic as the chart (up, down, or flat).
• NEAR flags a symbol that is trending and within a set distance of its breakout rail in the trend
direction (default 0.5 × ATR) — i.e. about to trigger.
• Go (Red / Amber / Green) is read from your own curated lists. You tell the indicator which
symbols you trade long and short at Green (confirmed) and Amber (testing) confidence; the Go
column then lights up only for those symbols in that direction.
Note The Radar does not grade edges for you — you populate the Green/Amber lists from your own backtest sweep (Section 6). The Go column simply surfaces your decisions on the live scan.
6. The backtest engine and the Auto verdict
This is where you decide whether a symbol earns a place on your lists. For the chart symbol, the engine replays every historical signal forward (up to 60 bars), simulates the exact chandelier trail with intrabar touch exits, deducts your cost per trade, and records each result in R.
It does this across two independent date windows and reports, for each window and each side
(long / short / all):
• Avg R — the average result per trade, net of cost. This is the system's expectancy.
• N — the number of trades in that window. This tells you whether to believe the Avg R.
The Auto column then turns that into a verdict using two thresholds (defaults shown), applied to both windows:
Verdict Condition
GREEN Avg R ≥ 0.10 AND N ≥ 50 in BOTH windows — a real, repeatable edge
AMBER Qualifies in one window, or only marginally — promising, not proven
no Fails the bar — no demonstrated edge this way
A Green therefore is not a single good run; it is an edge that survived two separate market periods with a large enough sample in each. That is the bar a symbol must clear before it goes on your Green list.
Note Cost is entered in price units and applies to the chart symbol, so set it to that instrument's
realistic round-trip spread before trusting a marginal (Amber) result. A couple of pips is what flips a thin edge from positive to negative — which is exactly the truth you want before risking money.
7. Why those default backtest dates?
The two windows default to 2019–2021 and 2022–present, and the split is deliberate. These are not two halves of one stretch — they are two genuinely different market regimes:
• 2019–2021 spans the late-cycle calm, the COVID crash and the violent recovery — a high volatility, strong-trend era.
• 2022–present is the rate-hiking regime: broad USD strength, a real equity bear in 2022, and a
different volatility character.
A set of rules that prints a profit in one regime might simply be tuned, by luck or by hand, to that regime. The only honest test is whether the same untouched rules also work in a different one.
Requiring an edge to clear the bar in both windows is the out-of-sample check built directly into the panel. The dates are adjustable — what matters is that the two windows cover different conditions, not the exact years.
8. Why we judge by R and N, not win rate
Win rate is the most quoted and least useful statistic in trading. On its own it tells you almost nothing, and for a system like this it actively misleads.
8.1 Win rate hides the size of wins and losses
Two systems can have wildly different win rates and the opposite profitability. Expectancy — average R per trade — is what actually ties to your account:
System Win rate Expectancy Reality
“High win rate” (avg win 90% +0.5R Loses Money
+0.5R, avg loss −5R)
Trend breakout (avg win 40% +0.60R Strong edge
+3R, avg loss −1R)
The 90%-winner loses on the rare 5R disaster; the 40%-winner thrives because its winners dwarf its losers. Judge either by win rate and you draw the wrong conclusion. Expectancy = (win% × avg win) − (loss% × avg loss), expressed in R, is the number that matters.
8.2 This system is meant to be a low win-rate system
A trend-breakout-with-trail design is designed to win less than half the time. Most breakouts fail and cost ~1R; a minority become trends and the trail rides them for many R. The profit lives entirely in those few big winners — the fat right tail. Win rate cannot see that tail; only average R can.
Optimising for win rate would push you to cap winners and widen stops, destroying the very edge the tool is built to capture.
8.3 N is what makes the average believable
An average R is only as trustworthy as the number of trades behind it. A +0.8R average on 8 trades is a coin landing heads a few times in a row — it tells you nothing. The same average on 120 trades is a genuine signal. That is why the Auto grade refuses to certify anything below N ≥ 50 per window, no matter how attractive the Avg R looks. Small samples are where traders fool themselves most, so the tool simply will not show Green there.
8.4 How to read an Avg R figure
Avg R (net of cost) Read it as
≤ 0 (negative) A losing side — shown red and correctly left off your lists
+0.05 to +0.15 Marginal — cost and slippage can erase it
+0.15 to +0.35 A solid, tradeable edge
+0.35 to +0.80 Strong — and normal for this let-run design when a market trends cleanly
+0.80 and up Exceptional — sanity-check it before you believe it (see below)
Two cautions. First, R is signed. A side can be negative, meaning that direction lost money over the test — it is shown in red, and the Auto verdict only turns green for positive R that clears the bar in both windows. A red number is not a high score you should chase; it is a losing side the tool is keeping you out of.
Second, because this design lets winners run, a healthy average is usually carried by a minority of large trades rather than spread evenly across all of them. That is expected behaviour for trend following, not a flaw — but it means a very high figure deserves a look at the trade distribution, and a check for look-ahead, before you treat it as durable. High positive R here is the system working; it is only suspect when it is extreme or rests on a handful of trades.
9. How to trade it
The workflow separates the slow, careful job (deciding what to trade) from the fast one (executing when it triggers).
1. Weekly — curate. Flick through your watchlist. On each symbol read the Auto panel and note
the verdict per side. Add Green symbols to the matching Green list (long or short) in settings,
and Amber symbols to the Amber lists. Skip the reds.
2. Set once — the blanket alert. On a 4H chart create the “Watchlist near breakout” alert, set to Once Per Bar Close. It pings only for your Green/Amber symbols when one is trending and
nearing its rail.
3. On the ping — find the trade. Open the Radar. Confirm the symbol shows Green/Amber Go +
NEAR + the right direction.
4. Arm the entry. On that symbol's chart set the “Breakout Long/Short” alert, also Once Per Bar
Close, so only a close beyond the rail can fire it (no wicks).
5. Enter. When the triangle prints, take the trade and place your stop on the orange trailing line.
6. Manage. Step the stop along with the line as it moves your way — never against you. Exit on the touch. No fixed target; let the trail decide.
10. Trading rules and risk discipline
• Trade Green in the validated direction. Amber is watch-and-small-size. Red is no trade.
• A break against the trend is not your trade. Skip it, however tempting.
• Judge over a batch of trades, never one. A single loss says nothing about a positive expectancy system; variance is the cost of admission.
• One settings set for all symbols. Never tune the inputs per symbol to flatter the past — that is
curve-fitting. If you change a strategy setting, re-test both windows before trusting it again.
• Size correlated instruments as one position. A basket of yen crosses, or a basket of equity
indices, is one bet wearing several names. Three 1% longs that all rise and fall together is a 3%
bet on one theme, not three diversified trades.
11. Settings reference
Setting Defaults and What they mean:
Breakout channel 20 Bars - used for the high/low rails
Near-break heads-up 0.5 ATR - How close to the rail counts as NEAR
Dominant EMA 200 - The trend reference line
EMA slope lookback 5 Bars - used to judge the EMA's slope
With-trend only On - Blocks counter-trend and flat-market breaks
Higher timeframe Off / 1D - Optionally require the daily to agree
Initial stop 1.5 ATR - Defines one R (entry to stop)
Chandelier trail 3.0 ATR - Trailing distance below the running extreme
Trade window 60 bars - How far the backtest follows each signal
Cost per trade 0 - Round-trip cost in price units (set per instrument)
Test windows A / B 2019–21 / 22–now - The two regimes the Auto grade checks
Qualify Avg R / N 0.10 / 50 - Thresholds for a Green verdict, per window
Scan timeframe 4H - Timeframe the Radar evaluates
Score threshold 50 - Minimum trend score to appear on the Radar
12. Non-repainting, and honest limitations
Non-repainting by design. Signals use closed-bar prices and the prior-bar channel, the higher timeframe pull uses the last closed bar, and the backtest only ever replays bars that were already in the past relative to each signal. What you see on history is what you would have seen live.
What a backtest can and cannot tell you. The replay is a simulation. It assumes fills at the touched price and a fixed cost; live trading adds variable spread, slippage, gaps and partial fills. Treat the Avg R as an estimate of edge and direction, not a promise of returns. Forward-test before you scale.
• The Green/Amber lists are your inputs — the tool surfaces your decisions, it does not validate
them for you.
• Correlated symbols inflate the apparent number of edges; the count is not the same as
diversification.
• A strong directional drift in an asset class (equities up, for example) can make a one-sided
system look better than the rule itself is.
This indicator is a decision-support and research tool. It is not financial advice and does not place trades.
Markets carry risk; past performance does not guarantee future results. You are responsible for your own decisions and risk.
Apex Edge - Trend Breakout - Radar finds the trend - Auto/Go says if it pays - Arrow times entry - Orange line manages - exit Indicatore

Trend Volatility RegimeThe Trend Volatility Regime is an all-in-one trend-following model that identifies changes in the market regime by combining moving-average crossover signals with volatility-adaptive trailing stops. It features an integrated backtesting engine that provides institutional-grade insights into historical strategy performance, along with a built-in alert system that notifies investors in real time when regime changes occur. The model integrates seamlessly into the price chart and presents backtest results in a clear, color-coded table benchmarked against buy-and-hold.
At its core, the model combines two complementary trend detection components to determine the prevailing market regime. The first component identifies the underlying structural trend using a volatility-adjusted moving-average crossover based on the spread between fast and slow moving averages. The second component identifies trend reversals using an adaptive trailing stop based on changes in price and volatility. Bullish and bearish regimes occur when both crossover and volatility signals are directionally aligned, while conflicting signals result in neutral regimes.
Bullish Crossover Signal = (Fast MA – Slow MA) > (ATR × Trend Margin)
Bearish Crossover Signal = (Fast MA – Slow MA) < –(ATR × Trend Margin)
Bullish Volatility Signal = Price > (Highest Price – (Volatility × Stop Factor))
Bearish Volatility Signal = Price < (Lowest Price + (Volatility × Stop Factor))
By default, the model applies an asymmetric regime design in which conflicting signals default to a bullish regime unless half-equity positions are enabled in the menu. This asymmetric design reflects the tendency of risk assets to deteriorate gradually while recovering more abruptly. The moving-average component captures the slower deterioration typically observed during market tops, while the trailing stop component responds more dynamically to faster reversals typically observed at market bottoms. This helps reduce overreaction to corrections during uptrends while still allowing for faster re-entry following sharp recoveries. To evaluate the performance of different parameter configurations, the model includes a built-in table with the following metrics:
CAGR = Compounded Annual Growth Rate.
Excess = CAGR in excess of buy-and-hold.
Sharpe = CAGR per unit of standard deviation.
Sortino = CAGR per unit of downside deviation.
Calmar = CAGR relative to maximum drawdown.
Max DD = Largest peak-to-trough decline in value.
Alpha (α) = Excess annualized risk-adjusted returns.
Win Rate = Ratio of profitable trades to total trades.
Profit Factor = Total gross profit per unit of losses.
Expectancy = Average expected return per trade.
Turnover = Average annualized change in exposure.
This indicator is designed with flexibility in mind, enabling users to specify the start date of the backtesting period, the preferred trend type, volatility type, and regime visualization. Supported regime visualizations include line, candle, and shaded background. Supported moving-average types include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), and Weighted Moving Average (WMA). Supported volatility types include the Average True Range (ATR), Standard Deviation (SD), and Mean Absolute Deviation (MAD). Supported price sources include Close, HL2, HLC3, and OHLC4. The table follows an intuitive color-coded logic that allows for quick performance comparison against buy-and-hold (B&H):
CAGR = Green indicates above 0%, while red indicates below 0%.
Excess = Green indicates above 0%, while red indicates below 0%.
Sharpe = Green indicates better than B&H, while red indicates worse.
Sortino = Green indicates better than B&H, while red indicates worse.
Calmar = Green indicates better than B&H, while red indicates worse.
Max DD = Green indicates better than B&H, while red indicates worse.
Alpha (α) = Green indicates above 0%, while red indicates below 0%.
Win Rate = Green indicates above 50%, while red indicates below 50%.
Profit Factor = Green indicates above 2, while red indicates below 1.
Expectancy = Green indicates above 0%, while red indicates below 0%.
In summary, the Trend Volatility Regime is a comprehensive trend-following tool designed to help investors stay on the right side of the market by identifying key changes in the market regime. By combining volatility-adjusted moving-average crossover signals with adaptive volatility-based trailing stops, the model seeks to maximise participation during uptrends while reducing exposure during sustained downtrends. While the model provides valuable historical insights, users should remain mindful that past results may not necessarily persist under future market conditions. Indicatore

EMA Edge - Multi-EMA Backtest Table with Golden/Death CrossEMA Edge — Multi-EMA Backtest Table with Golden/Death Cross
A clean, all-in-one performance dashboard that backtests 6 long-only strategies side-by-side against a Buy & Hold benchmark — 5 single-EMA crossover strategies plus a classic Golden Cross / Death Cross strategy — with on-chart cross markers and built-in alerts.
Instead of guessing which EMA length works best for a given stock or timeframe, this indicator runs the math for you and shows the answer in a single glance, ranked against simply holding the asset.
What It Does
For each of 5 user-defined EMA lengths, the indicator simulates a simple long-only strategy:
Buy when price closes above the EMA (when flat)
Sell when price closes below the EMA (when long)
Equity starts at 100 and compounds across trades using the close-to-close return of each trade
A 6th strategy row tests the classic Golden/Death Cross:
Buy when the fast EMA crosses above the slow EMA (Golden Cross)
Sell when the fast EMA crosses below the slow EMA (Death Cross)
Special first-bar handling: if the fast EMA is already above the slow EMA at the start of your backtest window (i.e., we're mid-trend with no fresh Golden Cross to wait for), the strategy enters immediately at that bar's opening price. This avoids the unrealistic outcome of sitting in cash for years waiting for a cross that already happened.
All strategies are compared against a Buy & Hold baseline that starts at the close of the first in-range bar. If a position is open at the last bar, its equity is marked-to-market so every strategy is compared on equal terms — fully invested vs. partially invested at the cutoff.
Features
5 configurable EMAs — defaults 9 / 21 / 50 / 100 / 200, fully editable
Golden/Death Cross strategy — uses independent fast/slow EMA inputs (default 50 / 200)
Performance table showing Return %, delta vs. Buy & Hold, and Outperform / Underperform status per strategy
Flexible backtest window — X weeks, X years, or full chart lifetime
On-chart GC / DC markers with optional subtle background tint on cross bars
Built-in alerts for both Golden Cross and Death Cross events
Fully customizable table — 9 position options, 6 text sizes, all colors exposed as inputs
Soft, light color palette designed not to dominate the chart
Optional EMA plotting (off by default to keep the chart clean)
How To Read The Table
ColumnMeaningStrategyThe rule being testedReturnTotal % return of the strategy over the chosen windowVs StockDifference between the strategy's return and Buy & HoldStatus▲ Outperform if the strategy beat Buy & Hold, ▼ Underperform if not
Green-tinted rows = strategy beat Buy & Hold
Red-tinted rows = strategy underperformed Buy & Hold
Cream row = the Buy & Hold baseline itself
How To Use
Add the indicator to any chart — works on stocks, ETFs, crypto, forex, any timeframe.
Choose your backtest window (e.g., 1 Year, 5 Years, or Lifetime).
Scan the table to see which strategy historically beat Buy & Hold on this asset.
Use the on-chart GC / DC labels to spot historical and live cross events. Right-click any marker → Add Alert to be notified on new crosses.
Tip: Test the same EMA lengths across daily and weekly timeframes and across different assets. You'll usually find that what works on a steady index like SPY does not work on a volatile single stock, and vice versa. That's the entire point of the table — to make those differences visible instead of assumed.
Key Inputs
EMA 1–5: Lengths for the 5 single-EMA strategies
Show EMAs: Plot EMAs on chart (off by default)
Use Lifetime Performance: Backtest from the very first bar instead of a fixed window
Performance Timeframe Type / Value: Weeks or Years lookback
Crosses group: Toggle GC/DC display, set fast/slow EMA lengths, customize colors
Table Style group: Position, text size, background and text colors
Notes & Limitations
All strategies are long-only — no shorts, no leverage, no stops, no commissions, no slippage. This is a clean rule-based comparison, not a turnkey trading system. Live results will differ.
Entries and exits use close prices, except for the GC/DC strategy's first-bar entry when already in a golden state, which uses open.
Open positions at the last bar are marked-to-market so the comparison vs. Buy & Hold is apples-to-apples.
Past performance is not indicative of future results. Use this as a research and screening tool.
The GC/DC strategy uses separate EMA lengths from the 5 table EMAs by design, so you can run 9/21/50/100/200 in the table while still testing the classic 50/200 cross.
Alerts Available
Golden Cross: Fast EMA crossed above Slow EMA
Death Cross: Fast EMA crossed below Slow EMA
If you find this useful, a boost is appreciated. Suggestions and feedback welcome in the comments.
Open-source — feel free to study, fork, and adapt. Indicatore

Tension Flow Trend [BigBeluga] - Historical RRTension Flow Trend is a high-performance trend-following framework that treats price action like a reactive elastic system. By moving beyond static averages, this indicator introduces "Price Tension"—a sophisticated measurement of how overstretched a trend is relative to its baseline—now enhanced with a live Historical RR (Risk:Reward) backtesting engine.
By combining the ultra-low-lag properties of the Hull Moving Average (HMA) with real-time Z-Score volatility analysis, this indicator visualizes not just the direction of the market, but the mathematical "exhaustion" of every move.
🔵 THE ELASTICITY FRAMEWORK
The Ultra-Responsive HMA Baseline: At the heart of the system is a 50-period Hull Moving Average. Specifically engineered to eliminate the lag found in traditional SMAs, the HMA provides a "true north" that reacts instantly to structural shifts without the usual delay.
Price Tension (Z-Score Engine): The indicator measures the vertical distance between price and the HMA, normalizing it using standard deviation. This Z-Score represents the "Tension" of the trend—showing you exactly when the market has deviated too far from its mean.
Dynamic Transparency Feedback: As price enters an extreme Z-Score range, the trend ribbon’s transparency increases. A bright, solid ribbon indicates compressed, high-probability energy, while a fading ribbon warns that the "elastic band" is stretched to its limit.
🔵 PERFORMANCE & RISK INTELLIGENCE
Automated RR Projection: Upon every "START" signal, the script automatically plots dynamic Risk:Reward boxes. It calculates an ATR-based stop loss and projects a take-profit target based on your custom RR ratio, visualizing the trade's path in real-time.
Rolling Performance Tracker: The indicator features a built-in backtester that tracks the win/loss history of the most recent trades. It calculates your Win Rate based on a rolling sample size, allowing you to see how the strategy is performing under current market conditions.
Signal Cooldown Logic: To eliminate "whipsaw" noise, a configurable cooldown engine ensures that signals only trigger during significant structural shifts. This prevents signal clustering in sideways or choppy markets.
🔵 DUAL-DASHBOARD SYSTEM
Energy Monitor (Bottom-Right): Tracks the numerical Z-Score and categorizes the market status. "Strong" indicates healthy momentum, while "Overextended" warns of an imminent mean-reversion risk.
RR Performance Table (Top-Right): Provides an institutional-grade breakdown of your strategy performance, including total Wins, Losses, and the current Win Rate percentage for the specified trade window.
🔵 STRATEGIC APPLICATION
The Momentum Breakout: Look for "START" labels that appear when the HMA slope aligns with a price crossover. These represent the birth of a new trend cycle where tension is low and expansion is likely.
Managing Trend Exhaustion: When the ribbon begins to fade and the Energy Dashboard hits "Overextended," it is time to tighten stops or take partial profits. High tension usually precedes a sharp snap-back to the baseline.
Confirming with Win Rate: Use the Performance Dashboard to gauge market regime. If the rolling Win Rate is high, the market is respecting the trend envelopes; if it drops, the market may be entering a consolidation phase where you should wait for better alignment.
Mean Reversion Targets: For contrarian traders, the HMA baseline serves as a natural "magnet." When price is significantly overextended, look for price to be pulled back into the HMA "Neutral Zone."
Tension Flow Trend transforms your chart into a map of market stress and opportunity. By visualizing the tension behind every candle and providing real-time performance feedback, it ensures you stay on the right side of the trend while trading with professional-grade risk management. Indicatore

Strategy Sensitivity MatrixThe Strategy Sensitivity Matrix is an institutional-grade backtesting tool designed to evaluate the robustness and parameter sensitivity of trend-following strategies. It enables users to compare the historical performance of a broad range of parameter combinations across multiple metrics to assess the overall stability of the selected strategy. The model displays the complete backtest landscape in a structured, color-coded matrix that allows investors to quickly identify robust parameter regions and evaluate historical performance stability across parameter combinations.
At its core, the matrix systematically evaluates a wide range of parameter combinations, where every individual cell represents the backtest result for one unique parameter configuration. Users can switch between volatility-based strategies and moving-average strategies. In volatility mode, the matrix rows represent volatility lengths and the matrix columns represent volatility factors. In crossover mode, the rows represent fast moving-average lengths and the columns represent slow moving-average lengths. Supported volatility types include the Average True Range (ATR), Standard Deviation (SD), and Mean Absolute Deviation (MAD). Supported moving-average types include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), and Weighted Moving Average (WMA). Supported display metrics include:
CAGR = Compounded Annual Growth Rate.
Sharpe = CAGR per unit of standard deviation.
Sortino = CAGR per unit of downside deviation.
Martin = CAGR relative to the Ulcer Index (UI).
Calmar = CAGR relative to maximum drawdown.
Max DD = Largest peak-to-trough decline in value.
Alpha (α) = Excess annualized risk-adjusted returns.
Expectancy = Average expected return per trade.
Profit Factor = Total gross profit per unit of losses.
Win Rate = Ratio of profitable trades to total trades.
Trades/Year = Average number of trades per year.
The matrix follows an intuitive percentile-based coloring framework that dynamically compares the relative performance and stability of all parameter combinations. Stronger values above or equal to the matrix median are highlighted in green, with bright green representing the top 10% of all parameter combinations. Weaker values below the matrix median are highlighted in orange, while red represents objectively weak performance based on the selected metric. Broad clusters of consistently strong results generally suggest lower parameter sensitivity and potentially greater robustness, while isolated peaks generally suggest elevated parameter sensitivity.
The summary table displayed above the matrix provides a broader distribution-level statistical overview of results across all parameter combinations. This structure allows investors to evaluate whether strong historical performance appears statistically widespread or narrowly concentrated across the parameter landscape. Stable parameter landscapes generally exhibit lower standard deviation, similar median and average values, and smaller performance gaps between the best and top 10% parameter combinations. The summary table includes the following sections:
Start = Start month and year of the selected backtest period.
End = End month and year of the selected backtest period.
Metric = Performance metric currently displayed in the matrix.
B&H = Buy-and-hold performance for the selected metric.
Best = Best-performing parameter combination in the matrix.
Top 10% = Average value of the top 10% parameter combinations.
Median = Median value across all parameter combinations.
Average = Average value across all parameter combinations.
Std Dev = Standard deviation of all parameter combinations.
≥ B&H = Percentage of combinations equal or better than B&H.
In summary, the Strategy Sensitivity Matrix is a powerful robustness analysis tool designed to help investors make data-driven decisions when evaluating parameter combinations across trend-following strategies. By evaluating the full parameter landscape, investors can quickly determine whether strong historical performance appears broadly distributed across stable parameter regions or narrowly concentrated within isolated parameter combinations. While historical robustness can provide valuable insight into past market behavior over the selected backtest period, users should remain mindful that market structures evolve over time and that historically stable parameter regions may not necessarily persist in future market conditions. Indicatore

eXeTRADE Main Dual Score Signal Indicator# eXeTRADE-Main — Dual-Score Signal Indicator
**Trend • Support/Resistance • Higher-Timeframe • Backtest — all in one score**
---
## What it does
eXeTRADE-Main is a multi-factor signal indicator built for medium-to-experienced traders on **1H, 4H, and Daily** timeframes. It calculates **Long and Short scores independently** from five weighted layers — Trend, Support/Resistance, Momentum, Higher Timeframe, and Risk/Reward — and produces three signal grades:
- **Strong Buy / Sell** — score ≥ 90
- **Normal Buy / Sell** — score ≥ 75
- **Range Buy / Sell** — when R:R ≥ 3.0
The indicator is designed for **plan-driven, low-risk trading**. It auto-detects trend lines and parallel channels, ranks the top three S/R levels by strength, runs a weekly Best-MA backtest, and applies a **Proximity Gate** that penalises signals fired too close to a strong opposing level — the most common cause of immediate reversals.
## Key features
- Dual scoring — Long and Short calculated independently (0–100 scale)
- 14-MA + Best-MA weekly backtest (Trade / Long / Short / S/R averages auto-tuned)
- 3-layer trend line + parallel channel auto-detection with break tracking
- Pivot-based S/R with touch counting and violation tracking; top 3 selected by strength
- HTF context — EMA50/200, RSI, pivot, Ichimoku cloud, and volume folded into the score
- **Proximity Gate** — soft-block or hard-block when entry sits within 0.5×ATR of opposing S/R
- Built-in backtest engine with S/R trailing stop
- Position-management panel for manual entry / TP / SL tracking
- Single consolidated master alert (one alert covers every signal and trail event)
## How to read the chart
Numbered markers on the cover image:
1. **Score Panel** — current Long/Short scores with delta arrows, ATR, and trail status
2. **Top S/R Levels** — three strongest levels, ranked by point score
3. **Backtest Results** — trade count, win/loss, win rate, total P/L, max drawdown
4. **Buy Signal** — green triangle marks Strong / Normal / Range Buy entries
5. **Trail Exit** — yellow × marks where the trailing stop was hit
6. **Auto Trend Lines** — multi-layer trend with parallel channels
## Important settings
- **Backtest Period** — 1 Mo / 3 Mo / 6 Mo / 1 Yr / All
- **Entry Mode** — Single (one position) or Multi (pyramiding)
- **Signal Levels** — Strong (default 90) and Buy/Sell (default 75) thresholds
- **Proximity Gate Mode** — Off / Warning / Soft Block / Hard Block
- **HTF Auto-Bump** — automatically lifts the HTF reference one level if the chart TF matches HTF
## Alerts
A single **master alert** is recommended — it fires for every signal and trail event in one channel. Individual alerts (Strong Buy, Strong Sell, Trail Hit, Channel Break, etc.) are also available if granular control is preferred.
## Best on
4H and Daily timeframes for **Forex pairs, XAUUSD, XAGUSD, and major equities**. Not recommended below 1H — short-timeframe noise reduces score reliability.
## Disclaimer
This indicator is a decision-support tool, not financial advice. **Always define stop-loss and exit plan before entry.** Past performance does not guarantee future results. Trade at your own risk.
---
*Comments and feedback are welcome.*
Indicatore

Volatility Stop SelectorThe Volatility Stop Selector is a comprehensive trend-following tool designed to automatically identify the optimal volatility stop strategy. It features adjustable parameters and an integrated backtester that delivers institutional-grade insights into the recommended strategy. The model continuously adapts to new data in real time by evaluating multiple volatility length and factor combinations, determining the best-performing configuration, and presenting the backtest results in a clear, color-coded table that benchmarks performance against the buy-and-hold strategy.
At its core, the model systematically backtests a wide range of volatility stop combinations to identify the configuration that maximizes the selected optimization metric. Users can choose to optimize for absolute returns or risk-adjusted returns using metrics such as the Sharpe, Sortino, Martin, or Calmar ratios. The Martin ratio is particularly well suited for volatility-based risk management strategies, as it evaluates returns relative to the Ulcer Index, capturing both the depth and duration of drawdowns and therefore favoring smoother equity curves. Alternatively, users can enable manual optimization to test custom volatility length and factor settings and view the corresponding backtest results. The label displays the Compounded Annual Growth Rate (CAGR) of the strategy, with the buy-and-hold CAGR in parentheses for comparison. The table presents the backtest results based on the volatility length and factor displayed at the top:
Sharpe = CAGR per unit of standard deviation.
Sortino = CAGR per unit of downside deviation.
Calmar = CAGR relative to maximum drawdown.
Max DD = Largest peak-to-trough decline in value.
Beta (β) = Return sensitivity relative to buy-and-hold.
Alpha (α) = Excess annualized risk-adjusted returns.
Win Rate = Ratio of profitable trades to total trades.
Profit Factor = Total gross profit per unit of losses.
Expectancy = Average expected return per trade.
Trades/Year = Average number of trades per year.
This indicator is designed with flexibility in mind, enabling users to specify the start date of the backtesting period, the preferred volatility type, and the price source. Supported volatility types include the Average True Range (ATR), Standard Deviation (SD), and Mean Absolute Deviation (MAD). Supported price sources include Close, Heikin Ashi, HL2, HLC3, and OHLC4. To minimize overfitting, users can define constraints such as a minimum and maximum number of trades per year, as well as an optional optimization margin that prioritizes more robust combinations by requiring more reactive combinations to exceed this threshold. The table follows an intuitive color-coded logic that enables quick performance comparison against buy-and-hold (B&H):
Sharpe = Green indicates better than B&H, while red indicates worse.
Sortino = Green indicates better than B&H, while red indicates worse.
Calmar = Green indicates better than B&H, while red indicates worse.
Max DD = Green indicates better than B&H, while red indicates worse.
Beta (β) = Green indicates better than B&H, while red indicates worse.
Alpha (α) = Green indicates above 0%, while red indicates below 0%.
Win Rate = Green indicates above 50%, while red indicates below 50%.
Profit Factor = Green indicates above 2, while red indicates below 1.
Expectancy = Green indicates above 0%, while red indicates below 0%.
In summary, the Volatility Stop Selector is a powerful tool designed to help investors make data-driven decisions when selecting volatility-based trend-following strategies. By optimizing for risk-adjusted returns, investors can identify the best configurations using institutional-grade metrics. While results are based on the selected historical period, users should be mindful of overfitting, as past results may not persist under future market conditions. Since the model continuously recalibrates to incorporate new data, the recommended length and factor may evolve over time. Indicatore

Indicatore

Backtest Template [Backtest Terminal]Overview — What Is This Script?
Backtest Template (BTT) is an open-source strategy framework designed to let traders test their own indicator logic without building the backtest infrastructure from scratch. Instead of writing stop loss management, session filters, alert systems, and trailing stops yourself, BTT handles all of that automatically. You bring your signal idea — BTT handles the rest.
The template is designed for all markets: stocks, Forex, gold (XAUUSD), crypto spot, and crypto futures. It ships with a pre-built Moving Average Cross trigger and Moving Average Trend filter as working examples that you replace with your own logic.
What Makes It Original
Most backtest templates on TradingView are fixed strategies that test one specific indicator. BTT introduces a User Zone architecture: a single clearly marked section near the top of the script where the user replaces one pre-built trigger and one pre-built filter with their own Pine Script code. The engine below reads four fixed variable names and runs automatically — the user never needs to touch strategy orders, stop management, session logic, or the alert system.
This design means a complete beginner can run their first backtest by changing fewer than ten lines of code, while an advanced user can plug in arrays, multi-timeframe calculations, or complex signal logic and the engine handles it identically.
What The Engine Handles Automatically
Once your signal is connected through the User Zone, the following run without any additional code:
Stop Loss and Take Profit — three unit modes: percentage of price, fixed points (Forex / CFD), or fixed dollar amount (crypto / stocks)
Stop Mode — Fixed (original level), Trailing (follows price), or Breakeven (moves to entry price)
Trailing Stop — configurable distance and activation offset, each with matching %, point, and dollar unit inputs consistent with your Stop/Target Mode selection
Breakeven Stop — configurable activation offset in the same unit system
Disable Take Profit — when using Trailing mode, an optional toggle removes the fixed TP so the trailing stop becomes the sole exit
Trade Direction — Long only, Short only, or Both
Backtest Date Range — start and end date inputs
Trading Day Filter — enable or disable any day of the week
Trade Session Hours — exchange server time filter (HHMM-HHMM format)
Trade Windows — four configurable local-time windows each independently set to Off, Blackout, or Trade Only mode with full timezone support
Entry Signal Markers — green and red triangles that only appear when all conditions pass, so chart visuals exactly match what the strategy trades
App Alerts — pre-formatted alert messages with ticker, direction, stop and target prices
Custom JSON Alerts — four separate input fields for webhook bot integration, one per order event
How To Use It — Quick Start
Open the script in Pine Editor
Find the User Zone near the top — it is clearly marked with a visual border and is the only section you need to edit
Replace the pre-built Moving Average Cross trigger block with your own indicator signal, assigning your long condition to userLong and your short condition to userShort — always add and confirmed to both
Replace the pre-built Moving Average Trend filter block with your own market condition, assigning to userFilterLong and userFilterShort
Add to chart and open Strategy Tester
User Zone Contract
The engine connects to your signal through exactly four variables. Do not rename them:
userLong → true on the bar you want to enter Long
userShort → true on the bar you want to enter Short
userFilterLong → true when Long entries are allowed
userFilterShort → true when Short entries are allowed
Always add and confirmed (barstate.isconfirmed) to userLong and userShort. This ensures the signal locks in only when the bar closes, preventing signals from changing value mid-bar.
Setting userFilterLong = true disables the Long filter entirely. Setting it to a condition like close > ta.ema(close, 200) means Long entries are only allowed when price is above that EMA. Long and Short filters are independent — you can filter one direction while leaving the other open.
Stop Loss and Take Profit — Three Unit Modes
The Stop/Target Mode setting controls how SL and TP distances are measured:
% (Percentage) — distance as a percentage of price. Suitable for stocks and crypto. Stop source can be the close price or the candle High/Low. Take profit is derived from stop distance × Risk:Reward ratio.
Point - Forex / CFD — distance in instrument ticks (syminfo.mintick). Suitable for XAUUSD, EURUSD, and other Forex/CFD instruments. Example: 100 points on EURUSD (mintick = 0.00001) = 1 pip.
Dollar - Crypto / Stock — fixed dollar distance from entry. Suitable for BTCUSD and US stocks.
All trailing and breakeven offset inputs follow the same three-unit system. Use the , , or input that matches your selected Stop/Target Mode. Using the wrong unit input will result in a mismatch between your intended stop distance and the actual calculation.
Stop Mode — Fixed, Trailing, Breakeven
Fixed — stop loss stays at the original level from entry until hit or TP is reached
Trailing — stop follows price at a configurable distance, locking in profit as price moves. The trailing activation offset controls how far price must move before trailing begins (shown as a yellow line on chart). Enable "Disable Take Profit" to let the trailing stop manage the entire exit without a fixed TP ceiling
Breakeven — stop moves to the exact entry price once price moves a configurable distance in your favour (shown as a white line on chart)
Trade Windows — Off, Blackout, Trade Only
Each of the four time windows (Tokyo, London, New York, Custom) has an independent mode selector:
Off — this window has no effect on entries (default for all four)
Blackout — block all new entries while the current time is inside this window. Useful for avoiding high-volatility opens or news events
Trade Only — only allow new entries while the current time is inside this window. Useful for targeting specific sessions or news event windows such as NFP or Fed announcements
All times are entered in your local timezone selected from the My Timezone dropdown. The engine converts to UTC internally.
Logic rules:
Multiple Blackout windows use AND NOT logic — entries are blocked if the current time is inside any Blackout window
Multiple Trade Only windows use OR logic — entries are allowed when the current time is inside any one Trade Only window
If no windows are set to Trade Only, there is no time restriction on entries (same as all Off)
Blackout and Trade Only can be combined: for example, set London to Trade Only and New York to Blackout to only trade the London session while avoiding NY volatility
Trading Day and Session
Trading Days — enable or disable any individual day of the week. Disabling a day prevents new entries — open positions are still managed on disabled days.
Trade Session — set allowed hours in exchange server time (HHMM-HHMM format). Default 0000-0000 means 24 hours with no restriction. This uses exchange server time, not your local time.
Alert System — App Alert and Custom JSON
How to activate alerts:
Set the alert mode to App Alert or Custom in the settings panel
Create a TradingView alert on the chart (right-click → Add Alert)
In the alert message box, paste exactly: {{strategy.order.alert_message}}
This placeholder delivers the correct message for each order event automatically
App Alert mode sends a pre-formatted text message for each event:
ENTRY LONG : {price}
STOP LOSS : {stop level}
TARGET PRICE : {target level}
Exit alerts include a PNL percentage. No additional setup is required.
Custom mode — JSON webhook for bot integration:
Four separate input fields accept a single-line JSON string — one per order event:
Long Entry — fires when a Long position opens
Long Exit — fires when a Long position closes (TP, SL, or trailing stop)
Short Entry — fires when a Short position opens
Short Entry — fires when a Short position opens
Short Exit — fires when a Short position closes (TP, SL, or trailing stop)
Paste your JSON as a single line into each field. TradingView's input.string stores the content as a single line regardless of how it was formatted, making it safe for all webhook receivers.
Settings Guide — Commission, Slippage, Margin
Default values are conservative starting points. Edit the strategy() declaration at the top of the script to match your broker and market. Detailed inline comments in the script explain every parameter.
Commission defaults (0.1% per side, 2 ticks slippage):
Stocks zero-commission broker → 0.0%
Stocks SET Thailand → 0.16%
Crypto spot (Binance) → 0.1%
Crypto futures (Binance taker) → 0.04%
XAUUSD $7 per standard lot → change commission_type to strategy.commission.cash_per_contract and commission_value to 0.07 ($7 ÷ 100 oz)
Position sizing (default 2% of equity):
For lot-based markets (Forex, XAUUSD) change default_qty_type to strategy.fixed and default_qty_value to the number of units. On XAUUSD: 1 unit = 1 oz, so 0.01 lot = value of 1, 0.10 lot = value of 10, 1.00 lot = value of 100.
Margin/leverage simulation:
Both margin_long and margin_short are 0 by default (no margin simulation). Formula: margin value = 100 / leverage ratio. Example: 1:500 leverage → margin_long = 0.2. These values cannot be set from the input panel — edit them directly in the strategy() call.
Repainting Warning
Before connecting any indicator to the User Zone, verify it does not repaint. A repainting indicator places signal arrows on past bars using data from future bars that did not exist at the time — backtest results will look excellent while live trading produces nothing like it.
How to check using Bar Replay:
Open the indicator on your chart and find a signal arrow in the past
Open Bar Replay and rewind to before that signal appeared
Step forward one bar at a time using Shift + →
Do not use the Play button (Shift + ↓) — bars move too fast to catch a disappearing arrow
If the arrow appears and stays permanently → safe to use. If the arrow appears then disappears or moves as you advance → repainting confirmed, do not use in a strategy.
How to check using Alert Log:
Enable the indicator's built-in alert, wait for it to fire on a live bar, then compare the alert log entry to the signal arrow on the chart. If they do not match in timing or direction → repainting.
Disclaimer
This script is published for educational purposes only. It is a framework and template — not a complete trading system and not financial advice. Backtest results shown in Strategy Tester reflect historical data only and do not guarantee future performance. Past performance is not indicative of future results.
All trading involves significant risk of loss. Do not trade with money you cannot afford to lose. The results produced by this template depend entirely on the signal logic the user provides — the author accepts no responsibility for any trading decisions made using this script or any modifications of it.
Before using any strategy in live trading, you should fully understand how it works, verify its logic independently, and test it thoroughly on a demo account. Always consult a qualified financial advisor before making investment decisions.
The pre-built Moving Average Cross trigger and Moving Average Trend filter included in the User Zone are provided as examples only — they are not recommendations to trade any specific method. Strategia

ATR Trend Strategy with Moving Average | Fixed TP/SL version📈 ## ATR Trend Strategy with Moving Average
# Overview
This strategy combines a **Moving Average trend filter** with an **ATR-based breakout channel** to identify directional market movements. It is designed for traders who prefer **systematic trend-following strategies with clearly defined risk management**.
The script builds an adaptive channel around a selected Moving Average using **Average True Range (ATR)**. When price moves beyond the ATR band and the move is confirmed for a defined number of bars, a trend state is established. Trade entries can then occur either on the initial breakout or on a pullback to the Moving Average.
The strategy also includes **fixed percentage Take Profit and Stop Loss levels**, allowing users to evaluate performance under consistent risk parameters.
---
⚙️ # Key Features
• **Multiple Moving Average types**
Supports EMA, SMA, WMA, Hull MA, VWMA, RMA, and TEMA.
• **ATR-based dynamic channel**
Uses ATR to create adaptive upper and lower boundaries around the Moving Average.
• **Two entry methods**
Users can choose between breakout entries or Moving Average pullback entries.
• **Trend confirmation filter**
Signals are confirmed only after a configurable number of bars remain beyond the ATR boundary.
• **Built-in risk management**
Includes fixed percentage Take Profit and Stop Loss levels.
• **Trade visualization**
Displays the TP/SL zone directly on the chart for each trade.
• **Performance statistics panel**
Shows key strategy metrics such as:
* Total trades
* Win rate
* Profit factor
* Net profit
* Expectancy
* Average R
* Maximum drawdown
---
🧠 # Strategy Logic
The strategy follows a simple **trend-following structure** :
1️⃣ A Moving Average defines the market's baseline trend.
2️⃣ An ATR multiplier builds a dynamic volatility channel around the Moving Average.
3️⃣ When price breaks above or below this channel and remains there for a specified number of bars, a trend is confirmed.
4️⃣ Entries can occur via:
**Breakout Mode**
* Long when price breaks above the upper ATR band.
* Short when price breaks below the lower ATR band.
**MA Cross Mode**
* After a confirmed trend, entries occur on pullbacks that cross the Moving Average.
5️⃣ Risk is controlled using **fixed percentage Take Profit and Stop Loss levels**.
---
⚙️ # Inputs
Moving Average
* MA Type
* MA Length
* MA Source
ATR Signal
* ATR Type
* ATR Length
* ATR Multiplier
Trend Confirmation
* Number of confirmation bars
* Confirmation price source (Close or High/Low)
Entry & Risk Management
* Entry method (Breakout or MA Cross)
* Take Profit (%)
* Stop Loss (%)
---
📊 ## Usage Notes
This strategy is designed for **trend-following market conditions** and may perform best in environments with sustained directional movement.
Users are encouraged to **experiment with different Moving Average types, ATR multipliers, and confirmation settings** to adapt the strategy to different markets and timeframes.
---
⚠️ ## Disclaimer
This script is provided for **educational and research purposes only**.
Past performance does not guarantee future results.
---
Strategia

ORB Visual Backtester [MTF]This indicator is designed to help traders visualize and backtest the Opening Range Breakout (ORB) strategy with precision and flexibility. Its primary goal is to facilitate rapid visual backtesting , allowing traders to instantly see how price action behaved around the opening range on historical dates and refine their strategies accordingly without needing complex replay modes.
A key feature of this script is its Multi-Timeframe (MTF) capability. It allows you to view the ORB levels of a higher timeframe (e.g., 60-minute or 15-minute) while trading or analyzing on a lower timeframe (e.g., 1-minute or 5-minute chart).
Key Features
Visual Backtesting Optimized: By keeping the ORB box visible for a set duration on past sessions, you can easily scroll back through history to analyze win/loss rates and price behavior at a glance.
Multi-Timeframe Support: Define the ORB candle on any timeframe (e.g., 15m) and view it seamlessly on lower timeframes.
Custom Session Duration: The ORB box does not clutter the chart indefinitely. It stays visible for a specific duration (default: 390 minutes/full session) and then stops, keeping your chart clean.
Precise Timing: Users can set the exact Start Hour and Start Minute to match any market open (e.g., NYSE, London, or crypto sessions).
Weekend Filter: The indicator automatically skips Saturdays and Sundays to prevent invalid drawings during weekend gaps.
Settings & Configuration
1. ORB Settings
ORB Timeframe: Select the resolution used to calculate the Opening Range (e.g., "15" for a 15-minute ORB).
Start Hour (0-23) & Minute (0-59): The exact time the market session begins (e.g., 09:30).
Box Duration (Minutes): How long the box should extend to the right. The default is 390 minutes (6.5 hours), covering a standard trading session.
2. Visual Settings
Box Background Color: Sets the fill color and transparency of the ORB zone.
Border Color / Width: Customizes the outline of the box.
Show Price Labels: Toggles the visibility of price labels extending from the High and Low of the range.
How to Use for Strategy Building
Set the ORB Timeframe (e.g., 15 min).
Scroll back to previous days on your chart.
Observe whether the price respected the range, faked out, or broke out cleanly.
Use this visual data to determine the most profitable breakout rules for your specific asset.
Note: This Pine Script code and the description text above were generated with the assistance of Artificial Intelligence. Indicatore

Axis-Pro System | Trend Structure + Fibonacci Pullbacks Axis-Pro System is a comprehensive Trend Following strategy designed to trade high-probability pullbacks. Unlike indicators that merely chase price, this system patiently waits for market structure alignment before seeking an entry.
The system is built on the premise of "Quality over Quantity", utilizing volatility and structure filters to avoid choppy markets (ranges) and false breakouts.
🧠 Strategy Logic
The system makes decisions based on a strict 4-step hierarchy:
Higher Timeframe (HTF) Bias:
Analyzes the trend on a higher timeframe to ensure we are trading in the direction of the dominant flow.
Structure & BOS (Break of Structure):
Identifies clear impulses that break previous highs or lows. Once a BOS is confirmed, the system "arms" the trade and waits.
Fibonacci Zone Pullback:
It does not chase the breakout. Instead, it waits for a pullback into the "Discount Zone" (Golden Zone, configurable between 0.382 and 0.618) to improve the Risk/Reward ratio.
Validation & Trigger:
Uses an ATR expansion check to filter out low-volatility periods.
Requires candle confirmation and alignment with fast EMAs before pulling the trigger.
🛡️ Risk Management
The system incorporates advanced position management using a split execution model (50/50):
Dynamic Stop Loss: Automatically calculated using an ATR multiplier or the recent Swing High/Low (whichever offers better protection).
TP1 (Take Profit 1): Closes 50% of the position at a fixed R-multiple (e.g., 1.5R) to lock in profit and moves the Stop Loss to Break-Even.
TP2 (Runner): The remaining 50% is left to run for higher targets (e.g., 3.0R) or until the trend bends, maximizing gains during strong moves.
Trailing Stop: Optional feature to trail price with a fast EMA once the first target is hit.
⚙️ Settings & Features
The script is highly customizable for different assets (Crypto, Forex, Indices):
Date Range Filter: Includes a date selector to perform precise Backtesting on specific periods (e.g., testing specifically during a Bear Market vs. Bull Market).
Auto Trendlines: Automatically draws relevant trendlines for visual support.
Quality Filters: Options to toggle the EMA 200 filter and breakout buffers.
⚠️ Disclaimer
This strategy is a tool for analysis and backtesting purposes. Past performance does not guarantee future results. It is highly recommended to test the strategy on a Demo account first and adjust parameters according to the volatility of the specific asset being traded. Always use responsible risk management. Strategia

Golden BOS Strategy - ChecklistA clean, mechanical on-chart checklist designed for multi-timeframe traders using the Golden BOS / Institutional Retracement Framework.
This tool helps you stay disciplined by tracking each requirement of the strategy in real time:
Included Criteria
4H Bias: Bullish or bearish macro structure
1H Structure: Push/pull phase + golden zone retracement
5M Entry Model:
Break of Structure (BOS)
5M golden zone retracement
POI validation (OB/FVG/Breaker)
Final micro BOS or rejection confirmation
Risk Filters:
Session validity (London / NY)
Red news avoidance
Stop-loss placement check
Liquidity-based target confirmation
Purpose
This overlay ensures every trade meets strict criteria before execution, removing emotion and improvisation. Ideal for backtesting, forward testing, and staying consistent during live market conditions.
Golden BOS Strategy — Description
The Golden BOS Strategy is a structured, multi-timeframe trading system designed to capture high-probability continuation moves during London and New York sessions. The strategy combines institutional concepts with Fibonacci-based retracements to identify discounted entry zones aligned with higher-timeframe direction.
Using the 4H timeframe, traders establish the daily macro bias and identify the dominant trend. The 1H chart is then used to confirm the current phase of market structure, distinguishing between impulsive “push” moves and corrective “pullback” phases. A Fibonacci retracement is applied to the most recent 1H impulse leg to define a high-value discount or premium zone where entries become valid.
Execution takes place on the 5-minute chart. Once price reaches the 1H golden zone (61.8–78.6%), a Break of Structure (BOS) is required to confirm a shift in short-term momentum. A second Fibonacci retracement is then drawn on the 5M impulse leg that caused the BOS, and price must retrace back into the 5M golden zone. Traders refine their entry using a confluence point of interest (POI) such as a Fair Value Gap (FVG), Order Block, Breaker Block, or Inverse FVG, ideally accompanied by a final micro BOS or rejection candle.
Risk management is strict and rule-driven. Stop loss is placed beyond the extreme wick of the POI, while take-profit targets are set at logical liquidity pools in the direction of the higher-timeframe trend. The strategy avoids red-folder news and only allows trades during active sessions to ensure optimal volatility and reliability.
The Golden BOS Strategy is designed to impose discipline, reduce discretionary errors, and give traders a repeatable, mechanical framework for navigating trending markets with precision. Indicatore
