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