NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 02-15-2010, 12:14 PM   #1
tinkerz
Senior Member
 
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
Default Stacks and Arrays

I have check the MSDN website and I see to access the stack I use the peek command, but that looks at the last entry onto the stack.

My question is..
Would it be better to create an array of the stack, any example of the fastest way to do so I am using stack on orderflow and limitbook.

or is there another command to look further into the stack that i missed?

Thanks Tinkerz
tinkerz is offline  
Reply With Quote
Old 02-15-2010, 12:23 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,379
Thanks: 252
Thanked 966 times in 949 posts
Default

tinkerz, this is unfortunately more into general C# and thus unfortunately outside of the scope that we can support, but it sounds like you would be using the ArrayList for those tasks...
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-15-2010, 12:33 PM   #3
tinkerz
Senior Member
 
Join Date: Dec 2009
Posts: 248
Thanks: 0
Thanked 1 time in 1 post
Default

An Array list is dynamic, I would like too keep the list at a constant number an drop out the oldest.
tinkerz is offline  
Reply With Quote
Old 02-15-2010, 12:43 PM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,379
Thanks: 252
Thanked 966 times in 949 posts
Default

I think then a queue is more applicable (first in first out principle) - http://www.csharpfriends.com/Article...x?articleID=66
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jagged Arrays toptrader General Programming 1 09-24-2009 10:53 AM
C# arrays maxpi Indicator Development 3 08-08-2008 07:28 AM
VS debug of arrays ?? tb2000 General Programming 2 07-04-2008 08:46 AM
Arrays maxpi Strategy Development 1 12-07-2007 12:10 AM


All times are GMT -6. The time now is 05:47 AM.