• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get drawn objects

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

    Get drawn objects

    Hi

    How can I get by code the drawing objects which were placed on my screen by GUI. For example, if I have vertical line, I would like to know its date and color.

    Thanks

    #2
    Hello kiss987,
    Thanks for your post.

    You will need to loop through the drawing objects on your chart to find the vertical lines. Then to get the color in a format other than HEX you will need to use Reflection as seen in the attached sample.

    The following sample will look for a vertical line to be manually drawn and print the time of the line as well as the color to the NinjaScript Output window.

    Let me know if you have any questions.
    Attached Files
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      My charts crash unfortunately after spending several hours drawing objects during a trading session and I lose everything. Are the objects stored in xml anywhere or is it feasible to use this as a starting point for a script that tracks my drawing objects on the chart I am working on so after a 'crash', I can add the script to a new chart and reload my drawing objects?

      Comment


        #4
        Your drawing objects are stored in XML inside your workspace. So you would need to save your workspace to retrieve that information. You could also write the output from the indicator to a file using StreamWriter

        Help Guide - Using StreamWriter to write to a text file

        If your platform is crashing I suggest writing in to PlatformSupport(AT)NinjaTrader(DOT)com and having a technician look at your log and trace files.
        Josh G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by saltminer, Today, 05:19 PM
        0 responses
        3 views
        0 likes
        Last Post saltminer  
        Started by martyn73, Today, 04:18 PM
        0 responses
        2 views
        0 likes
        Last Post martyn73  
        Started by aprendiz, Today, 03:42 PM
        0 responses
        2 views
        0 likes
        Last Post aprendiz  
        Started by 1001111, Today, 09:10 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by usero86, Today, 06:02 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X