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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X