OPEN-SOURCE SCRIPT
Random Candles

**What if the patterns you see in the market aren't as meaningful as you think?**
This indicator generates a completely random price series, tick by tick, and displays it as candles.
There is no market data being used to determine the direction of the next tick. There is no trend-following logic, no support/resistance calculation, no order flow, no indicators, and no hidden trading strategy deciding where price should go.
**The price is random.**
And yet, look at the chart.
You will often see things that look surprisingly familiar:
* Trends
* Support and resistance
* Breakouts
* Pullbacks
* Consolidation
* Higher highs and higher lows
* Lower highs and lower lows
* Reversals
* Channels
* Double tops and bottoms
* Candle patterns
* "Strong" moves followed by retracements
You can even draw trendlines and horizontal levels on a completely random chart and find that price appears to respect them.
That is the point of this experiment.
---
## Why does this matter?
As traders, we are extremely good at finding patterns in noisy data.
Give us a chart and our brains will naturally try to explain what happened:
*"Price rejected resistance."*
*"The trend is clearly bullish."*
*"This was a liquidity sweep."*
*"The breakout failed."*
*"The market is accumulating."*
*"The reversal was confirmed by the structure."*
But if a visually convincing version of these events can emerge from a process that contains **no market information whatsoever**, we should at least question how much information our eyes are actually extracting from a chart.
This doesn't prove that markets are completely random.
It does, however, demonstrate something important:
> **A pattern looking meaningful does not necessarily mean that the pattern contains predictive information.**
---
## Try it yourself
Instead of taking my word for it, put the indicator on a chart and watch it.
Change the **Resolution** input to increase the number of simulated ticks.
Then start looking for setups.
Draw your support and resistance levels.
Find your favorite candlestick patterns.
Look for trends.
Pretend you don't know that the candles are random.
You may find yourself doing exactly what you normally do on a real market.
That's the experiment.
---
## What this indicator is — and isn't
This is **not** a realistic market simulator.
It does not attempt to reproduce volatility distributions, correlations, order-book dynamics, news reactions, market microstructure, or other properties of real financial markets.
It is intentionally much simpler:
**Start from the previous close → randomly move up or down by one tick → repeat.**
The purpose is not to recreate the market.
The purpose is to create a visually convincing random price path and see how much structure our brains can find inside it.
---
## The uncomfortable question
If a completely random process can produce charts that look remarkably similar to real markets, how much of what we call a "setup" is actually predictive information...
...and how much is simply our brain finding structure in noise?
Maybe your strategy works.
Maybe there is a genuine edge.
Or maybe you have discovered a beautiful explanation for something that was going to happen anyway.
**Don't take this indicator as proof that trading strategies are useless.**
Use it as a reason to demand stronger evidence.
Backtest.
Out-of-sample test.
Forward test.
Test across different markets and regimes.
And most importantly, ask yourself:
**Does my strategy actually predict the future, or does it simply explain the past?**
---
*This indicator is an experiment in randomness, pattern recognition, and the limits of visual interpretation. If it makes you question your own chart analysis, then it has done its job.*
This indicator generates a completely random price series, tick by tick, and displays it as candles.
There is no market data being used to determine the direction of the next tick. There is no trend-following logic, no support/resistance calculation, no order flow, no indicators, and no hidden trading strategy deciding where price should go.
**The price is random.**
And yet, look at the chart.
You will often see things that look surprisingly familiar:
* Trends
* Support and resistance
* Breakouts
* Pullbacks
* Consolidation
* Higher highs and higher lows
* Lower highs and lower lows
* Reversals
* Channels
* Double tops and bottoms
* Candle patterns
* "Strong" moves followed by retracements
You can even draw trendlines and horizontal levels on a completely random chart and find that price appears to respect them.
That is the point of this experiment.
---
## Why does this matter?
As traders, we are extremely good at finding patterns in noisy data.
Give us a chart and our brains will naturally try to explain what happened:
*"Price rejected resistance."*
*"The trend is clearly bullish."*
*"This was a liquidity sweep."*
*"The breakout failed."*
*"The market is accumulating."*
*"The reversal was confirmed by the structure."*
But if a visually convincing version of these events can emerge from a process that contains **no market information whatsoever**, we should at least question how much information our eyes are actually extracting from a chart.
This doesn't prove that markets are completely random.
It does, however, demonstrate something important:
> **A pattern looking meaningful does not necessarily mean that the pattern contains predictive information.**
---
## Try it yourself
Instead of taking my word for it, put the indicator on a chart and watch it.
Change the **Resolution** input to increase the number of simulated ticks.
Then start looking for setups.
Draw your support and resistance levels.
Find your favorite candlestick patterns.
Look for trends.
Pretend you don't know that the candles are random.
You may find yourself doing exactly what you normally do on a real market.
That's the experiment.
---
## What this indicator is — and isn't
This is **not** a realistic market simulator.
It does not attempt to reproduce volatility distributions, correlations, order-book dynamics, news reactions, market microstructure, or other properties of real financial markets.
It is intentionally much simpler:
**Start from the previous close → randomly move up or down by one tick → repeat.**
The purpose is not to recreate the market.
The purpose is to create a visually convincing random price path and see how much structure our brains can find inside it.
---
## The uncomfortable question
If a completely random process can produce charts that look remarkably similar to real markets, how much of what we call a "setup" is actually predictive information...
...and how much is simply our brain finding structure in noise?
Maybe your strategy works.
Maybe there is a genuine edge.
Or maybe you have discovered a beautiful explanation for something that was going to happen anyway.
**Don't take this indicator as proof that trading strategies are useless.**
Use it as a reason to demand stronger evidence.
Backtest.
Out-of-sample test.
Forward test.
Test across different markets and regimes.
And most importantly, ask yourself:
**Does my strategy actually predict the future, or does it simply explain the past?**
---
*This indicator is an experiment in randomness, pattern recognition, and the limits of visual interpretation. If it makes you question your own chart analysis, then it has done its job.*
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.