Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plot current day only

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

    plot current day only

    Starting from the script "SampleGetHighLowByTimeRange....

    How would I modify that so it only plotted the current day, and no previous days?

    bigtee

    #2
    Hi Bigtee,

    You would want to create a time filter that ensures the plots are only happening on todays date.

    This code example should give you the correct plot method that you want -
    Code:
    if(Time[0].Date == DateTime.Today)
    	{
               	HighestHigh.Set(highestHigh);
    		LowestLow.Set(lowestLow);
    	}
    			
    	else
    	{
    		HighestHigh.Reset();
    		LowestLow.Reset();
    	}
    This will only plot the times that you specify and the current day.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks... that works great!
      One question...
      Why did you use a "Reset" when there should be no plot instead of just a "Return"?

      bigtee

      Comment


        #4
        Bigtee,

        Either one will work and there was no particular reason.

        Return would work best right now as you do not need to plot the line.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        22 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        12 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        8 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        10 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        16 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X