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

Access Drawing Objects from third party indicator

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

    Access Drawing Objects from third party indicator

    Hi, is there an easy way to access a drawing object added to a chart via a third-party indicator? All functions for the indicator are accessed through a dll, and programatically obtaining information from the indicator does not appear to be feasible. Therefore, i am trying to obtain information (price, time, etc.) about the objects added to the chart. For example, a triangledown may be added when certain conditions are met. A triangleup may be added when other conditions are met. I have reviewed the following:



    however, when i attempt to access drawobjects.count for example and print the result, the result is always 0. I'm trying to find a way to return a list, with tags for example, for all triangleup objects currently displayed on the chart? Presumably, once I can access the object, the other information (price, time, etc.) should be accessible as well?

    Thank you

    #2
    Hello Renorail,

    This depends on how the other script is drawing, if it uses specifically drawing objects they could potentially be accessed however that would only be sometime after realtime. There is no reliable way to access drawing objects that are being drawn from a different script like this. While you can access them in realtime there is no expectation of timiing or being in sync in that use case. The link you provided would be that code which would be used. If the following code does not show the object at all being printed as a type, it cannot be accessed:

    Code:
    foreach (DrawingTool draw in DrawObjects.ToList())
    {
        Print(draw.GetType().FullName); 
    }

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

    Comment


      #3
      Thank you Jesse. I'll try the code and get back to you.

      Comment


        #4
        Hi Jesse, an example of what is printed by the above script is "OMD data missing: 225 12/2/2019 4:33:05 AM 5 1" - I'm assuming this means that the objects i am after cannot be accessed using the DrawObjects function.

        Comment


          #5
          Hello Renorail,

          The print i provided should be similar to: NinjaTrader.NinjaScript.DrawingTools.Line, using the count works as well it just has to be in realtime. What you provided seems to be related to a different print. If nothing was output in realtime, then yes it cannot be accessed from that collection. You can confirm your print is working by manually drawing an object on the chart and waiting for a realtime bar to close. The other item It may be rendering items using OnRender and in that case you could not access the drawings.

          I look forward to being of further assistance.

          JesseNinjaTrader Customer Service

          Comment


            #6
            Hello Renorail,
            Were you able to resolve the drawing objects issue ?
            I am looking for a solution to detect objects drawn an indicator and either send it to the alert logs or export it to either a text file, csv or xls file.
            Regards,
            AH

            Comment


              #7
              I think I ended up going a different direction…basically reproducing the 3rd party indicator logic.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NRITV, Today, 01:15 PM
              2 responses
              9 views
              0 likes
              Last Post NRITV
              by NRITV
               
              Started by frankthearm, Today, 09:08 AM
              8 responses
              31 views
              0 likes
              Last Post frankthearm  
              Started by maybeimnotrader, Yesterday, 05:46 PM
              5 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by quantismo, Yesterday, 05:13 PM
              2 responses
              20 views
              0 likes
              Last Post quantismo  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X