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 Option Whisperer, Today, 09:05 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post Option Whisperer  
                  Started by cre8able, Yesterday, 01:16 PM
                  3 responses
                  11 views
                  0 likes
                  Last Post cre8able  
                  Started by Harry, 05-02-2018, 01:54 PM
                  10 responses
                  3,203 views
                  0 likes
                  Last Post tharton3  
                  Started by ChartTourist, Today, 08:22 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post ChartTourist  
                  Started by LiamTwine, Today, 08:10 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post LiamTwine  
                  Working...
                  X