NexusFi: Find Your Edge


Home Menu

 





Error on indicator: CalculateMinMax - the calculation results in unrenderable values


Discussion in NinjaTrader

Updated
    1. trending_up 1,472 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 4 attachments




 
Search this Thread

Error on indicator: CalculateMinMax - the calculation results in unrenderable values

  #1 (permalink)
 fernlicht 
Schwyz, Switzerland
 
Experience: None
Platform: NinjaTrader, Visual Studi
Broker: IB, Biftinex, Binance
Trading: Yes
Posts: 59 since Jan 2012
Thanks Given: 7
Thanks Received: 33

Hello all,

I've programmed a derivate of an RVI avg indicator. It works on many instruments
like EURUSD (60min) but on some, it doesn't and throws an error.

Indicator 'RVIA': Error on calling 'CalculateMinMax' method on bar 7088: The calculation results in unrenderable values.

When I print out the indicator avg value it says NAN (not a number) when it breaks down.

Somehow, I'm missing something but can't get it right.

Could someone help me with that and have a look at the source code?
Please find the .cs attached


PS the error happens when I +1year or more data is loaded into the chart or into the strategy analyser.


Thanks!

Attached Files
Elite Membership required to download: RVIA.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
About a successful futures trader who didnt know anythin …
Psychology and Money Management
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
 
  #2 (permalink)
 fernlicht 
Schwyz, Switzerland
 
Experience: None
Platform: NinjaTrader, Visual Studi
Broker: IB, Biftinex, Binance
Trading: Yes
Posts: 59 since Jan 2012
Thanks Given: 7
Thanks Received: 33

Ok, please forget it. I made an rookie mistake and did not check a zero division, which caused that error...

Started this thread Reply With Quote
Thanked by:
  #3 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085



fernlicht View Post
Hello all,

I've programmed a derivate of an RVI avg indicator. It works on many instruments
like EURUSD (60min) but on some, it doesn't and throws an error.

Indicator 'RVIA': Error on calling 'CalculateMinMax' method on bar 7088: The calculation results in unrenderable values.

When I print out the indicator avg value it says NAN (not a number) when it breaks down.

Somehow, I'm missing something but can't get it right.

Could someone help me with that and have a look at the source code?
Please find the .cs attached


PS the error happens when I +1year or more data is loaded into the chart or into the strategy analyser.


Thanks!

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?

 
Code
Avg[0] = (Close[0] - Open[0]) / (High[0] - Low[0]) ;
Avg[0] = SMA(SMA(Avg,Period),4)[0];
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."
Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 fernlicht 
Schwyz, Switzerland
 
Experience: None
Platform: NinjaTrader, Visual Studi
Broker: IB, Biftinex, Binance
Trading: Yes
Posts: 59 since Jan 2012
Thanks Given: 7
Thanks Received: 33

Thanks for your input Sody,

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 ...


RVIA smoothed



All the best

Attached Files
Elite Membership required to download: RVIA.cs
Elite Membership required to download: Riva.zip
Started this thread Reply With Quote




Last Updated on May 4, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts