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 RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kulwinder73, Today, 10:31 AM
        0 responses
        5 views
        0 likes
        Last Post kulwinder73  
        Started by terofs, Yesterday, 04:18 PM
        1 response
        23 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Working...
        X