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 calling another Indicator

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

    #16
    thebean, how are you constructing this TRIN indicator? I would recommend making a named plot for the TRIN indicator instead of just using Value, and then you should be able to read it from another indicator no problem. This link can help get you started - http://www.ninjatrader-support2.com/...ead.php?t=4991.
    AustinNinjaTrader Customer Service

    Comment


      #17
      Hi NinjaTrader_Austin, thanks for the suggestion. I saw that tip before and tried to incorporate it somehow into the indicator with little success.

      Right now I am adding a data series for each of the data points that are needed to calculate the TRIN value. For example:

      Add(advanceIndex, periodtype, periodInterval);

      Then in OnBarUpdate() I have the following 2 lines:

      Value.Set(trinValue);
      TRINLine.Set(trinValue);


      The indicator appears to be drawing itself properly. What I am noticing now is that the SMA indicator doesn't draw properly unless I also include the underlying data series as part of the chart as well. Is there a way to fix that?

      Comment


        #18
        thebean, in the series you are calling, you need to add Update() - please see here for the help guide reference for Update() - http://www.ninjatrader.com/support/h...nt7/update.htm.
        AustinNinjaTrader Customer Service

        Comment


          #19
          I figured out what the problem was. The TRIN indicator was downloading data but using the default Session setting for each of the data series that I added. The problem was that a couple of the instruments were using 'US Equities RTH' instead of 'Default 24/X' as their sessions. Changing the default values for those instruments worked!

          Just for future reference, if I wanted to override the session programmatically, could I? Thanks for the suggestions!

          Comment


            #20
            Great you got it resolved, a programmatic change of the template used in unfortunately not possible. But perhaps you add a check for the template and if those do not fit, you issue a log error?
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Thanks NinjaTrader_Bertrand, I will consider this. Could this be included as an enhancement request to programmatically select the session type?

              Comment


                #22
                You're welcome thebean and thanks for the input, I'll ask product management to have this added to our feedback lists.
                BertrandNinjaTrader Customer Service

                Comment


                  #23
                  This is now being tracked under # 957 in our system, thanks again for the input to further enhance NinjaTrader.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #24
                    I'm a bit confused about referencing exposed variables...

                    I"m not understanding something about your "sampleboolseries."

                    Here's what I want to do, using your example, if I put the SampleBoolSeries on 2 charts, one is on ADD index the other on TICK index. Now I want to access the current value of your bool Series in another code that says:

                    If the sampleboolseries.bullindication of TICK and sampleboolseries.bullindication of ADD are both true then if the MACD of this chart say of IBM is also bullish then give me an up arrow on the on the current chart, in this case IBM.

                    The part that I can't seem to get is how do I reference your SampleBoolSeries and differrentiate it for TICK and ADD.

                    I can certainly Add the TICK dataseries and ADD date series and then use that to calculate MACD within my code for each dataseries but I already have that calculating on the 2 charts and I want to reference the values there so that I don't have to have it recalculated within this new code, or in this case the bull and bear indication already being calculated on the TICK and ADD

                    I guess simply put what is the syntax for accessing and differenctiating the SampleBoolSeries being used for TICK then again for ADD indices?

                    That is:

                    What do I have to add to:
                    "SampleBoolSeries().Bullindication" to point to one that's being calculated for TICK and then the one for ADD?





                    .

                    Comment


                      #25
                      Originally posted by Benske View Post
                      I"m not understanding something about your "sampleboolseries."

                      Here's what I want to do, using your example, if I put the SampleBoolSeries on 2 charts, one is on ADD index the other on TICK index. Now I want to access the current value of your bool Series in another code that says:

                      If the sampleboolseries.bullindication of TICK and sampleboolseries.bullindication of ADD are both true then if the MACD of this chart say of IBM is also bullish then give me an up arrow on the on the current chart, in this case IBM.

                      The part that I can't seem to get is how do I reference your SampleBoolSeries and differrentiate it for TICK and ADD.

                      I can certainly Add the TICK dataseries and ADD date series and then use that to calculate MACD within my code for each dataseries but I already have that calculating on the 2 charts and I want to reference the values there so that I don't have to have it recalculated within this new code, or in this case the bull and bear indication already being calculated on the TICK and ADD

                      I guess simply put what is the syntax for accessing and differenctiating the SampleBoolSeries being used for TICK then again for ADD indices?

                      That is:

                      What do I have to add to:
                      "SampleBoolSeries().Bullindication" to point to one that's being calculated for TICK and then the one for ADD?

                      .
                      How are you using the ADD method? ADD typically is used in strategies to add a indicator to a chart, rather than have it used for other calculations. You can reference the indicator just by calling it like a function and referring to the correct dataseries.

                      When you refer to TICK, are you referring to the fact that you have a indicator or strategy that adds a tick-based data series?
                      Last edited by NinjaTrader_AdamP; 03-05-2012, 02:11 PM.
                      Adam P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by FrazMann, Today, 11:21 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post FrazMann  
                      Started by geddyisodin, Yesterday, 05:20 AM
                      8 responses
                      52 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by cmtjoancolmenero, Yesterday, 03:58 PM
                      10 responses
                      36 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by DayTradingDEMON, Today, 09:28 AM
                      4 responses
                      24 views
                      0 likes
                      Last Post DayTradingDEMON  
                      Started by George21, Today, 10:07 AM
                      1 response
                      19 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Working...
                      X