From 6dc6bc0661deeb106084fcb699260631e62da66b Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 28 Apr 2024 13:37:42 +0200 Subject: [PATCH] Extract pair/candle type from types.ts --- src/types/candleTypes.ts | 67 ++++++++++++++++++++++++++++++++++++++++ src/types/index.ts | 3 +- src/types/types.ts | 64 -------------------------------------- 3 files changed, 69 insertions(+), 65 deletions(-) create mode 100644 src/types/candleTypes.ts diff --git a/src/types/candleTypes.ts b/src/types/candleTypes.ts new file mode 100644 index 00000000..ccf677ca --- /dev/null +++ b/src/types/candleTypes.ts @@ -0,0 +1,67 @@ +export interface AvailablePairPayload { + timeframe?: string; + stake_currency?: string; +} + +export type PairIntervalTuple = [string, string, string]; + +export interface AvailablePairResult { + pairs: string[]; + /** + * List of lists, as [pair, timeframe, candletype] + */ + pair_interval: PairIntervalTuple[]; + length: number; +} + +export interface PairCandlePayload { + pair: string; + timeframe: string; + limit?: number; + columns?: string[]; +} + +export interface PairHistoryPayload { + pair: string; + timeframe: string; + timerange: string; + strategy: string; + freqaimodel?: string; +} + +export interface PairHistory { + strategy: string; + pair: string; + timeframe: string; + timeframe_ms: number; + columns: string[]; + /** All columns - available starting with api 2.35 + * Contains all columns - columns may be filtered to the ones available. + */ + all_columns?: string[]; + data: number[][]; + length: number; + /** Number of buy signals in this response */ + buy_signals: number; + /** Number of sell signals in this response */ + sell_signals: number; + + /** Number of long entry signals in this response */ + enter_long_signals?: number; + /** Number of long exit signals in this response */ + exit_long_signals?: number; + /** Number of short entry signals in this response */ + enter_short_signals?: number; + /** Number of short exit signals in this response */ + exit_short_signals?: number; + + last_analyzed: number; + /** Data start date in as millisecond timestamp */ + data_start_ts: number; + /** Data start date in in the format YYYY-MM-DD HH24:MI:SS+00:00 */ + data_start: string; + /** End date in in the format YYYY-MM-DD HH24:MI:SS+00:00 */ + data_stop: string; + /** Data end date in as millisecond timestamp */ + data_stop_ts: number; +} diff --git a/src/types/index.ts b/src/types/index.ts index 8f06bc70..85a561a0 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -4,6 +4,7 @@ export * from './backtest'; export * from './balance'; export * from './blacklist'; export * from './botComparison'; +export * from './candleTypes'; export * from './chart'; export * from './daily'; export * from './exchange'; @@ -12,6 +13,6 @@ export * from './locks'; export * from './pairlists'; export * from './plot'; export * from './profit'; -export * from './tradeStats'; export * from './trades'; +export * from './tradeStats'; export * from './types'; diff --git a/src/types/types.ts b/src/types/types.ts index b70d2606..c69726ca 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -189,70 +189,6 @@ export interface FreqAIModelListResult { freqaimodels: string[]; } -export interface AvailablePairPayload { - timeframe?: string; - stake_currency?: string; -} - -export type PairIntervalTuple = [string, string, string]; - -export interface AvailablePairResult { - pairs: string[]; - /** - * List of lists, as [pair, timeframe, candletype] - */ - pair_interval: PairIntervalTuple[]; - length: number; -} - -export interface PairCandlePayload { - pair: string; - timeframe: string; - limit?: number; - columns?: string[]; -} - -export interface PairHistoryPayload { - pair: string; - timeframe: string; - timerange: string; - strategy: string; - freqaimodel?: string; -} - -export interface PairHistory { - strategy: string; - pair: string; - timeframe: string; - timeframe_ms: number; - columns: string[]; - data: number[][]; - length: number; - /** Number of buy signals in this response */ - buy_signals: number; - /** Number of sell signals in this response */ - sell_signals: number; - - /** Number of long entry signals in this response */ - enter_long_signals?: number; - /** Number of long exit signals in this response */ - exit_long_signals?: number; - /** Number of short entry signals in this response */ - enter_short_signals?: number; - /** Number of short exit signals in this response */ - exit_short_signals?: number; - - last_analyzed: number; - /** Data start date in as millisecond timestamp */ - data_start_ts: number; - /** Data start date in in the format YYYY-MM-DD HH24:MI:SS+00:00 */ - data_start: string; - /** End date in in the format YYYY-MM-DD HH24:MI:SS+00:00 */ - data_stop: string; - /** Data end date in as millisecond timestamp */ - data_stop_ts: number; -} - export interface SysInfoResponse { cpu_pct: number[]; ram_pct: number;