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

Consistent Bar Labelling

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

    Consistent Bar Labelling

    I am looking for suggestions for how to have text, arrows, etc, that are plotted either under or over price bars to be a consistent distance above or below the respective bars.

    I have been using High+ticksize*(some number) or Low-ticksize*(some number), but I find the distances are much different if I am looking at a security priced at $100 vs a $5 stock even if the tick size for both is .01. Should I just be using pixels instead?

    Also, I can't seem to find a definition for aito-scale, what does autoscale for DrawText mean?

    Thanks for the help.

    #2
    Originally posted by Grasul View Post
    I am looking for suggestions for how to have text, arrows, etc, that are plotted either under or over price bars to be a consistent distance above or below the respective bars.

    I have been using High+ticksize*(some number) or Low-ticksize*(some number), but I find the distances are much different if I am looking at a security priced at $100 vs a $5 stock even if the tick size for both is .01. Should I just be using pixels instead?

    Also, I can't seem to find a definition for aito-scale, what does autoscale for DrawText mean?

    Thanks for the help.
    Currently only DrawText() has a pixel offset as part of its signature. I have asked for the same to be extended to all draw objects, and the request has a tracking number, but when it will happen is anybody's guess.

    ref: http://www.ninjatrader.com/support/f...drawtext+pixel


    Actually, I was wrong; the suggestion does not have a tracking number. That is probably because the request may have predated the tracking system that they are using.
    Last edited by koganam; 10-26-2011, 07:40 PM. Reason: Corrected statement about tracking number

    Comment


      #3
      Hello Grasul,

      As Koganam mentioned, there is no support for drawing a pixel offset for these objects.

      However, I will contact development to see if we can locate a tracking ID for this request.

      AutoScale for draw text would have the same effect of auto scale on any of the draw objects. When this is set to true, it will ensure the chart will always consider this object when setting the scale of your chart. Ie., it will always be visible.
      MatthewNinjaTrader Product Management

      Comment


        #4
        Originally posted by NinjaTrader_Matthew View Post
        Hello Grasul,

        As Koganam mentioned, there is no support for drawing a pixel offset for these objects.

        However, I will contact development to see if we can locate a tracking ID for this request.

        AutoScale for draw text would have the same effect of auto scale on any of the draw objects. When this is set to true, it will ensure the chart will always consider this object when setting the scale of your chart. Ie., it will always be visible.
        Here's a suggestion. Instead of drawing arrows or triangles or dots, draw the text symbols of arrows, triangles, dots, etc. I use the default MicroSoft Winding fonts to draw these symbols using DrawText(). In the following example, "\u008B" is the hex code for one of the "Winding 3" font, Up Arrow. This should allow you to use a pixel offset.

        System.Drawing.Font symbolFont= new Font("Wingdings 3", 48,System.Drawing.FontStyle.Bold);
        DrawText("Buy"+CurrentBar, false, "\u008B", 0, Low[0], -50, Color.Blue, symbolFont, StringAlignment.Center,Color.Empty, Color.Empty, 0);
        Last edited by monpere; 10-27-2011, 10:28 AM.

        Comment


          #5
          Adding a pixel offset as part of the signature for all draw objects is tracked using ID #209
          MatthewNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Matthew View Post
            Adding a pixel offset as part of the signature for all draw objects is tracked using ID #209
            How would I use this information?

            Comment


              #7
              Hello,

              You can ask for an update on these feature requests by email suppor[at]ninjatrader[dot]com or by checking the release notes with each release and checking for updates on these items.

              There are no updates for this particular items at this time.
              MatthewNinjaTrader Product Management

              Comment


                #8
                Originally posted by monpere View Post
                Here's a suggestion. Instead of drawing arrows or triangles or dots, draw the text symbols of arrows, triangles, dots, etc. I use the default MicroSoft Winding fonts to draw these symbols using DrawText(). In the following example, "\u008B" is the hex code for one of the "Winding 3" font, Up Arrow. This should allow you to use a pixel offset.

                System.Drawing.Font symbolFont= new Font("Wingdings 3", 48,System.Drawing.FontStyle.Bold);
                DrawText("Buy"+CurrentBar, false, "\u008B", 0, Low[0], -50, Color.Blue, symbolFont, StringAlignment.Center,Color.Empty, Color.Empty, 0);
                Monpere, do you have a reference for associating the Wingdings 3 character to a hex code? I found http://www.alanwood.net/demos/wingdings.html for some but not Wingdings 3.

                Also, where would I put the statement above in my indicator? I'm pretty new to C#, does that statement go in variables and then anytime I want to use it, I'm using a font named symbolFont in your example?

                Thanks for the help.

                Comment


                  #9
                  I found another thread that had some good information on this topic:

                  Support for the development of custom automated trading strategies using NinjaScript.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Segwin, 05-07-2018, 02:15 PM
                  14 responses
                  1,789 views
                  0 likes
                  Last Post aligator  
                  Started by Jimmyk, 01-26-2018, 05:19 AM
                  6 responses
                  837 views
                  0 likes
                  Last Post emuns
                  by emuns
                   
                  Started by jxs_xrj, 01-12-2020, 09:49 AM
                  6 responses
                  3,293 views
                  1 like
                  Last Post jgualdronc  
                  Started by Touch-Ups, Today, 10:36 AM
                  0 responses
                  13 views
                  0 likes
                  Last Post Touch-Ups  
                  Started by geddyisodin, 04-25-2024, 05:20 AM
                  11 responses
                  63 views
                  0 likes
                  Last Post halgo_boulder  
                  Working...
                  X