Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Copying Prices series into an Array
Collapse
X
-
Hello Icus1,
Thanks for your reply.
With the data series, you can use the MAX() and MIN() method directly. For example double maxHigh = MAX(High, 20)[0]; // Highest high of last 20 bars
References:
https://ninjatrader.com/support/help...aximum_max.htm
https://ninjatrader.com/support/help...inimum_min.htm
In an array, which is more of a C# question, you could use the name of the array with .Min() and .Max()
From an external reference: https://www.dotnetperls.com/maxPaul H.NinjaTrader Customer Service
-
@soon123: can you explain what the difference is to what Paul said? I have to admit that I do understand what an array is. Simply said it's a variable that can hold more than 1 values. One can add values to the array and modify the array to the needs. I hope that's correct so far. But what exactly iSeries is?
couldn't Icus1 just use the suggestion of Paul to get the highest high and the lowest high by using
Code:[I]lowestHigh = MIN(High, 20)[0]; [/I] [I]highestHigh = MAX(High, 20)[0];[/I]
Comment
-
Hello Patricia70,
An Array structure would be an independent storage of values.
A data series (series <t>) is an array that is synchronized (number of elements) with the number of bars in the data series of the chart. For example, if you wanted to calculate something on every bar and store that result in a custom series and be able to pull that value using the various methods such as MIN, MAX or access by a bars ago value.
Please see the help guide here: https://ninjatrader.com/support/help.../?iseriest.htm
Paul H.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
44 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
180 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM |
Comment