Multi Time Frame - Index was outside the bounds of the array - NinjaTrader Programming | futures io social day trading
futures io futures trading


Multi Time Frame - Index was outside the bounds of the array
Updated: Views / Replies:472 / 5
Created: by Jayswiss Attachments:0

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
 

Multi Time Frame - Index was outside the bounds of the array

  #1 (permalink)
Elite Member
San Francisco, CA / USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradingView
Favorite Futures: ES, TF, NQ, CL, GC
 
Posts: 29 since Jun 2016
Thanks: 4 given, 3 received

Multi Time Frame - Index was outside the bounds of the array

Hi all... I'm new to ninjatrader and I thought I had an understanding of how MTF should work after reading the NT7. Apparently not. My basic attempt at this generates "index was outside the bounds of the array" error.

Here's a sample of the code:

 
Code
 protected override void Initialize()
        {
			Overlay				= false;

			Add(PeriodType.Minute, 3);                                  // 3 min time frame stored at  index[1]  ??

                        double the3minClose        = Closes[1][0];
			Print(the3minClose);

                        double the3minOpen        = Opens[1][0];
			Print(the3minOpen);
        }

Any suggestions here?


(Sorry this should have been posted in NinjaTrader Programming but I don't seem to be able to move it now)


Last edited by Jayswiss; July 2nd, 2016 at 04:33 PM.
Reply With Quote
 
  #2 (permalink)
Elite Member
Los Angeles, California Republic
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES, Mongolian Horse Futures
 
srgtroy's Avatar
 
Posts: 1,456 since Jan 2011
Thanks: 1,009 given, 2,238 received


Jayswiss View Post
Hi all... I'm new to ninjatrader and I thought I had an understanding of how MTF should work after reading the NT7. Apparently not. My basic attempt at this generates "index was outside the bounds of the array" error.

Here's a sample of the code:

 
Code
 protected override void Initialize()
        {
			Overlay				= false;

			Add(PeriodType.Minute, 3);                                  // 3 min time frame stored at  index[1]  ??

                        double the3minClose        = Closes[1][0];
			Print(the3minClose);

                        double the3minOpen        = Opens[1][0];
			Print(the3minOpen);
        }

Any suggestions here?


(Sorry this should have been posted in NinjaTrader Programming but I don't seem to be able to move it now)

Not even close, to be honest. Please repost in the appropriate thread and I am sure someone will help you:

https://futures.io/elite-circle/1261-want-your-ninjatrader-indicator-created-free.html


Last edited by srgtroy; July 3rd, 2016 at 12:38 AM.
Reply With Quote
 
  #3 (permalink)
Elite Member
San Francisco, CA / USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradingView
Favorite Futures: ES, TF, NQ, CL, GC
 
Posts: 29 since Jun 2016
Thanks: 4 given, 3 received


Thanks, srgtroy. That's a neat offer from Futures.io

I don't want or need it created for me though. Having something specific to create is what helps motivate me to learn the language.

I already have the indicator fully coded & working on another platform, but I intend to take advantage of some of the more useful features of NinjaTrader (e.g. autotrading, optimization) that the other platform is lacking.

- Jay

Reply With Quote
 
  #4 (permalink)
Elite Member
Los Angeles, California Republic
 
Futures Experience: Intermediate
Platform: Sierra Chart
Favorite Futures: ES, Mongolian Horse Futures
 
srgtroy's Avatar
 
Posts: 1,456 since Jan 2011
Thanks: 1,009 given, 2,238 received

Have you read the whole "NinjaScript" section of the NT7 Help Guide, specifically? That's the first order of business. You may also want to watch this: https://www.youtube.com/watch?v=K8v_2ONBbqI&list=PL4D56536A44DD7105&index=11

@sam028 Where does this thread belong?


Last edited by srgtroy; July 3rd, 2016 at 06:43 AM.
Reply With Quote
The following user says Thank You to srgtroy for this post:
 
  #5 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received

@Jayswiss, you can't access to bars values in Initialize(), this is what generates your error.
Check the genuine SampleMultiTimeFrame strategy, it's a good example, and the NT7 help (NinjaScript > Educational Resources > Tips > Multi-Time Frame & Instruments).

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #6 (permalink)
Elite Member
San Francisco, CA / USA
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradingView
Favorite Futures: ES, TF, NQ, CL, GC
 
Posts: 29 since Jun 2016
Thanks: 4 given, 3 received

Thanks! Yes, I've since realized some of that doesn't belong in initialize section.

Thanks for the tip, I'll check the SampleMultiTimeFrame strategy.

Reply With Quote

Reply



futures io > > > > > Multi Time Frame - Index was outside the bounds of the array

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stochastics multi time frame ? curleta NinjaTrader 3 September 24th, 2015 07:23 AM
R Quantstrat and multi time frame pipsalottle Matlab, R project and Python 3 June 2nd, 2015 09:51 PM
Need help - Index was outside the bounds of the array Error Message ECI Ed NinjaTrader Programming 4 June 30th, 2013 04:45 PM
multi time-frame questions -- this is different balance NinjaTrader Programming 4 January 12th, 2013 03:27 AM
ADX Multi Time Frame bellair NinjaTrader 9 November 10th, 2011 11:14 AM


All times are GMT -4. The time now is 11:03 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-11 in 0.09 seconds with 19 queries on phoenix via your IP 54.145.16.43