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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    63 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    91 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    48 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    105 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    63 views
    0 likes
    Last Post PaulMohn  
    Working...
    X