killzones

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.killzones(time_open: ArrayLike,asia_hours: str = '20:00-00:00',asia_tz: str = 'America/New_York',london_open_hours: str = '02:00-05:00',london_open_tz: str = 'America/New_York',new_york_open_hours: str = '07:00-10:00',new_york_open_tz: str = 'America/New_York',london_close_hours: str = '10:00-12:00',london_close_tz: str = 'America/New_York') -> dict[str, np.ndarray]

Four named windows, each true on the bars that open inside it.

Parameters

NameTypeDefault
time_openArrayLike
asia_hoursstr'20:00-00:00'
asia_tzstr'America/New_York'
london_open_hoursstr'02:00-05:00'
london_open_tzstr'America/New_York'
new_york_open_hoursstr'07:00-10:00'
new_york_open_tzstr'America/New_York'
london_close_hoursstr'10:00-12:00'
london_close_tzstr'America/New_York'

Indicator: Killzones

Each window has its own hours and time zone. A bar is inside a window when it opens at or after the start and before the end; hours that end before they start run past midnight. time_open is in nanoseconds (UTC).

Classpython
forge.ta.Killzones(**inputs: Any) -> None

Named session windows, each in its own time zone, shaded on the chart and usable as filters.

Inputs

NameTypeDefaultGroup
asia_hourssession20:00-00:00Asia
asia_tztextAmerica/New_YorkAsia
london_open_hourssession02:00-05:00London open
london_open_tztextAmerica/New_YorkLondon open
new_york_open_hourssession07:00-10:00New York open
new_york_open_tztextAmerica/New_YorkNew York open
london_close_hourssession10:00-12:00London close
london_close_tztextAmerica/New_YorkLondon close

Each window runs from the start to the end of its hours (asia_hours, london_open_hours, new_york_open_hours, london_close_hours) in its own time zone (asia_tz, london_open_tz, new_york_open_tz, london_close_tz). A bar is inside a window when it opens at or after the start and before the end; hours that end before they start run past midnight.

in_asia, in_london_open, in_new_york_open and in_london_close are true on the bars inside each window.