PDA

View Full Version : Resizing Arrows, Dots.....


TAJTrades
12-31-2007, 01:30 PM
I thought I read in one of these post that there was a way to Resize Arrows and Dots. I have searched the threads in this forum with no luck. I even used my favorite keyboard key "F1" and no luck there. And I probably have not used the correct search term(s). Is there a way to use DrawText in combination with Character Codes to create Arrows and other symbols on a chart? If so, how? And where can I get a list of the character codes.

Thanks

NinjaTrader_Josh
12-31-2007, 01:35 PM
I don't know about resizing DrawDot() etc, but if you use DrawText with symbols you can resize those through the selection of the font size. Here is an indicator that actually uses this exact method: http://www.ninjatrader-support.com/vb/showthread.php?t=2919

To find a character map I just used your computer's charmap. Start Menu -> Run -> charmap

TAJTrades
12-31-2007, 02:10 PM
Many Thanks. Will review the code.

TAJTrades
01-03-2008, 04:44 AM
I am not a professional software developer but I do play one in my free time (LOL). I thought I would contribute to the forum instead of take,take,take.

I imported the indicator below and struggled to get it working as is. Below is my solution to making it work.

You must use the exact Font Name as displayed in the Upper Left DropDown of the "charmap". On my computer I do not have "Wingdings 3" but I do have "Wingdings"
// textFont = new Font("Wingdings 3",markersize);
textFont = new Font("Wingdings",markersize);
After making that simple change the below indicator worked fine.


Important things to remember if adding custom arrows, dots, triangles and other things to your charts...

In the
#region Variables
you must have this line of code
private System.Drawing.Font textFont;
In the protected override void OnBarUpdate()
you need to define the font with
textFont = new Font("Wingdings",markersize);
"Wingdings" can be changed to any Font listed in your charmap. "markersize" is just the font size and can be an variable or hard coded ( insert any integer instead of variable " markersize".

In the DrawText line of code you can insert the arrow, dot, or any other character available by using the copy feature in the charmap and replacing the "‡" with "new character"

DrawText("High"+barcounter.ToString(),"‡",period,High[period]+TickSize,color, textFont,..............

So, on my charts I use a large green arrow when all conditions are true for a Buy Entry, a smaller light green arrow when 3 out of 4 conditions are true for a buy entry and a small black arrow when 2 of 4 conditions are true. I will still take the entry signal for all arrows but will keep a tighter leash on the 2 and 3 true condition entries.

Hope this helps someone.




I don't know about resizing DrawDot() etc, but if you use DrawText with symbols you can resize those through the selection of the font size. Here is an indicator that actually uses this exact method: http://www.ninjatrader-support.com/vb/showthread.php?t=2919

To find a character map I just used your computer's charmap. Start Menu -> Run -> charmap

KBJ
01-03-2008, 06:39 PM
I don't have a current use for this, but I'm definitely bookmarking it because it looks like something that will be very helpful.

Thanks for passing it along.