The NT charts that I watch while trading have Session Begins properties of 8:30 AM and Session Ends of 4:15 PM. As I understandings it, only instrument data between Session Begins and Session Ends are seen by an indicator's OnBarUpdate() method and there are no objects that have the data that is outside the Session Begins and Session Ends times.
I want to use the last N night session's Min and Max prices in my indicator. I am looking for the simplest NT 6.5 solution and have come up with this:
1) Create a chart that has Session Begins - Session Ends of 15:30 - 8:15, which will capture all the night session data, including Sunday's.
2) Create an indicator which:
a) Uses the technique in Reference Sample "Indicator: Using custom events to output the current Level II data book" to create custom event from a Timer object to signal the end of the night session.
b) When the night session ends, use C# .NET static variables to save instrument's last N night session's Min and Max prices.
3) Update my indicators to get the last N night session's Min and Max prices from the static variable for the chart instrument.
Is this the simplest solution to get last N night session's Min and Max prices?
The disadvantage of this solution is that it requires an additional chart for each instrument to collect the night session data. This could be eliminated if there was an OnNoBarUpdate() method that would see all trades that were filtered out by Session Begins - Session Ends. Is something like that technically possible?
Comment