Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Horizontal line at specific price

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

    Horizontal line at specific price

    Hi,

    If I wanted to place a horizontal line at a specific price what's the NinjaScript code required?

    Thank you in advance,
    suprsnipes

    #2
    You can work for example with DrawHorizaontalLine() for this - http://www.ninjatrader-support.com/H...ontalLine.html

    Code:
     
    DrawHorizontalLine("myLine", 1100, Color.Blue);
    Above snippet places a blue horizontal line at 1100 Y axis price level.

    Comment


      #3
      Hi Bertrand,

      Thanks for the reply.

      Can I please ask you one further question.

      How can I write a script so the indicator would draw a horizontal line at numbers ending in '00', like your example of 1100 above? Do you need to use an if statement?

      Appreciate the help,
      suprsnipes

      Comment


        #4
        Yes, you would need to custom code this with for example if statements in the indicator - of course you can also draw just multiple lines with different draw object tag Id's at various levels...i.e.

        Code:
         
        DrawHorizontalLine("myLine1", 1000, Color.Blue);
         
        DrawHorizontalLine("myLine2", 1100, Color.Blue);
         
        DrawHorizontalLine("myLine3", 1200, Color.Blue);

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X