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!
See more
See less

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 arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        60 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X