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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
31 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
12 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
20 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment