Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Indicator with multiple input DataSeries

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

    Indicator with multiple input DataSeries

    Hello,
    I want to build an indicator with using 2 or 3 input DataSeries. Do you have an example of an indicator using more than 1 input dataseries. For example the EMA indicator uses 1 input DataSeries. I want to call this indicator in my stratgey. This indicator uses than for example the High[0] and Low[0] as input dataserie.

    Kind regards,
    Rene

    #2
    Hello Rene,

    Thank you for your post.

    You can see an example of using multiple instruments/time frames in your strategy by going to the NinjaTrader Control Center > Tools > Edit NinjaScript > Strategy > SampleMultiInstrument > OK.

    For information on working with multiple instruments and time frames in your code please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks for the reply. I am all familiair with the working of multiple instrument in a strategy. I am using it already and it works. My question is as follows: in a strategy you can use the indicator EMA(Close[0], 20) for using a 20 period MA. This indiactor does use 1 input dataserie: Close[0]. I want to build an indicator and use it in a strategy with 2 input dataseries: High[0] and Low[0]. Is it possible to use two input dataseries for calling an indicator and do you have an example of an indicator using two input dataseries. I need to know to ma ethe indicator familiar that 2 input dataseries are used. If I look at the code of the EMA indicator only 1 input dataserie can be used.

      Kind regards,
      Rene

      Comment


        #4
        Hello Rene,

        Thank you for that information.

        In this case you would use BarsArray to call the second data series into an indicator.

        For information on BarsArray please visit the following link: http://www.ninjatrader.com/support/h.../barsarray.htm

        Please let me know if you have any questions.

        Comment


          #5
          Originally posted by Renejm View Post
          Thanks for the reply. I am all familiair with the working of multiple instrument in a strategy. I am using it already and it works. My question is as follows: in a strategy you can use the indicator EMA(Close[0], 20) for using a 20 period MA. This indiactor does use 1 input dataserie: Close[0]. I want to build an indicator and use it in a strategy with 2 input dataseries: High[0] and Low[0]. Is it possible to use two input dataseries for calling an indicator and do you have an example of an indicator using two input dataseries. I need to know to ma ethe indicator familiar that 2 input dataseries are used. If I look at the code of the EMA indicator only 1 input dataserie can be used.

          Kind regards,
          Rene
          You can use any number of any objects as inputs. Just make them inputs, by properly defining their properties, and use them.

          Comment


            #6
            in the region properties

            [NinjaScriptProperty] // this treats the variable as an input argument to your indicator method
            [Browsable(false)] // this hides the variable from the indicator setup/config dialog box property grid (typically where you define a lookback value etc)​

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X