| | |
| | | } |
| | | case US_STOCKS: { |
| | | ZonedDateTime nowNewYork = nowUtc.withZoneSameInstant(ZoneId.of("America/New_York")); |
| | | String formattedDate = nowNewYork.format(formatter); |
| | | /*if (usStockStopSet.contains(formattedDate)) { |
| | | /*String formattedDate = nowNewYork.format(formatter); |
| | | if (usStockStopSet.contains(formattedDate)) { |
| | | return false; |
| | | }*/ |
| | | if (!isUsSupportPreAndAfter()) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static boolean isMarketOpenBuyDz(String market) { |
| | | ZonedDateTime nowUtc = ZonedDateTime.now(ZoneId.of("UTC")); |
| | | return isOpenBuyDz(market, nowUtc); |
| | | } |
| | | |
| | | private static boolean isOpenBuyDz(String market, ZonedDateTime nowUtc) { |
| | | switch (market) { |
| | | case US_STOCKS: { |
| | | ZonedDateTime nowNewYork = nowUtc.withZoneSameInstant(ZoneId.of("America/New_York")); |
| | | if (nowNewYork.getDayOfWeek().getValue() < 6) { |
| | | return true; |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | throw new IllegalArgumentException("无效的市场名称"); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public static List<OpenCloseTime> listUsOpenCloseDateTime() { |
| | | int year = 2023; |