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 Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        835 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,291 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        10 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        62 views
        0 likes
        Last Post halgo_boulder  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        9 views
        0 likes
        Last Post Option Whisperer  
        Working...
        X