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 cls71, Today, 04:45 AM
        0 responses
        1 view
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Working...
        X