NexusFi: Find Your Edge


Home Menu

 





How to draw more than 1 line in PricePanel?


Discussion in NinjaTrader

Updated
    1. trending_up 1,472 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

How to draw more than 1 line in PricePanel?

  #1 (permalink)
jaspee
Czech Republic
 
Posts: 3 since Mar 2012
Thanks Given: 3
Thanks Received: 0

Hi,
Could somebody help me please? I'm trying to draw 2lines in PricePanel, see code sample, but only the last one always appear. I don't know what I'm doing wrong?
Many thanks for any idea how to do it.
jaspee

code sample:
 
Code
protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.
            //Plot0.Set(Close[0]);
			
			int startBar = CurrentBar - Bars.GetBar (new DateTime (2015,2,12,19,27,00));
			int endBar  = CurrentBar - Bars.GetBar (new DateTime (2015,2,12,21,21,00));
			int deltaAgo = endBar - startBar;
			
			//DrawLine(string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color)
			
			if (CurrentBar > 20)
			{
			DrawOnPricePanel = true;
			//DrawLine("tagEntry",5,2082,0,2086,Color.Blue );
			DrawLine("tagEntry",true,new DateTime (2015,2,12,19,27,00),Open[startBar],new DateTime (2015,2,12,21,21,00),Close[endBar],Color.Blue ,DashStyle.Dash,3);
			
			DrawOnPricePanel = true;	
			DrawLine("tagEntry",true,new DateTime (2015,2,12,19,45,00),Open[startBar],new DateTime (2015,2,12,21,21,00),Close[endBar],Color.Blue ,DashStyle.Dash,3);
			
			DrawOnPricePanel = false;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

because you use identical tag name, you make them diff by giving diff name or the same tag name + some value ex: "tag name"+Currentbar, "tag name"+count, etc....

Reply With Quote
Thanked by:
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623


Make sure tag is different for separate lines, eg:
"Line1Tag",
"Line2Tag"

If you don't want the lines to be overwritten at every bar and would like to keep every historical line visible you need also to add bar specific info to the tag, eg:
Time[0].ToString + "Line1Tag",
Time[0].ToString + "Line2Tag"

Reply With Quote
Thanked by:
  #4 (permalink)
jaspee
Czech Republic
 
Posts: 3 since Mar 2012
Thanks Given: 3
Thanks Received: 0

to: cory, gregid
wow!! Thank you, ohh.. my eyes I completly non-see it, same Tags names..oops
Now it works ! Looks Great ! even without DrawOnPricePanel = true;

Could I ask one more drawing question please ?
I would like to draw circle with diameter 10pt with central point in same position as is actually mouse CrossCursor over the chart and when mouse cursor move, circle move it together with. Like circle will be drawn arround the cursor and move together as one. Such as gauge.
Many thanks for any idea.
jaspee

Reply With Quote
  #5 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623


jaspee View Post
to: cory, gregid
Could I ask one more drawing question please ?
I would like to draw circle with diameter 10pt with central point in same position as is actually mouse CrossCursor over the chart and when mouse cursor move, circle move it together with. Like circle will be drawn arround the cursor and move together as one. Such as gauge.
Many thanks for any idea.
jaspee

If you are good at programming you should be able to get the idea of what needs to be done by looking at existing tools in the download section, like crosshair gauge:
https://nexusfi.com/local_links_search.php?action=show&literal=1&search=crosshair&desc=1&keys=1

Alternatively try to ask in the following thread:


I believe you need to be elite member to access both.

Reply With Quote
Thanked by:
  #6 (permalink)
jaspee
Czech Republic
 
Posts: 3 since Mar 2012
Thanks Given: 3
Thanks Received: 0

to: gregid
Thank you for your time and both links.
Unfortunatelly I'm not elite member..:-(
jaspee

Reply With Quote




Last Updated on February 19, 2015


© 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