Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sample function that returns IDataSeries?

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

    sample function that returns IDataSeries?

    Hi,

    Could the NT support give me a sample function that takes IDataSeries as input and returns IDataSeries?

    Thanks

    #2
    Hi,

    There is a sample function in our Help Guide. Please let me know if this does not meet your needs or if the documentation is not clear and I'll be happy to clarify.

    Code:
    private double DoubleTheValue(IDataSeries priceData)
    {
        return priceData[0] * 2;
    }
     
    protected override void OnBarUpdate()
    {
        Print(DoubleTheValue(Close));
        Print(DoubleTheValue(SMA(20)));
    }
    MatthewNinjaTrader Product Management

    Comment


      #3
      return IDataSeries

      I intend to ask an example function that returns IDataSeries, and also has an input of IDataSeries.

      Comment


        #4
        A DataSeries is constructed to only return a double.

        We do not have any support/documentation for constructing your own custom IDataSeries to return another value, although it should be technically possible. I will refer you to the following thread which his information related to this topic:

        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        61 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        39 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        21 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        23 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X