Add smart-money option signal path and tape filters

This commit is contained in:
dirtydishes 2026-04-28 16:29:44 -04:00
parent 758f111d7e
commit 27b0a399e6
23 changed files with 1827 additions and 175 deletions

View file

@ -14,16 +14,38 @@ CREATE TABLE IF NOT EXISTS ${OPTION_PRINTS_TABLE} (
price Float64,
size UInt32,
exchange String,
conditions Array(String)
conditions Array(String),
underlying_id Nullable(String),
option_type Nullable(String),
notional Nullable(Float64),
nbbo_side Nullable(String),
is_etf Nullable(Bool),
signal_pass Nullable(Bool),
signal_reasons Array(String) DEFAULT [],
signal_profile Nullable(String)
)
ENGINE = MergeTree
ORDER BY (ts, option_contract_id)
`;
};
export const optionPrintsTableMigrations = (): string[] => {
return [
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS underlying_id Nullable(String)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS option_type Nullable(String)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS notional Nullable(Float64)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS nbbo_side Nullable(String)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS is_etf Nullable(Bool)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS signal_pass Nullable(Bool)`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS signal_reasons Array(String) DEFAULT []`,
`ALTER TABLE ${OPTION_PRINTS_TABLE} ADD COLUMN IF NOT EXISTS signal_profile Nullable(String)`
];
};
export const normalizeOptionPrint = (print: OptionPrint): OptionPrint => {
return {
...print,
conditions: print.conditions ?? []
conditions: print.conditions ?? [],
signal_reasons: print.signal_reasons ?? []
};
};