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 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