Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I see a few issues with your code, first you are setting Avg data series twice, is there a logic to this madness? or a reason to not use two data series?
With the same data series, you are double smoothing itself, then the signal is smoothed again with an EMA. Also, you need to handle the smoothing at the beginning of the chart i.e. bar = 0, how do you handle the smoothing with no data before it. Consider parameterizing the other soothing variables for future use cases instead of hard coding the lookback.
Also, the reason why it bugs out on longer charts is the chart look back, if you are not calculating the indicator far enough back the code has no way to deal with this manipulating the data series, without two separate data series.
I don't currently have the time to just fix your code, but maybe this is a good start for you to debug the issue. Maybe someone else can take my advice and solution and fix the code. in short, make more data series to handle all the smoothing, and add logic to handed bar 0 through bar x (all the forward smoothing periods period + 4+ 9).
Cheers,
Sody
"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
The problem was the zero division, now it is working.
Mea culpa for not writing code poetry for prototyping.
I just wanted to try super smoothing the RVI.
In general, this was not meant for public or general purposes (Which you are right hard coding periods
are not useful).
Does it make sense to use that indicator? Well, I attached it in case someone finds it useful ...