Draw.VerticalLine(this, "tag1", 64500, Brushes.Green)
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
How to enter vertical line in chart output for Strategy Analyzer
Collapse
X
-
How to enter vertical line in chart output for Strategy Analyzer
I'm trying to add a vertical line everyday that is being analyzed at a specific time. I've yet to make anything display and assuming I'm handling the time input incorrectly?
Code:Tags: None
-
Hello Dragon989,
Thank you for your note.
The following would draw a vertical line on the most recent current bar, 0.
Draw.VerticalLine(this, "tag1",0, Brushes.Green);
When you're passing 64500 its drawing a line 645000 bars Ago.
If you wanted a line drawn at a specific time each day, say 9AM, you could use the following,
if (Times[0][0].TimeOfDay == new TimeSpan(08,00, 0))
Draw.VerticalLine(this, "tag1"+CurrentBar, 0, Brushes.Green);
Notice I amend "Tag1" with the current bar, so the same line is not redrawn on each call but a new line is created.
See draw.vertical line section of our HG:
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Hello, for some reason with my ninja trader 8 code, no matter what Draw.VerticleLine or Draw.Line is called, it only draws a single verticle line on the last bar of the chart. It doesn't draw any other lines. So if there is a condition met then draw a verticle line. It draws one time even when the condition is met. Always on the very last bar on the chart.
Draw.Line("My vertical line2" + CurrentBar, 0, Color.Cyan, DashStyle.Dash, 3);
Draw.Line(this, "tag1", false, 0, 1000, 0, 1001, Brushes.LimeGreen, DashStyleHelper.Dot, 2);
if (Times[0][0].TimeOfDay == new TimeSpan(08,00, 0))
Draw.VerticalLine(this, "tag1"+CurrentBar, 0, Brushes.Green);
Draw.VerticalLine(this, "someOtherfib", k, Brushes.Blue);
Draw.VerticalLine(this, "someOtherfib", CurrentBar, Brushes.Blue);
Any thoughts as to why this would happen.
My only idea is that it may be related to:
if (BarsInProgress != 0)
return;Last edited by krimkrim; 03-27-2020, 09:05 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
12 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
11 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
7 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
||
Started by The_Sec, Today, 03:37 PM
|
0 responses
3 views
0 likes
|
Last Post
by The_Sec
Today, 03:37 PM
|
||
Started by GwFutures1988, Today, 02:48 PM
|
1 response
9 views
0 likes
|
Last Post Today, 03:09 PM |
Comment