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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X