Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

This is so frustrating :( Please help.

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

    This is so frustrating :( Please help.

    Hello,

    I'm trying to draw vertical lines at various times on chart on a single day with the following code. There is no error, but the vertical lines are not showing up... This is so frustrating...

    Please help.

    Code:
    	if ((ToDay(Time[0]) == 20150915))
    		{
    		if ((ToTime(Time[0]) == 001318))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 
    		if ((ToTime(Time[0]) == 011206))
    		DrawVerticalLine("black" + CurrentBar, 0, Color.Black); 
    		if ((ToTime(Time[0]) == 021055))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 		
    		if ((ToTime(Time[0]) == 030943))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 040831))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 050719))
    		DrawVerticalLine("blue" + CurrentBar, 0, Color.Blue); 
    		if ((ToTime(Time[0]) == 060607))
    		DrawVerticalLine("green" + CurrentBar, 0, Color.Green); 
    		if ((ToTime(Time[0]) == 070715))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 
    		if ((ToTime(Time[0]) == 080823))
    		DrawVerticalLine("black" + CurrentBar, 0, Color.Black); 
    		if ((ToTime(Time[0]) == 090930))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 		
    		if ((ToTime(Time[0]) == 101038))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 111146))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 121253))
    		DrawVerticalLine("blue" + CurrentBar, 0, Color.Blue); 
    		if ((ToTime(Time[0]) == 131401))
    		DrawVerticalLine("green" + CurrentBar, 0, Color.Green); 
    		if ((ToTime(Time[0]) == 141509))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 
    		if ((ToTime(Time[0]) == 151616))
    		DrawVerticalLine("black" + CurrentBar, 0, Color.Black); 
    		if ((ToTime(Time[0]) == 161724))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 		
    		if ((ToTime(Time[0]) == 171831))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 181939))
    		DrawVerticalLine("red" + CurrentBar, 0, Color.Red); 
    		if ((ToTime(Time[0]) == 191832))
    		DrawVerticalLine("blue" + CurrentBar, 0, Color.Blue); 
    		if ((ToTime(Time[0]) == 201725))
    		DrawVerticalLine("green" + CurrentBar, 0, Color.Green); 
    		if ((ToTime(Time[0]) == 211618))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 
    		if ((ToTime(Time[0]) == 221511))
    		DrawVerticalLine("black" + CurrentBar, 0, Color.Black); 
    		if ((ToTime(Time[0]) == 231401))
    		DrawVerticalLine("orange" + CurrentBar, 0, Color.Orange); 
    		}
    		else
    		return;
    Last edited by karthik007; 09-16-2015, 06:06 AM.

    #2
    Hello karthik007,

    Could you please let me know what period you are using on the chart? Because you are checking for individual seconds in your conditions, you would need to view this on a 1 second chart to be sure all the lines would show up. If this is not your intention, I recommend reading through the example on the ToTime() method in our help guide here: http://ninjatrader.com/support/helpG...ightsub=totime

    Please let me know if this does not resolve the issue or if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Thanks a lot Michael!! I was using it on a 5 minute chart.

      After rounding off the seconds, I'm able to see them on a 30 sec chart Awesome!!

      Comment


        #4
        Hello karthik007,

        Thank you for the update. I am glad to hear everything is working for you at this time.

        Please let me know if I may be of further assistance anytime.
        Michael M.NinjaTrader Quality Assurance

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        577 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X