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!
See more
See less

Partner 728x90

Collapse

Copying Prices series into an Array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Copying Prices series into an Array

    Im trying to copy the high(price series) into an array.After getting it copied,will like to get the maximum and the minimum of the arrays.Any help about how i could i get this done would be appreciated

    #2
    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/max
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks so much soon123,Hope it helps,and besides,will you Allow that i contact you directly when i have problems with codes?if yes,what other messaging platform can i reach you on.Thanks

      Comment


        #4
        @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]
        trying to understand what the difference is and what iSeries is. Please be patient with me, still learning C# and Ninjascript

        Comment


          #5
          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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          44 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          180 views
          0 likes
          Last Post jeronymite  
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          13 views
          0 likes
          Last Post DanielSanMartin  
          Working...
          X