Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Drawing a line....

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

    Drawing a line....

    Hello,

    I want to develop a very simple indicator... But I cannot figure out how to do that....

    It must be easy, but I'm stuck.

    I just want to draw a vertical line on my chart x bars in the past....

    Please, can you help me ?
    Thank you very much.
    S.

    #2
    Hi jed77,
    You can use DrawVerticalLine() for your indicator, please see this link to its syntax - http://www.ninjatrader-support.com/H...ticalLine.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Oh ! Thank you Bertrand.
      It is working fine !
      But now I'm stuck in another problem....
      If I want to draw 2 lines ? I wrote that and the last one only appear on the chart...
      Code:
                  // To avoid the"index out of range" :
                  if (CurrentBar < 20)
                           return;
                  
                  // Draws  vertical lines
                  {
                  DrawVerticalLine("myTag", 9, Color.Black);
                  DrawVerticalLine("myTag", 14, Color.Red);
                  }
      Thx !
      J.

      Comment


        #4
        Just use another tag name for the second line, like myTag2...otherwise you will just 'grab' the old line and modify it instead of creating a new one.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          pfffff.... How stupid I am !!!!
          Thank you Bertrand.
          J.

          Comment


            #6
            you are welcome jed77, stupid is the wrong word, it's called learning
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thank you Bertrand You are very kind !

              Ok, the lines are plotted on the price panel.
              Is it possible to plot the lines on an indicator window ? Overlaying a Stochastic as an example ?
              Thx
              J.

              Comment


                #8
                If you want to draw objects elsewhere you need to set DrawOnPricePanel = false.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you very much Josh !
                  I'm learning many things again ! Very happy !

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by zstheorist, Today, 07:52 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post zstheorist  
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  149 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Started by mattbsea, Today, 05:44 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post mattbsea  
                  Started by RideMe, 04-07-2024, 04:54 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post RideMe
                  by RideMe
                   
                  Started by tkaboris, Today, 05:13 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post tkaboris  
                  Working...
                  X