Random Price Action Visible Chartplots randomly generated price (closing basis) from LHS of the chart. Re-plots each time you scroll
-just a curiosity really; perhaps a lesson in seeing patterns where there are none; 'fooled by randomness' etc.
-always anchors/starts from the real close of the asset on the visible Left hand side of the chart.
-adjust ATR as you like (bigger = probably more reliable/realistic).
-adjust ATRmultiple as you like (discretionary; basically how many ATR ranges above/below last bar's random close, will the maximum random value above/below be; default is 1.5x (arbitrary).
Randomness
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?
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!
Random Walk SimulationUnderstanding the Random Walk Simulation
This indicator randomly generates alternative price outcomes derived from the price movements of the underlying security. Monte Carlo methods rely on repeated random sampling to create a data set that has the same characteristics as the sample source, representing examples of alternate outcomes. The data set created using random sampling is called a “random walk”.
First, every bar in the time stamp is measured and put into a logarithmic population. Then, a sample is drawn at random from the population and is used to determine the next price movement of the random walk. This process is repeated fifteen times to visualise whether the alternative outcomes lie above or beneath the current market price of the security.
Random Walk Utility
The random walk generator allows users of the Monte Carlo to further understand how the Monte Carlo projection is generated by creating a visual representation of individual random walks. Trends that occur on the random walks may correlate to the historical price action of the underlying security.
You can find the Monte Carlo Simulator here:
Input Values
Select the “ Format ”, button located next to the indicator label to adjust the input values and the style.
The Random Walk indicator only has one user-defined input value that can be changed.
The Random_Variable randomises a set of random walks. If this variable is changed, it will run a fresh set of 15 random walks which will result in a slightly different outcome.
Adding the indicator to your chart multiple times using many different random variables will allow you to achieve a more accurate reading. Ideally, the Monte Carlo Simulator takes an average of these to be interpreted.
For more information on this indicator, the full PDF can be found here: www.kenzing.com