Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting indicator attributes

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

    Setting indicator attributes

    I guess this qualifies as a follow-up to the question I asked about setting an indicator's panel from a strategy. (See http://www.ninjatrader.com/support/f...ad.php?t=35364.) In this case I'm wondering about other indicator attributes like AutoScale or CalculateOnBarClose.

    I found that in v7 beta 23 the line indicator().AutoScale = false works fine within Initialize(), but indicator().CalculateOnBarClose = false does not. However, if indicator().CalculateOnBarClose = false is placed in OnStartUp() it works fine. (I've attached a strategy that demonstrates this. It places two EMAs on a chart and tries to set CalculateOnBarClose to false for both. One is done in Initialize(), the other in OnStartUp(). Only OnStartUp() works.)

    Is this expected behavior? If not, well, now you know. If so, could you specify which indicator properties must be handled from OnStartUp()?
    Attached Files

    #2
    Hello,

    Thanks for posting.

    I know we have had some issues with this in the past when users mixing calculate on bar close settings between indicators and strategies yielding unexpected results. I'm unsure if this has been specifically disabled so that you are unable to choose. (Will always run on the main indicator/strategy COBC setting).

    I am confirming this now, thanks for your patience.
    BrettNinjaTrader Product Management

    Comment


      #3
      But I can choose the COBC setting (or at least that's how it appears) provided I hit it in OnStartUp(). So if it's supposed to work in Initialize(), it doesn't. But if it's supposed to be disabled, it's certainly not totally disabled! Seems like it's kind of betwixt and between at the moment (unless it really is only supposed to work from OnStartUp()).

      Comment


        #4
        Hello,

        I have heard back and you should never set a hosted indicators COBC settings as this messes with data series objects, and calculatons when used in a strategy.

        This is the reason why all system Indicators do not set COBC settings in there Init().

        Changing this in OnStartUp() is possible as you mention however this is unsupported and I would advise you not to do this as there are known issues with this.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Do you advice to always skip CalcualetOnBarClose in the Initialize method in custom indicators?

          /Best Regards

          Comment


            #6
            Hello,

            It is good advice, yes. Should be no problem in single indicators but when you start nesting them the different settings can conflict.
            BrettNinjaTrader Product Management

            Comment


              #7
              Hello,

              Will the the CalculateOnBarClose property of indicators that are nested in other indicators be overriden by the CalculateOnBarClose property of the strategy? Are there exceptions?

              The user guide states:
              "The CalculateOnBarClose property of indicators embedded within a strategy are overriden by the CalculateOnBarClose property of the strategy ."

              //Best Regards

              Comment


                #8
                Originally posted by poseidon_sthlm View Post
                Hello,

                Will the the CalculateOnBarClose property of indicators that are nested in other indicators be overriden by the CalculateOnBarClose property of the strategy? Are there exceptions?

                The user guide states:
                "The CalculateOnBarClose property of indicators embedded within a strategy are overriden by the CalculateOnBarClose property of the strategy ."

                //Best Regards
                Yes they will be overridden and I don't believe there to be any exceptions.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                631 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                566 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X