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.

    Comment


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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      103 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      52 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      34 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      36 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      73 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X