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