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

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 rdtdale, Yesterday, 01:02 PM
        2 responses
        15 views
        0 likes
        Last Post rdtdale
        by rdtdale
         
        Started by TradeSaber, Today, 07:18 AM
        0 responses
        7 views
        0 likes
        Last Post TradeSaber  
        Started by PaulMohn, Today, 05:00 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Working...
        X