Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Resizing an array
Collapse
X
-
Tags: None
-
Hello Stanfillirenfro,
NinjaScript is just C# language so you can very likely resize or recreate an array that you have made.
Do you have more details about what you are trying to accomplish? NinjaScript its self won't have anything specific for resizing an array but you could use google to search for "C# resize array" for some examples.
If the question is about one of the internal Series like Close then no, those cannot be resized. You would only be able to manipulate an array you specifically created in your code.
I look forward to being of further assistance.
-
Many thanks Jessse for your reply. What I want to achive is that I have an iniiaal array or series.. After a certain period of time, I want to have the new size of the array after adding the number of bars formed in this period of time.
Comment
-
Hello Stanfillirenfro,
Thanks for the details.
Yes in that case you could create a normal C# array and use the array's .Resize() method if necessary. You could also create a new array from the old array, it really depends on how your logic needs to work. For this question google will be able to provide many examples of how to do that, you can search for "C# resize array". The Top result is the MSDN reference but you can also find other examples on sites like stackoverflow.
I look forward to being of further assistance.
Comment
-
Many thanks Jesse!
Valuable advice!
I found in google what I habe been looking for.
Many thanks again!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
77 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment