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

Nondisplaying Indicator?

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

    Nondisplaying Indicator?

    Can I create an indicator that I use in a strategy that has no indication of any type on the chart it is added to. As if it were on Panel 0 - a nonexistent panel. If so - how do I remove all traces of the indicator from the chart? I still need the user to set properties for it!

    #2
    Hello,

    Are you attaching this to a chart as you would for any indicator? When you attach the indicator delete the label field and change the indicator color to Transparent.

    Comment


      #3
      Sorry, don't fully follow, the indicator called in the strat does not have to plot anything, you could just expose variables or dataseries as needed for programmatic access -

      BertrandNinjaTrader Customer Service

      Comment


        #4
        Not Diplsy Indicator

        I suppose I could use a class and avoid standard indicator behavor but I need everything but the display so I want to see if I can remove waht I don't need from the display. I can make the indicator transparent - but is there a way to not reserve a panel for it (as if I set it to panel 0) and is there a way to not show the scale on the right axis?

        Comment


          #5
          Hello,

          There is no Panel 0, so that is not possible.

          Doing what Bertard posted just prior is the best, only way I know how to do it.
          DenNinjaTrader Customer Service

          Comment


            #6
            How do you access the variables set in the sample indicator in a strategy?

            Comment


              #7
              Please see the sample code in the link I posted under #3, specifically the strategy 'SampleBoolSeries' - you'll see snippets for accessing an exposed variable and exposed data / boolseries (of course indicator plots would be exposed per default, so not needed for accessing those values).
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Hi Bertrand,

                I think I understand how to expose the values in the sample indicator you mention, but I'm not clear how I can access them from a strategy. (I'm sorry for the basic question)

                I tried something like this in my strategy -

                protected override void Initialize()
                {
                CalculateOnBarClose = true;
                Add(SampleBoolSeries());
                }
                protected override void OnBarUpdate()
                {
                if (SampleBoolSeries().BullIndication == true)
                Print("Bull");
                }

                But apparently, I am wrong and have no clue ...

                Thanks for your help.

                Comment


                  #9
                  ZenMachine, that sample looks correct - you access the exposed BoolIndication series from the indicator - are you sure those values are getting set in the indicator as you would expect? Do the conditions for this trigger? Best might be to check first with the complete sample provided and then moving on accessing a custom series / variable.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by ZenMachine View Post
                    Hi Bertrand,

                    I think I understand how to expose the values in the sample indicator you mention, but I'm not clear how I can access them from a strategy. (I'm sorry for the basic question)

                    I tried something like this in my strategy -

                    protected override void Initialize()
                    {
                    CalculateOnBarClose = true;
                    Add(SampleBoolSeries());
                    }
                    protected override void OnBarUpdate()
                    {
                    if (SampleBoolSeries().BullIndication == true)
                    Print("Bull");
                    }

                    But apparently, I am wrong and have no clue ...

                    Thanks for your help.
                    If you don't want to display an indicator, simply don't call "Add" method.
                    if BullIndication is BoolSeries you have to add [0] at the end like:

                    protected override void OnBarUpdate()
                    {
                    if (SampleBoolSeries().BullIndication[0] == true)
                    Print("Bull");
                    }

                    Comment


                      #11
                      Originally posted by roonius View Post
                      If you don't want to display an indicator, simply don't call "Add" method.
                      if BullIndication is BoolSeries you have to add [0] at the end like:

                      protected override void OnBarUpdate()
                      {
                      if (SampleBoolSeries().BullIndication[0] == true)
                      Print("Bull");
                      }
                      That was it! Thank you!

                      I would also like to access these values from within Wizard. Is it possible, and how can I do so?

                      Comment


                        #12
                        Originally posted by ZenMachine View Post
                        That was it! Thank you!

                        I would also like to access these values from within Wizard. Is it possible, and how can I do so?
                        You can access only DataSeries from wizard (no BoolSeries)

                        Comment


                          #13
                          That's too bad...

                          Thank you roonius!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by DanielTynera, Today, 01:14 AM
                          0 responses
                          2 views
                          0 likes
                          Last Post DanielTynera  
                          Started by yertle, 04-18-2024, 08:38 AM
                          9 responses
                          40 views
                          0 likes
                          Last Post yertle
                          by yertle
                           
                          Started by techgetgame, Yesterday, 11:42 PM
                          0 responses
                          12 views
                          0 likes
                          Last Post techgetgame  
                          Started by sephichapdson, Yesterday, 11:36 PM
                          0 responses
                          2 views
                          0 likes
                          Last Post sephichapdson  
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,615 views
                          0 likes
                          Last Post aligator  
                          Working...
                          X