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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          72 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X