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

NinjaPriceAction

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

    NinjaPriceAction

    Hello,

    I have searched the whole support forum, and did few things myself, but I got stuck if I wanted to change the Great NinjaPriceAction indicator text to Bold instead of regular.
    Looks Bold is difficult to find.
    If anyone could help me out.
    So, I only want to change the text to Bold, that's all

    Johan
    Attached Files

    #2
    Hi jojotrader, you will need to play around with the 'font' used in the DrawText code - http://www.ninjatrader-support.com/H.../DrawText.html

    Here is the MSDN font reference page - http://msdn.microsoft.com/en-us/libr...wing.font.aspx
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello again,

      Yes, I looked also there, but nothing in terms of Tickness of text, I mean not any word about bold or regular....
      I know it exists, because there's a indicator that uses that kind of "thing".

      Johan.

      Comment


        #4
        Hi, if you remember in which indicator you saw it, just open up the source code, otherwise here is a link to MSDN and the Font.Bold property - http://msdn.microsoft.com/en-us/libr...font.bold.aspx
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Not working, I did variables, I did properties with good result.
          But if I enter textFont, it recieves error compilation...
          Look

          Johan.

          if (curhigh < prevhigh + offset && curhigh > prevhigh - offset)
          DrawText(
          "DT"+CurrentBar,"DT",barsback, High[barsback] + toffset, textFont,Color.Gold);

          Below the extra variables:

          private Font textFont = new Font("Courier", 11, FontStyle.Bold);
          private Color textColor = Color.Black;

          Below the extra Properties:

          [Description("Text Font")]
          [Category(
          "Visual")]
          public Font TextFont
          {
          get { return textFont; }
          set { textFont = value; }

          }

          What am I doing wrong, I know I'am close.....

          Johan.

          Comment


            #6
            What error do you get Johan?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Try this:

              #region Variables
              Other Stuff.....
              private int sizeText = 10;
              private System.Drawing.Font textFont;
              #endregion

              protected override void Initialize()
              {
              Other Stuff.....
              textFont = new Font("Arial",sizeText,FontStyle.Bold);
              }

              #region Properties
              Other Stuff.....
              No Reference To Font
              #endregion

              It works for me.

              Comment


                #8
                Hi Johan,

                the overloads for DrawText() allowing Font as an parameter require 10, 11 or 12 parameters. Your version of DrawText() contains 6. I am pretty sure that the compiler doesn't like that.

                Regards
                Ralph

                Comment


                  #9
                  Yes,

                  It constant refuses to compile,
                  Former post not working either....
                  Looks I'm stuck.

                  Johan

                  Comment


                    #10
                    Johan,

                    As Ralph suggested, you will want to use an overload with the proper amounts of parameters. You need to fill out all the parameters in this one:

                    Code:
                    DrawText(string tag, bool autoScale, string text, int barsAgo, double y, double yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color backColor, int opacity)
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      TAJTrader,

                      Compile no problem but not seeing any bold font in chart.
                      Even if I change everything, nothing seems to make any difference.

                      Johan

                      Thanks for your help anyway.

                      Comment


                        #12
                        Please post your latest version of code.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Strange, I can't export, even it is compiled...

                          Johan

                          Comment


                            #14
                            Any errors in Control Center logs? You could also just copy + paste relevant code segments.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              #region Variables
                              // Inputs with defaults
                              privateint strength = 3; // Default setting for Strength
                              privateint lookback = 50; // Default lookback period in Bars
                              privateint dtbstrength = 15; // Default double top and double bottom strength
                              privateint textoffset = 50; // Default setting Text Offset
                              private Font textFont = new Font("Courier", 11, FontStyle.Bold);

                              Here I would insert textFont:

                              if (curhigh < prevhigh + offset && curhigh > prevhigh - offset)
                              DrawText(
                              "DT"+CurrentBar,"DT",barsback, High[barsback] + toffset, Color.Gold);
                              elseif (curhigh > prevhigh)


                              Here are the properties:

                              [Description("Text Font")]
                              [Category(
                              "Visual")]
                              public Font TextFont
                              {
                              get { return textFont; }
                              set { textFont = value; }

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post bltdavid  
                              Working...
                              X