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 stafe, 04-15-2024, 08:34 PM
        7 responses
        31 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by adeelshahzad, Today, 03:54 AM
        4 responses
        29 views
        0 likes
        Last Post adeelshahzad  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        17 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X