Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting Draw.Dot to attach to my indicator panel.

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

    Getting Draw.Dot to attach to my indicator panel.

    Hi there,

    I've recently made a stochastic indicator that uses the function Draw.Dot to attach dots to the stochastic plots.

    This works perfectly. I've set the dots to 'DrawOnPricePanel = False'.

    The issue I'm having however, is when I instantiate this indicator into my strategy, the dots seem to be attached to the price panel, not respecting the 'DrawOnPricePanel = False'.

    This only happens when instantiating it. Does anyone know how to possibly fix this?

    Any help will be much appreciated.

    #2
    Hello RoswellTrader,

    If the DrawOnPricePanel was changed in State.SetDfaults (instead of State.Configure) may I confirm you have removed the indicator instance from the chart > Indicators > Configured list and added a new instance from the Available list to pull the new defaults?

    "This only happens when instantiating it."

    Can you clarify your meaning of this?
    Do you mean you are calling the indicator from a strategy and using AddChartIndicator() instead of adding the indicator to the chart directly?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB,

      Thank you for your quick response.

      To clarify:
      1. 'The DrawOnPricePanel = false' setting is applied within the OnBarUpdate method of my stochastic indicator and not within the State.SetDefaults.
      2. I have ensured that the indicator instance has been removed and re-added to the chart to pull the new defaults as suggested.

      Regarding the issue:
      • Yes, I am calling the indicator from a strategy and using AddChartIndicator(). When I manually add the indicator directly to the chart, the dots appear correctly on the stochastic plots. However, when instantiated within the strategy using AddChartIndicator(), the dots are attached to the price panel.

      Is there a specific way to ensure the DrawOnPricePanel = false setting is respected when the indicator is instantiated within a strategy?

      Any guidance on this would be greatly appreciated.

      Comment


        #4
        Hello RoswellTrader,

        "'The DrawOnPricePanel = false' setting is applied within the OnBarUpdate method of my stochastic indicator and not within the State.SetDefaults."

        This will not be effective here. This property has to be assigned in OnStateChange() in either State.SetDefaults or State.Configure. I recommend you set this in State.Configure.

        From the help guide:
        "Warning: This property should ONLY be set from the OnStateChange() method during State.SetDefaults. Dynamically using DrawOnPricePanel in an indicator outside of State.SetDefaults may show issues when working with that indicator through a hosting strategy via AddChartIndicator()."


        "Yes, I am calling the indicator from a strategy and using AddChartIndicator(). When I manually add the indicator directly to the chart, the dots appear correctly on the stochastic plots. However, when instantiated within the strategy using AddChartIndicator(), the dots are attached to the price panel."

        When calling AddChartIndicator() from a strategy the DrawOnPricePanel is not respected in historical but is in real-time.
        While this seems to have been asked before the answers don't agree and the suggestions to draw the line do not work. If I click on the lines that are Drawn I see one that is the correct parameters for the line I want, but don't see the line on either the Price Panel or the Indicator panel. I am just trying to draw a trend


        The only workaround I am aware of is to use the indicator base and draw from the strategy.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Wow, this is so helpful!

          I truly appreciate the detailed response, Chelsea.

          Thanks again.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          79 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          54 views
          0 likes
          Last Post CarlTrading  
          Working...
          X