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

Use of Indicator that uses DrawOnPricePanel from Strategy is not drawing on Panel1

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

    Use of Indicator that uses DrawOnPricePanel from Strategy is not drawing on Panel1

    I’m using the d3spotter indicator. This indicator makes use of DrawOnPricePanel = false to draw over the indicator it has loaded in Panel1. Works great.
    But…

    When using the indicator from a strategy the DrawOnPricePanel = false does not seem to have any effect and the drawing takes place in the price panel instead. Actually this behavior happens only when the strategy is run on a chart. If it’s run in Strategy Analyzer and you view the chart from within SA then it’s plotting alright.
    I’ve attached screen shots, the indicator and a sample strategy that makes use of the indicator.

    The d3spotter attached is identical to the one presently on the NT forums except that after I witnessed the issue I added some calls to DrawOnPricePanel to make sure it’s set as the indicator expects and then leaves it to be set to false by the time it returns from OnBarUpdate.
    Attached Files

    #2
    Hello,

    Thank you for the post.

    I just wanted to let you know I am currently reviewing this question.

    Once I have further details on this item I will reply back here.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      When I run Playback connection and start playing it eventually straightens itself out and plots alright. But when enabling on a live connection with real time data it is not plotting correctly.... at least not at the start.

      Comment


        #4
        Any update on this?

        Comment


          #5
          Hello Brillo,

          Thank you for your patience.

          As we analyze the file can you detail why the use of DrawOnPricePanel is seen in OnBarUpdate() where it can be seen switching between true and false?

          I look forward to your response.

          Comment


            #6
            Hi Patrick,
            The indicator draws dots on the price panel as well as in Panel1 where it's added an indicator. The if the DrawOnPricePanel property is not set back and forth then the Draw.Dot api will only draw on one of the panels.
            Another way to get Draw.Dot to draw either panel is to use the overloaded version that takes a bool bDrawOnPricePanel. I had changed the code to use this instead of the property but I get the same behavior. Doesn't work from a strategy at strategy startup.

            BTW, the indicator also uses Draw.TextFixed and there's no overload for that api to specify drawonpricepanel or not so there's not choice but to use the strategy.DrawOnPricePanel property for those calls.

            Comment


              #7
              Hello Brillo,

              Thank you for your response.

              It would not be recommended to switch DrawOnPricePanel from true to false dynamically. There is no expected behavior here as the property should only be set once in SetDefaults.

              You can use two indicators to have one draw on the price panel and the other on the separate panel. Please do so and advise if the behavior you detailed in your original post is still seen.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by martin70, 03-24-2023, 04:58 AM
              14 responses
              105 views
              0 likes
              Last Post martin70  
              Started by TraderBCL, Today, 04:38 AM
              0 responses
              2 views
              0 likes
              Last Post TraderBCL  
              Started by Radano, 06-10-2021, 01:40 AM
              19 responses
              606 views
              0 likes
              Last Post Radano
              by Radano
               
              Started by KenneGaray, Today, 03:48 AM
              0 responses
              4 views
              0 likes
              Last Post KenneGaray  
              Started by thanajo, 05-04-2021, 02:11 AM
              4 responses
              470 views
              0 likes
              Last Post tradingnasdaqprueba  
              Working...
              X