TradingView
RicardoSantos
Apr 10, 2021 9:59 AM

Function - simple* Markov Chain Monte Carlo Simulation (MCMC) 

US Nas 100OANDA

Description

Example function of a markov chain monte carlo simulation.
Comments
Noldo
Hi Sir , im the one of admirer of your old Markov Chain script. Thanks for your effort on that script.I have a little question :
Noldo
@Noldo, If we change line 43 and line 44 ( i_iterations and i_start ) can we do more short therm predictions ?
For example : For 1H TF : i_iterations = 100 * 24 * 20 (Converting 1M to 1H timeframe ) and i _start = 500 * 24 * 20
Best regards.
RicardoSantos
@Noldo, the i_start value would be something like price value the simulation starts at, iterations is the number of steps in the simulation, for running multiple simulations you would need to run the function inside a extra loop with the number of simulations, running that high number of simulations might not be feasible with pinescript.
Noldo
@RicardoSantos, "if bar_index < i_iterations
output := array.get(M, bar_index)"
I tried to comply with this command and blocked the na value at low timeframes.
PineCoders
LonesomeTheBlue
PineCoders
This publication is now featured in our Editors' Picks: tradingview.com/scripts/editors-picks/ .
In the name of all TradingViewers, thank you for your valuable contribution to the community, and congrats!
Swamp_Trader
Looks like a rate of change of your VPN signal might be useful. Using only VPN on trigger levels is to late, it is more of a trailing indicator then a useful leading indicator to trigger an entry/exit.
bappykhalidhasan0
nice analysis
More