Error on calculating min/max value - please check GetMinMaxValue method - NinjaTrader Programming | futures io social day trading
futures io futures trading


Error on calculating min/max value - please check GetMinMaxValue method
Updated: Views / Replies:1,663 / 8
Created: by Big Mike Attachments:4

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Error on calculating min/max value - please check GetMinMaxValue method

  #1 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

Error on calculating min/max value - please check GetMinMaxValue method

Error on calculating indicator min/max value for indicator 'RSI'. Please check the 'GetMinMaxValues' method: Index was outside the bounds of the array.

Attached is the indicator.

By default there is no 'symbol1' .. 'symbol10' (blank string). The error only occurs when using RSI and selecting this indicator as the input series. If you plot the indicator by itself (no RSI) it works fine.

The error also only occurs when symbol1 (or greater) are populated. So to reproduce, set symbol1 to something (ie SPY, ES 09-12, AAPL, etc). It will plot by itself fine, but when used inside RSI it generates the above error.

I couldn't find a resolution so far or even what is causing the problem.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Help appreciated. Don't laugh at code, I'm 3-years out of practice writing C#.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Attached Files
Register to download File Type: cs Synthetic.cs (23.2 KB, 17 views)
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary



Big Mike View Post
Error on calculating indicator min/max value for indicator 'RSI'. Please check the 'GetMinMaxValues' method: Index was outside the bounds of the array.

Attached is the indicator.

By default there is no 'symbol1' .. 'symbol10' (blank string). The error only occurs when using RSI and selecting this indicator as the input series. If you plot the indicator by itself (no RSI) it works fine.

The error also only occurs when symbol1 (or greater) are populated. So to reproduce, set symbol1 to something (ie SPY, ES 09-12, AAPL, etc). It will plot by itself fine, but when used inside RSI it generates the above error.

I couldn't find a resolution so far or even what is causing the problem.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Help appreciated. Don't laugh at code, I'm 3-years out of practice writing C#.

Mike


@Big Mike: I have checked it on my side. I am getting the same error: Empty panel, array out of range error for GetMinMaxValues.

I am rather sure that it is one of the NinjaTrader mystery bugs. The code of the indicator has nothing to do with it, as it has no custom plot and does not use the offending method.

What you can do is the following:

(1) Apply the indicator -> nothing will appear
(2) Change the hoizontal compression by clicking below the x-Axis and slightly compress the chart
(3) Press F5 -> now the indicator should be shown
(4) Send a note to NinjaTrader support for explaining the peculiar behavior

Chart after the compression exercise:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

I contacted NT support, and it seems that Add() does not support dynamic calls.

What I don't understand is why it works as a stand-alone indicator, with the code as-is, which includes a dynamic Add() [in other words, the instrument is a variable and not fixed in the code].... but yet doesn't work when wrapping RSI around it.

Or perhaps it isn't working correctly now, and I've just not realized that the plot is completely wrong?

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #5 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


Big Mike View Post
I contacted NT support, and it seems that Add() does not support dynamic calls.

What I don't understand is why it works as a stand-alone indicator, with the code as-is, which includes a dynamic Add() [in other words, the instrument is a variable and not fixed in the code].... but yet doesn't work when wrapping RSI around it.

Or perhaps it isn't working correctly now, and I've just not realized that the plot is completely wrong?

Mike

I have tested this again. I have indeed coded a few indicators which call bartype and period dynamically (see VisualSMA and VisualEMA). Maybe I have committed a crime.... But as the name says, those were not really meant to be called by strategies.

To test the issue I have converted the indicator Synthetic to one which does not allow to define the instruments dynamically. The indicator (attached) is well-behaved and also calculates correct values. I have left a few Print instructions allowing to check the values for the added instruments.

Now, the original Synthetic file is also working well, if you put it on your chart. If you apply an indicator to it, it will first show an empty panel, but if you refresh via F5, it will display correct results.

I cannot entirely explain the behaviour, but it is probably linked to the Initialize section(). I suspect that

-> the code in the Initialize and Properties section is already executed when you open the indicator dialogue box of the chart panel, otherwise you would not see the information in the dialogue box
-> the Initialize() section is executed again, when the indicator is added to the chart, thus taking into account the new parameters
-> the Initialize() section is not executed again, when an indicator is called by another indicator, which means that parameter changes will not be applied to the Add instructions

What I do not know, is why pressing F5 leads to a parameter update.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: zip Synthetic2.zip (2.3 KB, 14 views)
Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

NT's response clarifies it:


NinjaTrader Support
Running it just as an indicator may work as this all depends on when Initialize() is called.

When the indicator is selected to be added to the chart to define the properties Initialize() is run at that time. It can get recalled again once again when you actually hit ok to accept the changed that you made via setting the properties. This is explained as the last bullet point in our help guide which actually allows your initial indicator setup to work on its own: Initialize()

However when adding it as an input series this Initialize() is not re-run so your settings are not maintained when it comes to changing actual output in the Initialize() block based on user input.

Therefor this is why right click->reload historical data will re run initialize() with your properties set and cause your indicator to then start working.

This is part of the reasons why dynamic adding of secondary series is not supported as there is also other consideration for this functionality. For example an issue you can run into is if you run an indicator with dynamic add calls in Intialize() and then remove a secondary added series this would cause an exception since Disposing that secondary series is not expected. So there are other reasons why we do not support dynamic adding of data series in Initialize() and although it may work it would be unsupported and you may run into little things like what you did today.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #7 (permalink)
Elite Member
Northern Germany
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, CL
 
vvhg's Avatar
 
Posts: 1,583 since Mar 2011
Thanks: 1,016 given, 2,807 received


Fat Tails View Post
...I suspect that

-> the code in the Initialize and Properties section is already executed when you open the indicator dialogue box of the chart panel, otherwise you would not see the information in the dialogue box
-> the Initialize() section is executed again, when the indicator is added to the chart, thus taking into account the new parameters

I can confirm this behavior as I was working on an other indicator today which had a print statement in Initialize(). As always@Fat Tails is spot on. I am still waiting for the day where i can prove him wrong...

vvhg

Hic Rhodos, hic salta.
Reply With Quote
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

@Fat Tails,

So Harry, do you see any problem with me calling it via a strategy? I believe that in a backtest, each run causes a Init(). As for running the strategy live on a chart, I guess I may need to hit F5?

I need to do a lot more testing...

thx for your help.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #9 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


Big Mike View Post
@Fat Tails,

So Harry, do you see any problem with me calling it via a strategy? I believe that in a backtest, each run causes a Init(). As for running the strategy live on a chart, I guess I may need to hit F5?

I need to do a lot more testing...

thx for your help.

Mike

I would definitely not start working on a backtest with an indicator that might create problems. Better start with a simple configuration. Why don't you settle for one synthetic instrument - type Synthetic2 - , which means that you can avoid adding instruments dynamically.

When the simple approach works as expected, you can then start to add complexity to your backtest by doing all sorts of things for which NinjaTrader has not been designed. I do not think you will convince the genetic optimizer to run a backtest by optimizing the instruments added.

Reply With Quote

Reply



futures io > > > > > Error on calculating min/max value - please check GetMinMaxValue method

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
My CCI method+ on EURUSD 5 min chart ESFXtrader Currency Futures 30 December 21st, 2014 07:27 PM
RE: Min/Max Charts in NT zhaozilong NinjaTrader 10 April 16th, 2012 09:20 PM
Stochastics min/max Prediction within range bar gain247 NinjaTrader 24 August 7th, 2011 12:51 AM
chipotlebop 30 min profile method chipotlebop Elite Trading Journals 217 August 5th, 2011 02:51 PM
MIN & MAX for last n bars Stem1 EasyLanguage Programming 2 March 14th, 2011 11:23 PM


All times are GMT -4. The time now is 10:40 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.15 seconds with 20 queries on phoenix via your IP 54.226.113.250