Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Read Text drawing object from chart

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

    Read Text drawing object from chart

    I am trying to write a strategy that will do something based on reading a text object that is drawn on the chart. I'm having trouble getting it to read the actual text drawn on the chart. I cannot figure out how to get this set. Here is a snippet of the code....

    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;

    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if (draw is DrawingTools.Text)
    {
    // Indicates if this is a manually drawn or script generated line
    Print("Text is: " + draw);
    }
    }


    This is what I'm getting in the output window

    Text is: NinjaTrader.NinjaScript.DrawingTools.Text

    #2
    Hello mlarocco,

    Please note the sticky at the top of this archived forum landing page.

    We have moved! The legacy forum is now in view‑only mode and existing posts will remain accessible for reference, but no new threads or replies can be added. Join the conversation on our new NinjaTrader Community Forums and read our frequently asked questions to learn more.


    If you would like this inquiry to be to the NinjaTrader community, please join our new discourse forum and create a new post.
    This forum provides an outlet for our user community to interact with our technical support team and fellow traders. For additional interactive training resources, be sure to check out our Free Daily Webinars and Video Library.


    If you would like assistance from NinjaTrader Support team, please send an email to scriptingsupport [at] ninjatrader.com.



    That said, cast as a Text object then print the <object>.Text property.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
    Last edited by NinjaTrader_ChelseaB; 06-20-2025, 12:00 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    41 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    64 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X