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!
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
NinjaTrader
Drawing Arrows and Text in Price or Indicator area
Collapse
X
-
Drawing Arrows and Text in Price or Indicator area
I have created an indicator that I want to use DrawArrowUp, DrawArrowDown and DrawText to alert me to a condition where I want to enter a trade. When I use the Draw functions they print in the indicator area. I would like to print them in the price area with the price bars. How do I get the Draw functions to print in the price area?Tags: None
-
Bob, you could work with DrawOnPricePanel for this - http://www.ninjatrader-support.com/H...ceOnPanel.htmlBertrandNinjaTrader Customer Service
-
Great - you would need to use the extended DrawText overload offering a font parameter - http://www.ninjatrader-support.com/H.../DrawText.htmlBertrandNinjaTrader Customer Service
Comment
-
This is what I m using
private Font textFont = new Font("Arial", 8);
DrawText(CurrentBar.ToString() + "c", true, Open[0].ToString(), 0, High[0] + TickSize * 10, Color.HotPink, textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
How do I make the font bold?
Comment
-
I have a question about arrow and text placement. How is the location for the arrow and text figured?
I have seen examples using TickSize for placement on the price panel but the arrow seems to take a variable amount of ticks depending on what I am trading. The following code places the text just above the arrow on ES. For example the high is 1099.75, the point of the down arrow is 1100.25, the top of the arrow is 1101.25 and the bottom of the text is 1101.25 so the text is 10 ticks above the high. On TF I have a high of 621.7, the bottom of the arrow is 621.8, the top of the arrow is 622.0 and the bottom of the text is 622.3. That is only 6 ticks.
DrawArrowDown(CurrentBar.ToString() + "b", true, 0, High[1] + TickSize, Color.HotPink);
DrawText(CurrentBar.ToString() + "c", true, Open[0].ToString(), 0, High[0] + TickSize * 10, Color.HotPink, textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
I would also like to know what unit of measure is used for placement in the indicator panel.
ThanksLast edited by BobTN; 02-25-2010, 12:40 PM.
Comment
-
Thanks. You are correct. I found a coding error. I was using High[0] when I meant to use High[1].
Both of you have been very helpful. I just have one more question and then I swear I will leave you alone... at least until I have my next coding challenge. LOL
Is there any way to make the arrow wider for the DrawArrowUp or DrawArrowDown?
Comment
-
I am still having problems. I am using the following code
DrawOnPricePanel = true;
DrawArrowUp(CurrentBar.ToString() + "l", true, 0, Low[1] - TickSize, Color.PaleGreen);
DrawText(CurrentBar.ToString() + "m", Open[0].ToString(), 0, Low[1] - 8 * TickSize, Color.PaleGreen);
The arrows draw in the price panel but the text is in the indicator area. What am doing wrong?
Comment
-
I found the problem. The thread at
took me to a NinjaTrader problem. In my case somehow the default workspace got set to <panel>1<panel>. When I changed it to <panel>0<panel> my text appeared on the price panel.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
22 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
31 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
||
Started by catinabag, 04-13-2023, 05:46 AM
|
34 responses
1,464 views
0 likes
|
Last Post
by mcosta72
Today, 04:44 PM
|
||
Started by adeelshahzad, Today, 11:49 AM
|
6 responses
24 views
0 likes
|
Last Post
by mcosta72
Today, 04:35 PM
|
||
Started by sidlercom80, 05-05-2020, 07:20 AM
|
4 responses
308 views
0 likes
|
Last Post
by Bidder
Today, 04:35 PM
|
Comment