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

Varying Indicator Parameters

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

    #16
    Explain what it is you are trying to do again.

    Maybe I'm the one who isn't understanding.
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #17
      I have an indicator, lets call it MyIndi, that needs to access the value of T3. Both T3 and MyIndi are on the same chart.

      Currently I have T3 parameters as (34, 3, 0.01). In MyIndi I am accessing T3 with:
      if(High[0] > T3(34,3,0.01)[0])
      do something...

      This works fine but if I changed T3 (on the chart) to, say, (21, 3, 0.5) MyIndi would still be accessing
      T3(34,3,0.01)[0].

      I would like MyIndi to access whatever parameters T3 is currently set to. So if T3 is changed I would not have to change MyIndi.

      I hope this is a bit clearer :-)

      Also, thanks for your patience.

      Comment


        #18
        Originally posted by FatCanary View Post
        I have an indicator, lets call it MyIndi, that needs to access the value of T3. Both T3 and MyIndi are on the same chart.

        Currently I have T3 parameters as (34, 3, 0.01). In MyIndi I am accessing T3 with:
        if(High[0] > T3(34,3,0.01)[0])
        do something...

        This works fine but if I changed T3 (on the chart) to, say, (21, 3, 0.5) MyIndi would still be accessing
        T3(34,3,0.01)[0].

        I would like MyIndi to access whatever parameters T3 is currently set to. So if T3 is changed I would not have to change MyIndi.

        I hope this is a bit clearer :-)

        Also, thanks for your patience.
        FatCanary,

        This should be quite simple.

        save T3 under a new name. (No editing NT stock indicators)

        add the following code line in onBarUpdate.

        if(High[0] > T3(period, tCount, vFactor)[0]) // Do Something!!!

        Now your parameters in this indicator will control your new T3 version as well as the parameters to the original T3 feeding into your indicator.

        Only use the new indicator. T3 does not need to be on the chart.

        The only thing left is the "do something ".



        RJay


        P.S. this can also be done without the T3 feed. Simply compare the Value[0] to Open[0] .
        Last edited by RJay; 07-23-2010, 02:16 PM.
        RJay
        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

        Comment


          #19
          Aha!! Never thought of doing it like that, it works great.

          Many, many thanks.

          Can I push my luck with your generosity just a little further? :-)

          You mention:
          P.S. this can also be done without the T3 feed. Simply compare the Value[0] to Open[0]

          Could you explain 'simply compare the Value[0] to Open[0]' a bit further please.

          Comment


            #20
            Originally posted by FatCanary View Post
            Aha!! Never thought of doing it like that, it works great.

            Many, many thanks.

            Can I push my luck with your generosity just a little further? :-)

            You mention:
            P.S. this can also be done without the T3 feed. Simply compare the Value[0] to Open[0]

            Could you explain 'simply compare the Value[0] to Open[0]' a bit further please.

            OK,

            Temporarily, comment out the input feed from T3 and add this if statement at this location in the code.


            CalculateGD((DataSeries) seriesCollection[seriesCollection.Count - 1], Values[0]);

            if(High[0] > Values[0]) // Do Something
            }



            RJay
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment


              #21
              Hi RJay

              Right, got it. Although I had to change Values[0] to Value[0].
              Values[0] was giving a compile error saying 'Operator '>' cannot be applied to operands type 'double' and DataSeries'.

              Once again many thanks for the help. I won't take up any more of your time!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by geddyisodin, Today, 05:20 AM
              2 responses
              16 views
              0 likes
              Last Post geddyisodin  
              Started by hazylizard, Today, 08:38 AM
              0 responses
              6 views
              0 likes
              Last Post hazylizard  
              Started by Max238, Today, 01:28 AM
              5 responses
              42 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by giulyko00, Yesterday, 12:03 PM
              3 responses
              12 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by habeebft, Today, 07:27 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_ChristopherS  
              Working...
              X