Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing a lines colour programatically

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

    Changing a lines colour programatically

    Hello,

    I have written something simple to change the colour of a manually drawn horizontal line. It works fine. The query I have, is, this is on Globally drawn objects. The colour on the chart the indicator is on, the line updates fine. On the other charts with the same line (It is a global drawn object), the colour does not change. So, it seems when I change the colour, no event is triggered to initiate this update on other charts. Is there a manual way to poke NT into doing this?

    Thanks.

    #2
    Hello pjsmith,

    Thank you for the question.

    I am currently unaware of a way to invoke this on the other chart as there is no exposed NinjaScript notification method like this. You would essentially need to re create the line when this action occurs to have the other chart update the new instance. Calling the Draw. method with the same tag name would replace the line each time it is called updating the chart however you cannot do this for a manually drawn line.

    One workaround may be to set the lines color to transparent to hide it, and draw a new line from the script using the Draw method so you can have finer control over the object instance. The overload set which uses the isGlobal bool could be used to make it global.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X