use chrono_tz::America;
use super::StaticHoursProfile;
use crate::calendar::SessionRule;
use crate::calendar::rule::MON_FRI;
use crate::calendar::rule::SUN_PLUS_MON_THU;
pub static US_EQUITY_REGULAR: &[SessionRule] = &[SessionRule {
days: MON_FRI,
open_ssm: 9 * 3600 + 30 * 60,
close_ssm: 16 * 3600,
}];
pub static US_EQUITY_EXTENDED: &[SessionRule] = &[
SessionRule {
days: MON_FRI,
open_ssm: 4 * 3600,
close_ssm: 9 * 3600 + 30 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600,
close_ssm: 20 * 3600,
},
];
pub static NYSE_TEXAS_EXTENDED: &[SessionRule] = &[
SessionRule {
days: MON_FRI,
open_ssm: 7 * 3600,
close_ssm: 9 * 3600 + 30 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600,
close_ssm: 20 * 3600,
},
];
pub static BLUE_OCEAN_EXTENDED: &[SessionRule] = &[
SessionRule {
days: SUN_PLUS_MON_THU,
open_ssm: 20 * 3600, close_ssm: 4 * 3600, },
];
pub(crate) static US_EQUITIES_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: US_EQUITY_EXTENDED,
has_daily_close: true,
has_weekend_close: true,
};
static EXT_EARLY_0700: &[SessionRule] = &[
SessionRule {
days: MON_FRI,
open_ssm: 7 * 3600,
close_ssm: 9 * 3600 + 30 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600,
close_ssm: 20 * 3600,
},
];
pub(crate) static US_EQUITY_EARLY_0700_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: EXT_EARLY_0700,
has_daily_close: true,
has_weekend_close: true,
};
pub(crate) static NYSE_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: &[],
has_daily_close: true,
has_weekend_close: true,
};
pub(crate) static NYSE_TEXAS_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: NYSE_TEXAS_EXTENDED,
has_daily_close: true,
has_weekend_close: true,
};
static FINRA_TRF_REGULAR: &[SessionRule] = &[SessionRule {
days: MON_FRI,
open_ssm: 8 * 3600,
close_ssm: 20 * 3600,
}];
pub(crate) static FINRA_TRF_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: FINRA_TRF_REGULAR,
extended: &[],
has_daily_close: true,
has_weekend_close: true,
};
static IQX_EXTENDED: &[SessionRule] = &[SessionRule {
days: MON_FRI,
open_ssm: 9 * 3600,
close_ssm: 9 * 3600 + 30 * 60,
}];
pub(crate) static IQX_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: IQX_EXTENDED,
has_daily_close: true,
has_weekend_close: true,
};
pub(crate) static BLUE_OCEAN_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: &[],
extended: BLUE_OCEAN_EXTENDED,
has_daily_close: true,
has_weekend_close: true,
};
static US_OPTIONS_REGULAR: &[SessionRule] = &[SessionRule {
days: MON_FRI,
open_ssm: 9 * 3600 + 30 * 60,
close_ssm: 16 * 3600,
}];
pub(crate) static US_OPTIONS_DEFAULT_PROFILE: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_OPTIONS_REGULAR,
extended: &[],
has_daily_close: true,
has_weekend_close: true,
};
static IEX_PRE_EXT: &[SessionRule] = &[];
static IEX_POST_EXT: &[SessionRule] = &[
SessionRule {
days: MON_FRI,
open_ssm: 8 * 3600,
close_ssm: 9 * 3600 + 30 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600,
close_ssm: 17 * 3600,
},
];
pub(crate) static IEX_PROFILE_PRE2015: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: IEX_PRE_EXT,
has_daily_close: true,
has_weekend_close: true,
};
pub(crate) static IEX_PROFILE_POST2015: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: US_EQUITY_REGULAR,
extended: IEX_POST_EXT,
has_daily_close: true,
has_weekend_close: true,
};
static C1_REGULAR: &[SessionRule] = &[SessionRule {
days: MON_FRI,
open_ssm: 9 * 3600 + 30 * 60,
close_ssm: 16 * 3600 + 15 * 60,
}];
static C1_EXT_PRE_2024_08_26: &[SessionRule] = &[
SessionRule {
days: SUN_PLUS_MON_THU,
open_ssm: 20 * 3600 + 15 * 60,
close_ssm: 9 * 3600 + 15 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600 + 15 * 60,
close_ssm: 17 * 3600,
},
];
static C1_EXT_POST_2024_08_26: &[SessionRule] = &[
SessionRule {
days: SUN_PLUS_MON_THU,
open_ssm: 20 * 3600 + 15 * 60,
close_ssm: 9 * 3600 + 25 * 60,
},
SessionRule {
days: MON_FRI,
open_ssm: 16 * 3600 + 15 * 60,
close_ssm: 17 * 3600,
},
];
pub(crate) static C1_PROFILE_PRE_2024_08_26: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: C1_REGULAR,
extended: C1_EXT_PRE_2024_08_26,
has_daily_close: true,
has_weekend_close: true,
};
pub(crate) static C1_PROFILE_POST_2024_08_26: StaticHoursProfile = StaticHoursProfile {
tz: America::New_York,
regular: C1_REGULAR,
extended: C1_EXT_POST_2024_08_26,
has_daily_close: true,
has_weekend_close: true,
};