Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Working with fonts

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

    Working with fonts

    Hi,Support and All,

    Could you guys please assist me with the fonts?I want to make the text on the chart a bit bigger and bolder.

    Here is an example of the Draw Text command:

    DrawText("Text Lower"+CurrentBar, "NT", 0, Low[0]+-textOffset*TickSize, textColorDown);

    How do i make the "NT'' text marker bolder and bigger/smaller?

    Thank you

    #2
    Hello outsource,

    Thanks for your post.

    You will need to use the drawtext overload that gives you the ability to specify the font.

    DrawText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity)

    Here is the full helguide reference: http://ninjatrader.com/support/helpG.../?drawtext.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello outsource,

      Thanks for your post.

      You will need to use the drawtext overload that gives you the ability to specify the font.

      DrawText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity)

      Here is the full helguide reference: http://ninjatrader.com/support/helpG.../?drawtext.htm
      Hi,Paul,

      thanks for your reply.I`m aware of that Draw Text guide page,but i`d need an example.Is there any code snippet with example you could provide?

      Thank you

      Comment


        #4
        Hello outsource,

        Thanks for your reply.

        Here is an example and I've attached its output.

        DrawText ("tag1", true, "Outsource test", 0, Low[0] - 5 * TickSize, 0, Color.Red, new Font ("Bookman Old style", 24), StringAlignment.Center, Color.Black, Color.Yellow, 5);
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Paul View Post
          Hello outsource,

          Thanks for your reply.

          Here is an example and I've attached its output.

          DrawText ("tag1", true, "Outsource test", 0, Low[0] - 5 * TickSize, 0, Color.Red, new Font ("Bookman Old style", 24), StringAlignment.Center, Color.Black, Color.Yellow, 5);
          hi,Paul,

          how do i change the font size and style,etc..,via indicator properties?Or it`s fixed?

          Comment


            #6
            Hello outsource,

            Thanks for your reply.

            I've created and attached a short working example (indicator) of how the Font and its properties can be made available in the user interface panel. It incorporates the previous DrawText example.

            To Import

            Download the NinjaScript to your desktop, keep it in the compressed .zip file.
            From the Control Center window select the menu File> Utilities> Import NinjaScript
            Select the downloaded .zip file
            NinjaTrader will then confirm if the import has been successful.
            Once installed, you may add the indicator to a chart by:
            Right click you chart > indicators > Select the Indicator from the list on the left > New > OK
            Attached Files
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Paul View Post
              Hello outsource,

              Thanks for your reply.

              I've created and attached a short working example (indicator) of how the Font and its properties can be made available in the user interface panel. It incorporates the previous DrawText example.

              To Import

              Download the NinjaScript to your desktop, keep it in the compressed .zip file.
              From the Control Center window select the menu File> Utilities> Import NinjaScript
              Select the downloaded .zip file
              NinjaTrader will then confirm if the import has been successful.
              Once installed, you may add the indicator to a chart by:
              Right click you chart > indicators > Select the Indicator from the list on the left > New > OK
              Thanks,Paul,

              that did.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Barry Milan, Yesterday, 10:35 PM
              5 responses
              16 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by DanielSanMartin, Yesterday, 02:37 PM
              2 responses
              13 views
              0 likes
              Last Post DanielSanMartin  
              Started by DJ888, 04-16-2024, 06:09 PM
              4 responses
              13 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by terofs, Today, 04:18 PM
              0 responses
              11 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by nandhumca, Today, 03:41 PM
              0 responses
              8 views
              0 likes
              Last Post nandhumca  
              Working...
              X