• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Text indicator

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

    Text indicator

    Is there a way that my indicator instead of having some sort of shape (Hash, square, etc.) will be a text which i can determine its value?

    Thank in advance

    #2
    Hello kiss987,

    You may use the DrawText() and DrawFixedText() to be able to draw text on your chart using an Indicator.

    DrawText: http://www.ninjatrader.com/support/h...l?drawtext.htm

    DrawFixedText: http://www.ninjatrader.com/support/h...wtextfixed.htm
    JCNinjaTrader Customer Service

    Comment


      #3
      Atr

      Hi guys!
      can someone help me to plot the ATR value on the right-down corner.
      Thank you

      Comment


        #4
        Hello chema2200,

        Thank you for your post.

        Below is a simple example of displaying the text of the 14 period ATR on the bottom right of the chart:
        Code:
                protected override void OnBarUpdate()
                {
        			DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight);
                }
        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          thank you so much.

          I have inserted inside the the ATR indicator code but I can´t see the results on the charts...Do you know what is wrong?
          thank you again for your help.

          ....
          /// <summary>
          /// Called on each bar update event (incoming tick)
          /// </summary>
          protected override void OnBarUpdate()
          {
          if (CurrentBar == 0)
          Value.Set(High[0] - Low[0]);
          else
          {
          DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight);
          double trueRange = High[0] - Low[0];
          trueRange = Math.Max(Math.Abs(Low[0] - Close[1]), Math.Max(trueRange, Math.Abs(High[0] - Close[1])));
          Value.Set(((Math.Min(CurrentBar + 1, Period) - 1 ) * Value[1] + trueRange) / Math.Min(CurrentBar + 1, Period));
          }
          }

          #region Properties
          /// <summary>
          /// </summary>

          .....



          Originally posted by NinjaTrader_PatrickH View Post
          Hello chema2200,

          Thank you for your post.

          Below is a simple example of displaying the text of the 14 period ATR on the bottom right of the chart:
          Code:
                  protected override void OnBarUpdate()
                  {
                      DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight);
                  }
          Please let me know if you have any questions.

          Comment


            #6
            Hello chema2200,

            Thank you for your response.

            Have you compiled the indicator since adding the change to the code? Right click in the NinjaScript Editor and select Compile.

            I would recommend creating a new indicator with the original ATR's code and just add in the code I referred to.
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              Yes, I did it. Now I cannot open the platform...

              Originally posted by NinjaTrader_PatrickH View Post
              Hello chema2200,

              Thank you for your response.

              Have you compiled the indicator since adding the change to the code? Right click in the NinjaScript Editor and select Compile.

              I would recommend creating a new indicator with the original ATR's code and just add in the code I referred to.

              Comment


                #8
                Hello Chema,

                Thank you for sending your note to us at platform support.

                Please respond to the e-mail I sent so we may investigate this matter further.
                Patrick H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TazoTodua, Today, 03:01 PM
                2 responses
                10 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Mykro, Today, 02:16 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by tonynt, Today, 02:06 PM
                3 responses
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by itrader46, Today, 01:53 PM
                2 responses
                8 views
                0 likes
                Last Post itrader46  
                Started by maindoor, Today, 01:06 PM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Working...
                X