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

How to change the color of a horizontal line?

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

    How to change the color of a horizontal line?

    I have several charts of the same instrument. In all graphs there is a global horizontal line. I want to use the script to change the color of the line, but it only changes on the current chart and does not change on others, although the line is global and should be shown on all charts.

    my code:
    Code:
    if(co is ChartHorizontalLine) 
    {
        oneHorizontalLine = (co as ChartHorizontalLine);     
        if( Close[0] >  oneHorizontalLine.StartY )         
        {
              oneHorizontalLine.Pen.Color = Color.DarkGreen;  
        }
        else 
        {
              oneHorizontalLine.Pen.Color = Color.Maroon;  
        }
    }

    #2
    Hello KeenEdge,

    Unfortunately, changes to global drawing objects are not propagated to the other generated objects on other charts.

    There is an open feature request for this tracked with ID# SFT-4438.
    I will add your vote to this request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Unfortunately, changes to global drawing objects are not propagated to the other generated objects on other charts.
      I can change the color of the line if I use the menu. but I can't change it using the script. why? what is the problem? is there any way to fix this problem?

      Comment


        #4
        Hello KeenEdge,

        I'm not aware of a workaround at this time. This thread will remain open for any community members that would like to assist.

        Your vote has been added to feature request SFT-4438 for our developers to consider adding support for this.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Below is a link to a forum post with a similar inquiry, but a different request.
        https://ninjatrader.com/support/foru...47#post1039447
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hmm, I've been using: AddLine(Brushes.PowderBlue, Threshold, "ThresholdHi");

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by selu72, Today, 02:01 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by WHICKED, Today, 02:02 PM
          2 responses
          10 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by f.saeidi, Today, 12:14 PM
          8 responses
          21 views
          0 likes
          Last Post f.saeidi  
          Started by Mikey_, 03-23-2024, 05:59 PM
          3 responses
          51 views
          0 likes
          Last Post Sam2515
          by Sam2515
           
          Started by Russ Moreland, Today, 12:54 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X