Random Entry BenchmarkCan Your Strategy Beat Random Entries?
Most traders spend countless hours searching for the perfect entry signal. But what if random entries could achieve similar results?
Random Entry Benchmark is designed to put your strategy's edge to the test. Instead of relying on indicators, patterns, or market predictions, it generates completely random long-only entries and manages trades using realistic risk controls, including stop losses, risk-reward targets, and position sizing.
In strong markets, even random entries can produce surprisingly respectable returns. A profitable backtest alone does not prove that a strategy has a genuine edge. By running multiple independent simulations and analyzing the distribution of outcomes, this indicator establishes a statistical benchmark for what can be achieved without any predictive entry logic.
If your strategy cannot consistently outperform randomness, does it really have an edge?
The simulator reports key metrics including net return, win rate, average trade return, maximum drawdown, and percentile outcomes, helping separate skill from luck.
Key Features
1. Multiple Simulations Instead of a Single Test
A single random backtest tells very little because luck plays a large role. The simulator performs multiple independent random-entry runs and aggregates the results, providing a Monte Carlo-style view of potential outcomes.
Review key performance metrics across all simulations:
- Net Return
- Win Rate
- Average Trade Return
- Maximum Drawdown
2. Percentile-Based Results
Understand the full distribution of outcomes rather than relying on averages alone.
Typical statistics include:
- 25th Percentile
- Median (50th Percentile)
- 75th Percentile
This helps distinguish normal outcomes from exceptionally lucky or unlucky runs.
3. Realistic Trading Rules
The simulator incorporates common risk management techniques used in actual trading:
- Configurable Stop Loss
- Configurable Risk-Reward Ratio
- Risk-Based Position Sizing
This creates a more realistic benchmark for swing trading and day trading strategies.
How to Use
1. Configure stop-loss and risk-reward settings that closely match your own strategy.
2. Run the simulation and review the statistical results.
3. Compare your strategy's performance against the random-entry benchmark.
4. Determine whether your entry methodology produces results that are meaningfully better than chance.
Note: The simulator currently generates long-only entries, and only one position can be open at a time. The strategy compounds returns by sizing positions based on current account equity (initial capital plus net profit/loss), while limiting risk on each trade according to the Max Risk % setting.
Important!
This indicator does not generate trading signals and is not intended as a trading strategy.
Its purpose is to provide a statistical benchmark against which traders can evaluate the effectiveness of their own entry techniques.
Input Parameters
Execution Period
Start Year / Month – Beginning of the simulation period.
End Year / Month – End of the simulation period.
Only for intraday timeframes:
Trading Hours – Time window during which random entries can be generated.
Time Zone – Timezone used for the trading session.
Close @ COB – Forces all open positions to be closed at the end of the regular trading session.
Strategy Parameters
Initial Capital – Starting account balance used for the simulation.
Max Risk % – Maximum percentage of account equity risked per trade.
STP Type – Method used to calculate stop-loss distance (e.g., ATR-based or fixed % change).
Parameter (M) – Value used by the selected stop-loss method.
ATR: Stop Loss = Entry Candle Low − M × ATR(14)
Change %: Stop Loss = Entry Price × (1 − M/100)
PL Ratio – Profit target expressed as a multiple of the stop-loss distance (Risk/Reward ratio).
Max Bars – Maximum number of bars a trade can remain open before being closed.
Simulation Parameters
Random Seed – Controls the random number sequence used for the first simulation run. Using the same seed reproduces identical results.
Entry Frequency – Average number of random trade entries generated during the simulation period.
Runs # – Number of independent simulation runs. Higher values produce more statistically reliable results.
Low-High % – Lower and upper percentiles displayed in the results. Median values are always shown.
Visuals
Dashboard Position and Size – Position and text size of the results output.
Plot – Selects the performance metric to visualize (Equity, Net Profit, Win Rate, etc.). Trade markers are displayed only for the first simulation run.
Output Results
Total Trades – Number of trades executed during the simulation.
Net Return – Total percentage return generated over the simulation period (Net Profit / Initial Capital).
Win Rate – Percentage of profitable trades.
Avg Return – Average percentage net return per trade.
Max Drawdown – Largest peak-to-trough decline in account equity during the simulation.
Percentiles (25%, 50%, 75%) – Results are reported across all simulation runs:
- 25% – Conservative outcome (75% of runs performed better)
- 50% – Median outcome
- 75% – Favorable outcome (25% of runs performed better)
Known Issues
1. PulseWire Execution Limits
Due to PulseWire's script execution time limits, the indicator may occasionally fail to complete all simulations, especially when using a long execution period and/or a large number of simulation runs.
In most cases, reducing the amount of historical data or the number of runs will resolve the issue.
2. Intraday Close at COB
On some symbols and timeframes, PulseWire does not always allow reliable identification of the final bar of the regular trading session. As a result, positions configured to close at the end of the session may occasionally remain open beyond the intended close and be exited on a later bar.
Indicator

Permutation Entropy Complexity OscillatorPermutation Entropy — Complexity Oscillator
What this script does
This is a complexity oscillator: it measures, on a 0–1 scale, how random versus structured recent price action is — not which direction price is going, but whether there is any exploitable order to go on. It reads the order of successive moves (not their size): every three consecutive prices form one of six up/down shapes ("ordinal patterns"), and the oscillator measures how evenly those shapes are spread over a rolling window. Near 1, all shapes are equally likely — the tape is effectively random. Near 0, a few shapes dominate — the tape is structured and, in principle, more predictable.
Why these components are combined (mashup justification)
This is not several indicators shown side by side. There is exactly one plotted value — the normalized ordinal-pattern entropy — and every other element is a decision-support layer built on that single value:
The entropy engine is the core. Conventional price-level oscillators tell you where price is in its range; none of them tell you whether the range is even worth trading. Ordinal-pattern entropy is amplitude-free and noise-robust, so it isolates one orthogonal question — is there structure right now? — that the price-level family cannot answer.
The predictable / random thresholds classify the reading into a regime (structured / mixed / random). They don't add a second indicator; they interpret the one oscillator.
The statistical-complexity measure (complexity–entropy plane) is computed from the same ordinal-pattern counts and answers the question entropy cannot: low entropy alone can be genuinely structured or trivially degenerate (near-periodic). Pairing entropy with complexity separates "richly structured and potentially exploitable" from "low-entropy but trivial," so a signal only treats the tape as structured when both agree.
The momentum sign does nothing on its own — it only sets the direction of an already-armed regime signal. The bet is "a structured tape tends to keep doing what it's doing"; momentum just says which way that is.
The calibration harness is the reason the rest is trustworthy. It logs every signal the oscillator arms and, a fixed horizon later, checks whether price actually extended ≥ k×ATR in that direction — then reports Hit %, the unconditional Base %, and the Edge (Hit − Base).
Every part answers one question about the same entropy reading, which is why they belong in one script rather than as separate studies.
What makes it original
Two things. First, it brings an information-theoretic structure measure — usually seen only in research, not on charts — into a live, bounded oscillator with regime bands and a clean visual. Second, and more importantly, it does not assume the common claim that "low entropy means predictable, tradeable price." It tests that claim, live, on your instrument, with the built-in calibration harness. If low-entropy signals don't actually precede a forward move on your symbol and timeframe, the Edge row shows it plainly — often at or below zero. That honesty layer, not the entropy calculation alone, is the contribution.
How to use it
Add to a chart. Defaults target intraday index futures (e.g. NSE NIFTY); for other markets simply change the chart, or set the Price source input (group 01) — you can even feed it another indicator's output.
Read the regime at a glance from the background tint: green = genuine structure (low entropy and high complexity → the actionable state), amber = low-complexity / trivial low entropy (caution), grey = random / efficient tape (stand aside), no tint = mixed (wait). The line carries the same colour, with a bright line confirming genuine structure; the dashboard "Tape (plane)" chip shows the same state in words.
Optionally enable the statistical-complexity overlay (group 05) to see the complexity–entropy plane directly: it peaks at intermediate entropy where structure is richest and falls toward zero for both pure noise and trivial tapes. The dashboard shows the live complexity value and a ● when it clears the genuine-structure threshold.
Tie-robustness and delay τ (group 02): on discrete / tick-quantised instruments (index futures, where equal consecutive prints are common) equal values bias ordinal-pattern entropy toward false structure. The tie-robust dither (on by default) and an optional delay τ > 1 mitigate this; τ also probes a coarser timescale. Set τ = 1 and tie-robust off to reproduce the plain estimator.
Triangles mark the moment a predictable regime starts, with direction set by recent momentum — points to investigate, not automatic entries. With the complexity gate on (default), a signal only arms when complexity also confirms genuine structure; turn it off to A/B that choice against the entropy-only signal in the Edge row.
Read the Edge row before trusting the signal. A positive Edge means structured starts preceded a forward move more often than chance here; near or below zero means low entropy is not buying you predictability on this instrument.
Window length, smoothing, embedding delay, the two entropy thresholds, the complexity threshold, the momentum length, and the calibration horizon / threshold are all configurable.
Limitations
Entropy describes the tape's structure, not its direction — low entropy can precede a clean trend or a clean oscillation. The momentum-direction bet is one testable interpretation, not a law; the calibration row is there precisely so you don't take it on faith.
Statistics are in-sample, close-to-close, without costs — a study aid, not a backtest.
The reading needs a full window before it is meaningful (the panel shows "warm" until then).
This is an analytical complexity study. It issues no automated buy/sell instructions and is not a strategy.
Concept credit
Permutation entropy / ordinal-pattern analysis — Christoph Bandt and Bernd Pompe (2002).
Information entropy — Claude E. Shannon (1948).
Statistical complexity (the complexity–entropy plane) — the MPR statistical-complexity measure of P. W. Lamberti, M. T. Martín, A. Plastino and O. A. Rosso, applied to markets via the complexity–entropy causality plane of L. Zunino, M. Zanin, B. M. Tabak, D. G. Pérez and O. A. Rosso (2010).
Tie / equal-value bias in ordinal patterns — informed by the work of D. Cuesta-Frau and colleagues (2018).
The implementation, the regime/threshold logic, the complexity gate, the tie-robust dither, the calibration harness and the packaging are original.
Disclaimer
For research and educational purposes only. This script is not financial advice, not a recommendation, and not a guarantee of future results. Indicators describe price behaviour; they do not predict the future. Trading carries risk of loss. Test on out-of-sample data and make your own decisions. The author accepts no liability for any use of this script. Indicator

Indicator

Random Entries Work!" tHe MaRkEtS aRe RaNdOm ", say moron academics.
The purpose of this study is to show that most markets are NOT random! Most markets show a clear bias where we can make such easy money, that a random number generator can do it.
=== HOW THE INDICATOR WORKS ===
The study will randomly enter the market
The study will randomly exit the market if in a trade
You can choose a Long Only, Short Only, or Bidirectional strategy
=== DEFAULT VALUES AND THEIR LOGIC ===
Percent Chance to Enter Per Bar: 10%
Percent Chance to Exit Per Bar: 3%
Direction: Long Only
Commission: 0
Each bar has a 10% chance to enter the market. Each bar has a 3% to exit the market . It will only enter long.
I included zero commission for simplification. It's a good exercise to include a commission/slippage to see just how much trading fees take from you.
=== TIPS ===
Increasing "Percent Chance to Exit" will shorten the time in a trade. You can see the "Avg # Bars In Trade" go down as you increase. If "Percent Chance to Exit" is too high, the study won't be in the market long enough to catch any movement, possibly exiting on the same bar most of the time.
If you're getting the red screen, that means the strategy lost so much money it went broke. Try reducing the percent equity on the Properties tab.
Switch the start year to avoid/minimize black swan events like the covid drop in 2020.
=== FINDINGS ===
Most markets lose money with a "Random" direction strategy.
Most markets lose ALL money with a "Short Only" strategy.
Most markets make money with a "Long Only" strategy.
Try this strategy on: Bitcoin (BTCUSD) and the NASDAQ (QQQ).
There are two popular memes right now: "Bitcoin to the moon" and "Stocks only go up". Both are seemingly true. Bitcoin was the best performing asset of the 2010's, gaining several billion percent in gains. The stock market is on a 100 year long uptrend. Why? BECAUSE FIAT CURRENCIES ALWAYS GO DOWN! This is inflation. If we measure the market in terms of others assets instead of fiat, the Long Only strategy doesn't work anymore (or works less well).
Try this strategy on: Bitcoin/GLD (BTCUSD/GLD), the Eurodollar (EURUSD), and the S&P 500 measured in gold (SPY/GLD).
Bitcoin measured in gold (BTCUSD/GLD) still works with a Long Only strategy because Bitcoin increased in value over both USD and gold.
The Eurodollar (EURUSD) generally loses money no matter what, especially if you add any commission. This makes sense as they are both fiat currencies with similar inflation schedules.
Gold and the S&P 500 have gained roughly the same amount since ~2000. Some years will show better results for a long strategy, while others will favor a short strategy. Now look at just SPY or GLD (which are both measured in USD by default!) and you'll see the same trend again: a Long Only strategy crushes even when entering and exiting randomly.
=== " JUST TELL ME WHAT TO DO, YOU NERD! " ===
Bulls always win and Bears always lose because fiat currencies go to zero.
You're not underperforming a random number generator, are you? Strategy

Pseudo-Random Number Generators via Pine ScriptThese are my "Pseudo-Random Number Generators via Pine Script", having uniform distribution between 0 and 1. In my quest for sequential pseudo-random numbers in Pine, tinkering with mathematical chaos, I have come up with these three simple yet handy generators. I believe these may be useful in the future by developers of the Tradingview community.
NOTICE: Use it as you please, this is free code to implement into your new Pine projects. You don't have to ask for my permission to reuse these functions in your published scripts, simply because I have better things to do than answer requests for the reuse of these simplistic PRNG functions. I don't require accreditation for members to reuse these functions either. I simply don't want any credit. I only require that you respectfully put it to "good and proper use" complimenting the elaborate script you have in mind. I would however like to see some great ideas utilizing these when I randomly and accidentally come across them in the public library. I didn't know where to put this script, so I just tossed it into the "Trend Analysis" category.
The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone! Indicator
