NexusFi: Find Your Edge


Home Menu

 





NT7 Better Arrows and Other Symbols


Discussion in NinjaTrader

Updated
    1. trending_up 4,722 views
    2. thumb_up 9 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 3 attachments




 
Search this Thread

NT7 Better Arrows and Other Symbols

  #1 (permalink)
 
hunter548's Avatar
 hunter548 
western ny
 
Experience: Intermediate
Platform: ninjatrader
Broker: Amp Futures/CQG
Trading: 6E, ES
Posts: 102 since Nov 2009
Thanks Given: 197
Thanks Received: 93

I like darker backgrounds with white text. When using the DrawArrowUp() or DrawArrowDown() functions, I found out that NT7 automatically colors all symbol outlines to match the text color, hence white in this case. The same thing applies to other symbols like dots and triangles using similar DrawDots() and DrawTrianglesUp/Down() functions.

After spending some time researching the issue, I figured out the syntax needed to add solid color symbols to any NT7 indicator using DrawText(). Lacking a specific example to plagarize, I ultimately put the pieces together to create the solid arrows I wanted.

I thought I'd share exactly what code I wrote and where it goes within a program to make it easier to plagarize (and also so I could find it to use later myself). I started with TMFT's DualCCI_Beta_V2 and changed the dots displayed to arrows.

The updated indicator I renamed DualCCI_Beta_V3. If you open it for edit, you'll see where I commented what I changed or added. I'm not a programmer, so you may find mistakes I made, but I dabble a lot and it does what I wanted with the arrows.

The following hits the highlights of what I changed and/or added:

#region Variables

private bool drawArrowOnPricePanel = true;
private Color arrowUpColor = Color.DodgerBlue;
private Color arrowDnColor = Color.Red;

private System.Drawing.Font textFont;

protected override void OnBarUpdate()

textFont = new Font("Wingdings 3", 20);


DrawText("UpSymbol" + CurrentBar, true, "#", 0, Low[0]-pSeparation*TickSize, 0, arrowUpColor, textFont, StringAlignment.Center, Color.Empty, Color.Empty, 10);


DrawText("DownSymbol" + CurrentBar, true, "$", 0, High[0]+pSeparation*TickSize, 0, arrowDnColor, textFont, StringAlignment.Center, Color.Empty, Color.Empty, 10);

---- The # and $ characters define the Arial to Wingdings 3 conversion for the up and down arrow symbols I chose. I attached an excel spreadsheet to show other character possibilities and make it easier to convert to different symbol by substituting a different character.----

#region Properties
Lines 398 - 442
Changed dot references to Arrow references so you can choose to display arrows or not and change their color.
****************

The following link gives gives a Ninjatrader link to how to use the DrawText() function.

Hma rising and falling arrows - Page 3 - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

This link gives an indicator that shows the end result of using DrawText() with lots of arrow options and text boxes.



The following pic shows how the arrows look:

Attached Thumbnails
Click image for larger version

Name:	Snap1.PNG
Views:	370
Size:	33.5 KB
ID:	33283  
Attached Files
Elite Membership required to download: DualCCI_beta_v3.cs
Elite Membership required to download: WINDINGS3 CONVERSION.xls
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #3 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,714 since May 2010
Thanks Given: 203
Thanks Received: 2,686


If I recall, instantiating new fonts is expensive and should be avoided thus, you should remove "textFont" from OnBarUpdate() and assign it in OnStartUp() only once.

Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on March 10, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts