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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        174 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        329 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        252 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        355 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        182 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X