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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    37 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X