Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript Horizontal Line All Charts

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

    Ninjascript Horizontal Line All Charts

    Hello,
    I currently use the following on a 30M chart and would like have the horizontal line draw across all charts in the workspace, same as manual drawing..
    Draw.HorizontalLine(this, @"30M Median Horizontal Line", false, Medians[1][0], Brushes.Yellow, DashStyleHelper.DashDotDot, 2);

    Easy way to do this with adding data series or 30M data to all charts?

    Thanks in advance.

    #2
    Hello rcmcd,

    You can use the global overload for objects which support it.


    Code:
    Draw.HorizontalLine(NinjaScriptBase owner, string  tag, double y, bool isGlobal, string templateName)
    Please let me know if I may be of further assistance.

    Comment


      #3
      Is it correct that if i want to specify isGlobal, I cannot specify the brush color? That is blowing my mind

      Comment


        #4
        Hello iantriestrading,

        Yes in that case the overload only allows for a pre saved template to be used. You can manually set the properties on the drawing object as well.

        HorizontalLine myLine = Draw.HorizontalLine(this, "tag1", true, 1000, Brushes.Black, true);
        myLine.Stroke = new Stroke(Brushes.Gold, 1);​

        Comment


          #5
          Thanks. I learned more about overloads and realized I can just use a template. Not a big deal after all.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          213 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          127 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          145 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          229 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          191 views
          0 likes
          Last Post CarlTrading  
          Working...
          X