Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Hidden Indicator Conditions

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

    Accessing Hidden Indicator Conditions

    The indicator DoubleMA has a bool rising = true. How can I use this as a condition in a strategy if it doesn't show up in the Condition Builder?
    bool rising = false;
    bool falling = false;
    if( val1 > val2 )
    rising =
    true;
    if( val1 < val2 )
    falling =
    true;

    #2
    kenb2004,

    The indicator needs to be reprogrammed to have this bool exposed. Please see this reference sample for how to expose a bool for access in other scripts. http://www.ninjatrader.com/support/f...ead.php?t=4991

    Since you are using the Condition Builder, if you are not a programmer, it would be best to inquiry with the original author to see if they can modify their indicator to reflect the concept shown in that reference sample.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      There is a "RisingPlot" in the Condition Builder. Can this be used?

      Comment


        #4
        kenb2004,

        I would not know how the particular indicator you are using is programmed and what plots it has or what they do so I would unfortunately not be able to comment.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          When the bool Rising = true it plots the RisingPlot and draws a SlowMA with a RisingColor. Can this RisingPlot in the Condition Builder be used to make a condition true or does the Strategy need a bool from the Indicator?

          Comment


            #6
            kenb2004,

            Unfortunately I would not know what RisingPlot is and cannot comment on this indicator. Your best bet would be to inquiry with the original author to inform you as to what exactly each component does.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I programmed the indicator to expose the indicator's bool by doing the following as per instructions. Can this bool now be accessed via the Strategy Wizard? If not How could this be changed so it could? What does the " [Browsable(false)]" mean? Thanks

              #region Variables
              private BoolSeries bearIndication;
              private BoolSeries bullIndication;
              private double exposedVariable;
              #endregion

              protected override void Initialize()
              bearIndication = new BoolSeries(this);
              bullIndication = new BoolSeries(this);

              protected override void OnBarUpdate()
              if (CrossAbove(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1))
              {
              BarColor = Color.Lime;
              bullIndication.Set(true);
              bearIndication.Set(false);
              }
              else if (CrossBelow(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1))
              {
              BarColor = Color.Magenta;
              bullIndication.Set(false);
              bearIndication.Set(true);
              }
              else
              {
              bullIndication.Set(false);
              bearIndication.Set(false);
              }
              exposedVariable = Close[0];
              }

              #region Properties

              [Browsable(false)]
              [XmlIgnore()]
              public BoolSeries BearIndication
              {
              get { return bearIndication; } }

              [Browsable(false)]
              [XmlIgnore()]
              public BoolSeries BullIndication
              {
              get { return bullIndication; } }

              [Browsable(false)]
              [XmlIgnore()]
              public double ExposedVariable
              {.
              get { Update(); return exposedVariable; }
              }
              #endregion
              }
              }

              Comment


                #8
                kenb2004, if you exposed the bool, it will be available for use in the Strategy Wizard. The [Browsable(false)] is some necessary part of the script and it is highly recommended to not touch it. This property has nothing to do with whether or not the plot/bool is exposed.
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  How do I use this exposed bool as a condition with the wizard?
                  Thanks

                  Comment


                    #10
                    You could for example check if it's value returns 'true' and then you could enter some kind of 'action' on it...

                    Comment


                      #11
                      That I understand, but what I don't understand is how the strategy knows which indicator has the bool I want to use as a "true" conditon. For example if I use "bearindication=true" and this is a bool in multiple indicators, what points the strategy to this indicator? In the SampleBoolSeriesStrategy it uses the "Add", I'm not sure if that is called a "method", parameter, expression, or what, but to do this in the Wizard you would have to find the indicator in the "Condition Builder" and set "Plot on chart" to "true". But what condition should I be doing if I want the bool "bearindication=true". There is no option in the "Condition Builder". The only "parameters are Input Series, Bars ago, Offset type, Offset, and Plot on Chart. How is this bool "exposed" to the Wizard?

                      Thanks

                      Comment


                        #12
                        In the SampleBoolSeriesStrategy the condition
                        if
                        (SampleBoolSeries().BullIndication[0])
                        is used. How can this be ackomplished with the wizard?
                        Thanks

                        Comment


                          #13
                          kenb2004,

                          The Strategy Wizard can only build conditions based off of plots. The reference sample you are looking at is specifically designed to show you how to program things that do not use plots. BullIndication and BearIndication are not available for use in the Strategy Wizard.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            OK, so how do I make an indicator's true condition into a usable plot to work with the Strategy Wizard? This just can't be that difficult. Maybe something like an oscilator plots +1 for bullindication and -1 for bearindication. I don't know, all I'm trying to do is access an indicator's true condition from the strategy wizard. I don't mind changing the code of the indicator but I want to be able to access that code from the strategy wizard.
                            Last edited by kenb2004; 09-27-2010, 09:01 AM.

                            Comment


                              #15
                              You cannot make "true/false" plots. Plots are things that contain numeric values. If you want to use something that would function just like a BoolSeries, you can create a normal plot and use the values of 0 and 1. 0=false, 1=true. Then instead of checking for true or false you can just check for 0 or 1.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              558 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              324 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              545 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              547 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X