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 Questions

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

    Indicator Questions

    Hi

    A couple of dumb questions:

    I have an indicator an I want to return 5 values from it ...

    How do I access the 4th value from a strategy

    Also I don't want to plot the 5th value (it is just a buy/sell signal) how would I set that up in the indicator and access it from the strategy.

    Thanks

    Paul

    #2
    Paul,

    What do you mean by 5 values? Do you mean the 5 previous values of the indicator?

    To do this you just use the [] indexing.

    myIndicator()[0] <-- latest value
    myIndicator()[1] <-- previous value
    myIndicator()[2] <-- value 2 bars ago.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Paul,

      What do you mean by 5 values? Do you mean the 5 previous values of the indicator?

      To do this you just use the [] indexing.

      myIndicator()[0] <-- latest value
      myIndicator()[1] <-- previous value
      myIndicator()[2] <-- value 2 bars ago.
      Hi Josh

      Thanks for the reply I mean my indicator returns 5 data series and i want to access the latest value in the 5th data series ...

      also could you possiblt give me the synatx of how of the Add call in the initialize function in a strategy in order to set the indicator up on the strategy chart - the indicator has 5 input parameters but when I try and add it the editor is saying the first should be a data series and i'm not clear what i should put in there

      thanks again

      paul

      Comment


        #4
        Paul,

        To add indicator to strategies please see this: http://www.ninjatrader-support2.com/...ead.php?t=3228

        You need to use the correct overload method. If it is looking for a DataSeries you have to fill in a DataSeries.

        If you have 5 different plots in your indicator you should be able to access each one individually if they are exposed. For an example, take a look at the MACD indicator and how you can access each plot individually. http://www.ninjatrader-support.com/H...deV6/MACD.html
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Paul,

          To add indicator to strategies please see this: http://www.ninjatrader-support2.com/...ead.php?t=3228

          You need to use the correct overload method. If it is looking for a DataSeries you have to fill in a DataSeries.

          If you have 5 different plots in your indicator you should be able to access each one individually if they are exposed. For an example, take a look at the MACD indicator and how you can access each plot individually. http://www.ninjatrader-support.com/H...deV6/MACD.html
          sorry Josh I don't understand why it is asking for a data series since the inputs are just 5 static variables?

          Comment


            #6
            murfinp,

            I would not know unless you post up some screenshots of the Intellisense.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              murfinp,

              I would not know unless you post up some screenshots of the Intellisense.
              ok here it is ... as i say the indicator just takes 5 static inputs
              Attached Files

              Comment


                #8
                From the intellisense it would appear it takes 6 ints, not 5. If you press the down arrow you should see another overload method that does not require you to call a DataSeries.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  From the intellisense it would appear it takes 6 ints, not 5. If you press the down arrow you should see another overload method that does not require you to call a DataSeries.
                  Josh

                  Doh! I am so thick sometimes

                  Thanks

                  Paul

                  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