Pseudo Random Number Generator

636 0
This is my first attempt at a psuedo-random number generator in Pine. It is, as you can see, a failed attempt thus far. I began by trying to implement the random color generator as described here: https://www.tradingcode.net/tradingview/colours/random-colours/ in version 3 Pine (Not sure which version he was using). As you can see, the color isn't random.

The end goal here is to be able to get pseudo-random numbers for use in algorithms that require them, of which there are a significant few. Perhaps numbers aren't required so long as I can map colors to other data. We'll see. This is a work-in-progress and I encourage anyone who can help to do so. Algorithmically, the importance of being able to use random data can't be overstated.
Jul 10
Release Notes: switched x to outside the function as in the example this is derived from.
Jul 13
Release Notes: It now works!!! It was actually a simple fix. A huge thanks to Julia P. from TradingView Support. Now the real magic begins.
Remove from Favorite Scripts Add to Favorite Scripts
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out