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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          81 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          64 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          68 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          55 views
          0 likes
          Last Post CarlTrading  
          Working...
          X