PDA

View Full Version : How to plot an indicator only on the current session


max1ci6
04-24-2007, 05:11 AM
I'm new at programming in NT and probably this question was already answered but I couldn't find it.
I would like to plot an indicator (for instance PriorDayOHLC) only for the current session (not for all previous days), can anyone tell me how to do it or indicate some example?

Thanks in advance.

NinjaTrader_Ray
04-24-2007, 05:24 AM
You would need to add some filtering logic to prevent a value for an indicator's dataseries to be set. Since NT sessions can only be defined within a calendarday, you could do something like:

if (Time[0].Date == DateTime.Now.Date)
Plot0.Set(yourValue);

max1ci6
04-24-2007, 07:50 PM
Thanks it worked.