• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to enter vertical line in chart output for Strategy Analyzer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:
    Draw.VerticalLine(this, "tag1", 64500, Brushes.Green)
    Thanks!

  • NinjaTrader_AlanP
    replied
    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:
    https://ninjatrader.com/support/help..._reference.htm

    Please let us know if you need further assistance.
    Attached Files

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by jecoyeko, Today, 12:45 AM
0 responses
3 views
0 likes
Last Post jecoyeko  
Started by Newtrader101, Yesterday, 06:31 PM
1 response
7 views
0 likes
Last Post NinjaTrader_EricB  
Started by Tyler7498, Yesterday, 07:34 PM
0 responses
4 views
0 likes
Last Post Tyler7498  
Started by Woomera, Yesterday, 07:24 PM
2 responses
9 views
0 likes
Last Post Woomera
by Woomera
 
Started by Newtrader101, Yesterday, 12:31 PM
3 responses
15 views
0 likes
Last Post NinjaTrader_EricB  
Working...
X