LonesomeTheBlue

Monte Carlo Simulation - Random Walk

LonesomeTheBlue Wizard 업데이트됨   
Hello All,


Monte Carlo Simulation is a model used to predict the probability of different outcomes when the intervention of random variables is present. it is used by professionals in such widely disparate fields as finance, project management etc. You can find many articles about Monte Carlo Simulation on the net.

In this script I tried to make Monte Carlo Simulation and "Random Walk". it calculates results over and over, each time using a different set of random values that is created using historical data (500 times by default) and show min-max and some random paths. number of "random walks" is calculated by using number of bars to predict, so if you change "Number of Bars to Predict" then number of random walks may change. Total number of the lines must be less than 500.

"Number of Simulations" is 500 by default, more simulation better results. but if you increase it a lot then you may get "loop takes too long error"
"Number of Bars to Predict"
can be between 10-100
"Number of Bars to use as Data Source" is the number of historical bars to use in simulations

Thanks to Ricardo Santos (@RicardoSantos) for letting me use his Random Number Generator Function.

P.S. I am not mathematician and I tried to make it as far as I understood the method. so if you see any issue let me know please.

Some examples:

Number of Bars to Predict = 100:

Number of Bars to Predict = 10:

if you enable "Keep Past Min-Max Levels" option then min-max levels will stay on the chart


Enjoy!
릴리즈 노트:
Added color option for Random Walk
릴리즈 노트:
updated

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?