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

Dotsize/character size

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

    Dotsize/character size

    Hi guy, I was wondering what determine the size of dots. For example I put an indicator on the first chart and the dots are nice and big. I put exactly the same indicator on the second chart and the dots are very small. I want them big like the other one.

    This is the code I am using:

    if (drawonbars)DrawOnPricePanel = false;DrawDot("My text89" + CurrentBar,true,0,20,Color.Magenta);DrawOnPricePanel = true;

    Any ideas on this one would be appreciated.

    Thanks
    DJ
    Attached Files
    Last edited by djkiwi; 10-07-2011, 11:53 AM.

    #2
    Hello,

    Thanks for the forum post.

    These dots look the same size to me.

    Comment


      #3
      Originally posted by djkiwi View Post
      Hi guy, I was wondering what determine the size of dots. For example I put an indicator on the first chart and the dots are nice and big. I put exactly the same indicator on the second chart and the dots are very small. I want them big like the other one.

      This is the code I am using:

      if (drawonbars)DrawOnPricePanel = false;DrawDot("My text89" + CurrentBar,true,0,20,Color.Magenta);DrawOnPricePanel = true;

      Any ideas on this one would be appreciated.

      Thanks
      DJ
      If you really want fine control over the size of your dots, draw them as text using a ".". That way you can actually size them.

      Comment


        #4
        Hi Koganam thanks for the solution. Brett I see your point the dots were about the same on the picture. Another issue on this one is getting the text to appear on the far left of the chart at a Y location of my choice. I did find something from Koganam that shows how to get the far left sorted out but still having problems with the Y. So far I have:

        int Yaxis = ChartControl.CanvasTop;
        int LeftSideOfScreen = ChartControl.FirstBarPainted;

        DrawText("Test", false, "Text to show at left side of screen", (CurrentBar - LeftSideOfScreen), (Yaxis),-20, Color.White, new Font("Arial" , 12), StringAlignment.Near, Color.Red, Color.Red, 5);

        DrawText("Test1", false, "Text to show at left side of screen", (CurrentBar - LeftSideOfScreen), (Yaxis),-40, Color.White, new Font("Arial" , 12), StringAlignment.Near, Color.Red, Color.Red, 5);

        What I'm expecting this to do is draw the 1st lot of example text 20 pixels down from the top of the canvas. Next one should draw 40 pixels down. The problem is the text does not show up but when I remove the Yaxis and replace with it Close[0] I can see the text. So any ideas on how to specify the Y value as a value from the top of the chart would be most useful. I have been using DrawtextFixed but am finding it quite limited.

        Thanks
        DJ
        Last edited by djkiwi; 10-08-2011, 04:15 PM.

        Comment


          #5
          Hello,

          Right, y axis drawing that is not attached to price is not supported by default in NinjaTrader.

          This would require overriding the plot method.

          There is a very short example on this in the Control Center->Tools->Edit NinjaScript->Strategies->SamplePlotOverride.

          Let me know if I can be of further assistance.

          Comment


            #6
            Sample

            Thanks Brett, I checked all my files and do not have a copy of this SamplePlotOverride. Would you be able to attach this by any chance?

            Thanks
            DJ

            Comment


              #7
              Hello,

              Sorry, I mispoke.

              Its under Tools->Edit NinjaScript->Indicators->CustomPlotSample.

              Let me know if I can be of further assistance.

              Comment


                #8
                Hi Brett, thanks for posting that link. That customplot code was very good and powerful. I have another 2 questions on it though. Firstly, I have drawn the attached box (1st pic). I am trying to set the opacity because it is too bright and am having problems doing this. The second screen shot shows line 2023 which fills the box in cyan and then line 2024 is what I'm trying to use to set opacity based on code found from the net but it doesn't compile.

                The second point is could you please advise how to put a formula instead of text into the string. For example I have this formula to put the V in one of the boxes:

                graphics.DrawString("V", textFont, textBrushStrong, bounds.X + 1601, bounds.Y + 172, stringFormatCenter);

                What I'm trying to do is instead of using text I'm trying to substitute The "V" with Closes[26][0]. This does not work or even compile. For example:

                graphics.DrawString(Closes[26][0], textFont, textBrushStrong, bounds.X + 1661, bounds.Y + 172, stringFormatCenter);

                I tried a straight DrawText and just DrawString without the graphics bit at the front with these bounds but that doesn't seem to work either. I need the bounds bit to place it where I need in the boxes.

                Any ideas/links on how to set opacity for a rectangle fill and the correct type of formula to draw a string with bounds would be appreciated.

                Thanks. DJ
                Attached Files
                Last edited by djkiwi; 10-14-2011, 12:23 AM. Reason: Another issue arisen

                Comment


                  #9
                  Hello,


                  Thank you for your note.


                  Glad to hear your working in the Plot Override successfully.

                  Unfortunately anything in Plot Override is not supported however.

                  Problem is for sure with the second parameter though. Wy are you setting this to backColor?

                  May check out the MSDN article on this system drawing property will probably get you the information you need on this.

                  Also, I do not have any suggestions on the bounds question.

                  Let me know if I can be of further assistance.

                  Comment


                    #10
                    Drawonpanel

                    Thanks Brett. Another question is how do I remove all of the info on the chart? For example I have plotted this table on the CL chart and am getting CL info appearing. I don't want anything else on the chart apart from the indicator so wondering how do I turn off the main price panel?

                    Thanks
                    DJ
                    Attached Files

                    Comment


                      #11
                      Hello,

                      Only way to do this is to right click on chart->data series->change the wicks/colors/and outlines all to color Transparent.

                      Let me know if I can be of further assistance.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by WHICKED, Today, 12:45 PM
                      2 responses
                      18 views
                      0 likes
                      Last Post WHICKED
                      by WHICKED
                       
                      Started by GussJ, 03-04-2020, 03:11 PM
                      15 responses
                      3,276 views
                      0 likes
                      Last Post xiinteractive  
                      Started by Tim-c, Today, 02:10 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by Taddypole, Today, 02:47 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post Taddypole  
                      Started by chbruno, 04-24-2024, 04:10 PM
                      4 responses
                      51 views
                      0 likes
                      Last Post chbruno
                      by chbruno
                       
                      Working...
                      X