gb50k

Random Walk Generator PRNG


/////////////////////////////////////////////////////////////////////////////
//
// Generates a random walk driven by a pseudo RNG that generates *returns* that are
// uniformly distributed between your upper and lower bound.
// Please drop me a note if you use the code in original or modified form.
// Inspiration and support from 4X4good .... check out his scripts
//
// Specs:
// Implementation of LCG, using "Numerical Recipes" parameter set (m,a,c)
// as described in wiki article (09/2018):
// en.wikipedia.org/wik...ngruential_generator
//
// The "Skew" parameter raises the random return to the specified power
//
// Disclaimer:
// The PRNG is provided "as-is" and this specific implementation has not undergone
// any testing. Use at your own risk.
//
/////////////////////////////////////////////////////////////////////////////
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?