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

DrawObject not detecting objects on chart question

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

    DrawObject not detecting objects on chart question

    I have a 3rd party indicator that plots Dots on the chart in panel 2.
    I am calling DrawObjects.Count and count is returning zero.

    I can manually select the dots and view properties like the color, tag, y value etc.

    Any idea why DrawObjects is not picking them up?

    #2
    Hello onnb1, and thank you for your question. If you are attempting to access these drawn objects from your own indicator or strategy, rather than by modifying the third party indicator's source code, it is very likely that the drawn objects are not global. Global drawn objects have an @ symbol that precedes their ID tag.

    If you are editing the third party indicator's source, would it be possible to provide us with a stripped down copy, either here or at platformsupport[at]ninjatrader[dot]com referencing Attn:NinjaTrader_JessicaP and 1620379 in the subject line?
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      These are 3rd indicators that I am trying to access from my own indicator.
      What is strange is that when I do "DrawObjects.Count", I get 0. Does that make sense?

      Comment


        #4
        This is because your own indicator or strategy does not contain any drawing objects. Please analyze myIndicatorReference.DrawObjects.Count .
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          I did a small test.

          The first code is OnBarUpdate for writing text.
          The second code is OnBarUpdate for printing the count.

          The print always prints 0 - is that expected?



          protected override void OnBarUpdate()
          {
          DrawText(CurrentBar.ToString(), CurrentBar.ToString(), 0, High[0], Color.White);
          }


          protected override void OnBarUpdate()
          {


          DrawTextTmp ind = DrawTextTmp(0);

          Print(ind.DrawObjects.Count);

          }

          Comment


            #6
            Upon further investigation this is to be expected.

            I have prepared two indicators in NinjaTrader 7 and NinjaTrader 8. The indicator Bar will draw green docts above the closing price of every bar. The indicator Foo contains an indicator Bar and will print its DrawObjects.Count .

            Since this is 0 in both NT7 and NT8, and Bar never draws on the chart when inside Foo, I have submitted a feature request to the product management team for the following feature :
            This user would like to allow sub-indicators to draw on charts
            I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.

            Please let us know if there are any other ways we can help.
            Attached Files
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Hello onnb1,

              This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


              SFT-1793


              Please let us know if there is any other way we can help.
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_JessicaP View Post
                Hello onnb1,

                This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


                SFT-1793


                Please let us know if there is any other way we can help.
                What's the status of this request? I'm running into issues where DrawObjects.Count is always 0 when I'm using an indicator inside a strategy. My Draw.Diamond's are being rendered but the Count is zero in both the indicator and strategy instances. I'm using NT8.
                Last edited by stoner; 10-27-2019, 08:20 PM. Reason: Specifying the version.

                Comment


                  #9
                  Hello stoner,

                  Thank you for your note.

                  There is no updated information available for the status of this request, only that we are still tracking user interest. I've added a vote for you to this request.

                  As for your question, are you using AddChartIndicator to associate the indicator with the chart explicitly, or how are you adding the indicator to the chart? I'd like to invite you to write into our support team inbox at platformsupport[at]ninjatrader[dot]com so we don't hijack this thread. In your email, please include any relevant code samples and include a link to this thread, with 2317786 ATTN Kate W in the Subject line.

                  Thanks in advance; I look forward to assisting you further.
                  Kate W.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by kujista, Today, 05:44 AM
                  2 responses
                  11 views
                  0 likes
                  Last Post kujista
                  by kujista
                   
                  Started by trilliantrader, Today, 08:16 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post trilliantrader  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  9 responses
                  174 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by funk10101, Today, 08:14 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post funk10101  
                  Started by adeelshahzad, Today, 03:54 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X