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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,606 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    6 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    15 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X