If you want to know if the New York Session is currently open you have to take in account the time of year
as New York could be on Eastern Standard Time (EST) or Eastern Daylight Time (EDT).
We can easily do this in our Java code using the following constants
private static int USopen = 8, USclose = 17;
private static String UStimezone = "EST5EDT"; // New York SESSION_HOURS
and then in our onBar logic set up a Calendar to obtain the current time in the required timezone, as follows:
Cale
…