Setting multiple dataseries using a for loop - NinjaTrader Programming | futures io social day trading
futures io futures trading


Setting multiple dataseries using a for loop
Updated: Views / Replies:750 / 3
Created: by Xav1029 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
 

Setting multiple dataseries using a for loop

  #1 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received

Setting multiple dataseries using a for loop

I was wondering if it is possible to set a large amount of dataseries using a for loop. For example, say I have 64 dataseries named myDataSeries0, myDataSeries1,....myDataSeries63. Is it possible to pass i into into a structure to set all of these in the same loop?

Something similar to this, but that works

for(int i=0;i<64;i++)
{
myDataSeries+i.Set(myArray[i]);
}

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
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

use dictionaries


You can use Dictionary for that:

 
Code
                            
private Dictionary<intDataSeriesd//in Variables section
= new Dictionary<intDataSeries>();    //in initialize
for (int i 0dsCounti++) //wherever
{
    
d[i] = new DataSeries(this);
}

//to set the values
for (int i 0dsCounti++)
{
    
d[i][0] = 343453.44 //setting data series d[i] value for current bar
}
//to access the values
for (int i 0dsCounti++)
{
    Print(
"Value of the data series: "d[i][0]); //getting data series d[i] value for current bar



Last edited by gregid; August 28th, 2012 at 09:00 AM. Reason: consistency
Reply With Quote
The following 2 users say Thank You to gregid for this post:
 
  #4 (permalink)
Elite Member
Tampa, FL
 
Futures Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E, M6E, 6J
 
Xav1029's Avatar
 
Posts: 1,374 since Dec 2011
Thanks: 1,452 given, 3,354 received

Thanks @gregid. I will try it when I get home. This should take 2000+ lines of code and trim it down to 400-500

Reply With Quote

Reply



futures io > > > > > Setting multiple dataseries using a for loop

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
Multiple dataseries Breakout NinjaTrader 28 March 30th, 2015 01:14 PM
Multiple dataseries intrabarpersist ohlc Big Mike EasyLanguage Programming 17 December 27th, 2011 01:14 AM
OODA Loop and Trading...... tradersam Psychology and Money Management 1 May 18th, 2011 03:36 PM
foreach loop problem gomad NinjaTrader Programming 14 May 17th, 2011 08:40 PM
Need help with order entry on multiple dataseries bobbakerr EasyLanguage Programming 20 August 29th, 2010 10:03 AM


All times are GMT -4. The time now is 02:59 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.226.172.30