• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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)));
    }
    http://www.ninjatrader.com/support/h...dataseries.htm
    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:

        http://www.ninjatrader.com/support/f...ad.php?t=56755
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ttodua, Today, 02:59 AM
        0 responses
        2 views
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by rikcybella, Today, 01:46 AM
        0 responses
        5 views
        0 likes
        Last Post rikcybella  
        Started by imunitypills, Today, 12:53 AM
        0 responses
        5 views
        0 likes
        Last Post imunitypills  
        Started by imunitypills, Today, 12:52 AM
        0 responses
        5 views
        0 likes
        Last Post imunitypills  
        Started by Marasty, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post Marasty
        by Marasty
         
        Working...
        X