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

Varying Dot size not working

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

    Varying Dot size not working

    I have an indicator that places a dot on a bar under specified conditions. The dots display on the bar location specified when conditions are met e.g. dot on the close of the bar.

    However I cannot get the size of the dot to change even when I change the dot size in the plot properties dialog box and apply the change. The dot size does not change.

    Code

    Add(new Plot(Color.FromKnownColor(KnownColor.GreenYellow), PlotStyle.Dot, "Plot0"));

    DrawDot("Plot0"+CurrentBar, true, 0, Close[0], Color.GreenYellow);

    It is as if the dot cannot made bigger than the bar width.

    How do I fix this?

    #2
    Hello skiguy,

    Thank you for your post.

    This is unfortunately not possible. You can however use DrawText() and use a font style like wingdings and then change the font size to change the dot's size.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello skiguy,

      Thank you for your post.


      This is unfortunately not possible. You can however use DrawText() and use a font style like wingdings and then change the font size to change the dot's size.
      But can I control where there text is displayed?

      If not where would the text be placed?

      Comment


        #4
        You could also use a separate plot. If your specified condition is true you can set that plot to the value (Low[0] - TickSize). If your condition is false, you can simply reset that plot, which will result in no plot for all bars, for which the condition is not met.

        You can then set your plot to PlotStyle Dot and modify its size as needed.

        Comment


          #5
          Originally posted by skiguy View Post
          But can I control where there text is displayed?

          If not where would the text be placed?
          You can place your text (dot created with Wingdings) below the low of your bar, by setting y = Low[0] and selecting a negative pixel offset. For further details please see NinjaTrader help file "DrawText()".

          Comment


            #6
            Here is a sample chart. I have used a custom plot to draw triangles below the bar low. The triangles were created with wingdings, but you can also use dots instead.
            Attached Files

            Comment


              #7
              Hello skiguy,

              Thank you for your response and thank you to Harry for their assistance.

              You can also use DrawTextFixed() to place the text at a fixed point on the chart: http://www.ninjatrader.com/support/h...wtextfixed.htm

              Comment


                #8
                Further clarification

                Originally posted by Harry View Post
                You can place your text (dot created with Wingdings) below the low of your bar, by setting y = Low[0] and selecting a negative pixel offset. For further details please see NinjaTrader help file "DrawText()".
                Thanks for the replies. To be honest I am not clear on what is being shown despite looking up the help text etc.

                Could some please post a clear simple generic example. Let's say if c > o place resizable text/symbol on the close of the bar.

                Please include all the code required i.e. #region Variables etc.

                From there I can probably work out how to amend my code to get the result I want.

                Comment


                  #9
                  Hello skiguy,

                  Thank you for your response.

                  There is not much more to it than the following in the OnBarUpdate() method:
                  Code:
                          protected override void OnBarUpdate()
                          {
                  			if(Close[0] > Open[0])
                  				DrawText("tag", true, "l", 0, Close[0], 0, Color.Black, new Font("Wingdings", 12), StringAlignment.Center, Color.Black, Color.Black, 0);
                  		}
                  Please let me know if you have any questions.

                  Comment


                    #10
                    is that all

                    Originally posted by NinjaTrader_PatrickH View Post
                    Hello skiguy,

                    Thank you for your response.

                    There is not much more to it than the following in the OnBarUpdate() method:
                    Code:
                            protected override void OnBarUpdate()
                            {
                                if(Close[0] > Open[0])
                                    DrawText("tag", true, "l", 0, Close[0], 0, Color.Black, new Font("Wingdings", 12), StringAlignment.Center, Color.Black, Color.Black, 0);
                            }
                    Please let me know if you have any questions.
                    Thanks for that. So no #region Variables required?

                    Comment


                      #11
                      Hello skiguy,

                      Thank you for your response.

                      There is no need for any variables in the line of code I provided.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
                      20 responses
                      61 views
                      0 likes
                      Last Post cmtjoancolmenero  
                      Started by llanqui, Today, 11:13 AM
                      4 responses
                      6 views
                      0 likes
                      Last Post llanqui
                      by llanqui
                       
                      Started by samish18, 04-17-2024, 08:57 AM
                      27 responses
                      118 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by ETFVoyageur, 04-30-2024, 02:04 PM
                      7 responses
                      45 views
                      0 likes
                      Last Post eDanny
                      by eDanny
                       
                      Started by f.saeidi, Today, 07:07 AM
                      5 responses
                      16 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X