Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data array to Data Series conversion

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

    Data array to Data Series conversion

    Dear team,
    I have a data in an array, and would like to create an indicator using this array as input data, such that myArray[0] is the value used to create the current bar indicator plot,
    myArray[1] is the value used to create bar[1] in the indicator plot, as would normally be created below the chart, and so on.
    The total number of values in myArray matches the total number of bars in the main chart.
    Is this possible in NinjaScript ?
    Thanks in advance.

    #2
    Hello Louis335,

    Thanks for your post.

    There is not a way to directly convert an array to a Series and the values of the Series will have to be assigned individually. Instead of trying to convert the array to a Series, I would suggest writing your values to a Series instead of writing to an array.

    To enter the array values in a Series you will need to assign the current bar's value with each new bar that gets processed, or you could loop through the array elements and assign them to the historical values of the Series. I.E.

    Code:
    for (int i = 0; i < 100; i++)
        mySeries[i] = myArray[i];
    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim, that's clear to me now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      32 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      4 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      6 views
      0 likes
      Last Post cre8able  
      Started by Haiasi, Today, 06:53 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X