Hello!
This script "Monte Carlo (Polyline Traceback) [Kioseff Trading]" performs a Monte Carlo simulation using polylines!
By using polylines, and tracing back the initial simulation to its origin point, we can better replicate the ideal output of a Monte Carlo simulation!
Such as:

The image above shows the output of a simulation (image sourced outside TV).
With this script, and polyline capabilities, we can come quite close on TradingView.

The image above shows the indicator in action! Not bad considering the ideal output.
Of course, the script is quite heavy and tries its best to circumvent limitations :D
You might run into load time errors, in which case you might try applying the built-in setting "Force Script Load". This setting will cut-off the visuals for some simulations, but has a higher chance of passing load-time limitations!

As shown in the image above, you can select to only show worst-case and best-case simulations. Using this option will reduce chart lag and improve load times.
Features
Thank you!
This script "Monte Carlo (Polyline Traceback) [Kioseff Trading]" performs a Monte Carlo simulation using polylines!
By using polylines, and tracing back the initial simulation to its origin point, we can better replicate the ideal output of a Monte Carlo simulation!
Such as:
The image above shows the output of a simulation (image sourced outside TV).
With this script, and polyline capabilities, we can come quite close on TradingView.
The image above shows the indicator in action! Not bad considering the ideal output.
Of course, the script is quite heavy and tries its best to circumvent limitations :D
You might run into load time errors, in which case you might try applying the built-in setting "Force Script Load". This setting will cut-off the visuals for some simulations, but has a higher chance of passing load-time limitations!
As shown in the image above, you can select to only show worst-case and best-case simulations. Using this option will reduce chart lag and improve load times.
Features
- Monte Carlo Simulation: Performs Monte Carlo simulation to generate multiple future paths.
- Asset Price: Can simulate future asset prices based on historical log returns.
- Statistical Methods: Offers two simulation methods—Gaussian (Normal) distribution and Bootstrapping.
- Adjustable Parameters: Offers numerous user-adjustable settings like number of simulations, forecast length, and more.
- Historical Data Points: Option to specify the amount of historical data to be used in the simulation (price).
- Best/Worst Case: Allows you to show only the best case / worst case outcome (range) for all simulations!
Thank you!
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
•Access to Next-Gen Optimization Tools: tradingiq.io
•Discord Server: discord.gg/aKWPuM4HPy
•Discord Server: discord.gg/aKWPuM4HPy
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
•Access to Next-Gen Optimization Tools: tradingiq.io
•Discord Server: discord.gg/aKWPuM4HPy
•Discord Server: discord.gg/aKWPuM4HPy
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.