@tradejs/types 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +118 -35
- package/dist/index.d.ts +118 -35
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -75,6 +75,27 @@ interface KlineRequest {
|
|
|
75
75
|
silent?: boolean;
|
|
76
76
|
cacheOnly?: boolean;
|
|
77
77
|
}
|
|
78
|
+
type DerivativesInterval = '15m' | '1h';
|
|
79
|
+
type DerivativesRow = {
|
|
80
|
+
symbol: string;
|
|
81
|
+
interval: DerivativesInterval;
|
|
82
|
+
ts: Date;
|
|
83
|
+
openInterest?: number | null;
|
|
84
|
+
fundingRate?: number | null;
|
|
85
|
+
liqLong?: number | null;
|
|
86
|
+
liqShort?: number | null;
|
|
87
|
+
liqTotal?: number | null;
|
|
88
|
+
source?: string | null;
|
|
89
|
+
};
|
|
90
|
+
type SpreadRow = {
|
|
91
|
+
symbol: string;
|
|
92
|
+
interval: DerivativesInterval;
|
|
93
|
+
ts: Date;
|
|
94
|
+
binancePrice?: number | null;
|
|
95
|
+
coinbasePrice?: number | null;
|
|
96
|
+
spread?: number | null;
|
|
97
|
+
source?: string | null;
|
|
98
|
+
};
|
|
78
99
|
interface Tp {
|
|
79
100
|
price: number;
|
|
80
101
|
rate: number;
|
|
@@ -473,64 +494,126 @@ interface StrategyHookGateResult {
|
|
|
473
494
|
allow?: boolean;
|
|
474
495
|
reason?: string;
|
|
475
496
|
}
|
|
476
|
-
|
|
497
|
+
type EntryDecision = Extract<StrategyDecision, {
|
|
498
|
+
kind: 'entry';
|
|
499
|
+
}>;
|
|
500
|
+
type ExitDecision = Extract<StrategyDecision, {
|
|
501
|
+
kind: 'exit';
|
|
502
|
+
}>;
|
|
503
|
+
interface StrategyHookCtx {
|
|
477
504
|
connector: Connector;
|
|
478
505
|
strategyName: string;
|
|
479
506
|
userName: string;
|
|
480
507
|
symbol: string;
|
|
481
|
-
|
|
508
|
+
strategyConfig: StrategyConfig;
|
|
482
509
|
env: string;
|
|
483
510
|
isConfigFromBacktest: boolean;
|
|
484
511
|
}
|
|
485
|
-
interface
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
512
|
+
interface StrategyHookMarketContext {
|
|
513
|
+
candle?: KlineChartItem;
|
|
514
|
+
btcCandle?: KlineChartItem;
|
|
515
|
+
data?: KlineChartItem[];
|
|
516
|
+
btcData?: KlineChartItem[];
|
|
517
|
+
}
|
|
518
|
+
interface StrategyHookEntryContext {
|
|
519
|
+
context: StrategyEntrySignalContext;
|
|
520
|
+
orderPlan: StrategyEntryOrderPlan;
|
|
489
521
|
signal?: Signal;
|
|
522
|
+
runtime: {
|
|
523
|
+
raw?: StrategyEntryRuntimeOptions;
|
|
524
|
+
resolved: StrategyEntryRuntimeOptions;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type StrategyHookMlSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_STRATEGY_CONFIG' | 'NO_THRESHOLD' | 'NO_RESULT';
|
|
528
|
+
interface StrategyHookMlContext {
|
|
529
|
+
config?: StrategyRuntimeMlOptions;
|
|
530
|
+
attempted: boolean;
|
|
531
|
+
applied: boolean;
|
|
532
|
+
result?: Signal['ml'];
|
|
533
|
+
skippedReason?: StrategyHookMlSkippedReason;
|
|
534
|
+
}
|
|
535
|
+
type StrategyHookAiSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_QUALITY';
|
|
536
|
+
interface StrategyHookAiContext {
|
|
537
|
+
config?: StrategyRuntimeAiOptions;
|
|
538
|
+
attempted: boolean;
|
|
539
|
+
applied: boolean;
|
|
540
|
+
quality?: number;
|
|
541
|
+
skippedReason?: StrategyHookAiSkippedReason;
|
|
542
|
+
}
|
|
543
|
+
type StrategyHookStage = 'onInit' | 'afterCoreDecision' | 'onSkip' | 'beforeClosePosition' | 'afterEnrichMl' | 'afterEnrichAi' | 'beforeEntryGate' | 'beforePlaceOrder' | 'afterPlaceOrder' | 'runtime.beforePlaceOrder' | 'enrichSignalWithMl' | 'enrichSignalWithAi' | 'closePosition' | 'placeOrder';
|
|
544
|
+
interface StrategyHookErrorPayload {
|
|
545
|
+
stage: StrategyHookStage;
|
|
546
|
+
cause: unknown;
|
|
490
547
|
}
|
|
491
|
-
interface
|
|
492
|
-
|
|
493
|
-
|
|
548
|
+
interface StrategyHookErrorContext {
|
|
549
|
+
ctx: StrategyHookCtx;
|
|
550
|
+
market?: StrategyHookMarketContext;
|
|
551
|
+
decision?: StrategyDecision;
|
|
552
|
+
entry?: StrategyHookEntryContext;
|
|
553
|
+
error: StrategyHookErrorPayload;
|
|
554
|
+
}
|
|
555
|
+
interface StrategyHookInitContext {
|
|
556
|
+
ctx: StrategyHookCtx;
|
|
557
|
+
market: Required<Pick<StrategyHookMarketContext, 'data' | 'btcData'>>;
|
|
494
558
|
}
|
|
495
|
-
interface StrategyHookAfterDecisionContext
|
|
559
|
+
interface StrategyHookAfterDecisionContext {
|
|
560
|
+
ctx: StrategyHookCtx;
|
|
561
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
496
562
|
decision: StrategyDecision;
|
|
497
|
-
candle: KlineChartItem;
|
|
498
|
-
btcCandle: KlineChartItem;
|
|
499
563
|
}
|
|
500
564
|
interface StrategyHookSkipContext extends StrategyHookAfterDecisionContext {
|
|
501
565
|
decision: Extract<StrategyDecision, {
|
|
502
566
|
kind: 'skip';
|
|
503
567
|
}>;
|
|
504
568
|
}
|
|
505
|
-
interface StrategyHookBeforeCloseContext extends
|
|
506
|
-
decision:
|
|
507
|
-
kind: 'exit';
|
|
508
|
-
}>;
|
|
569
|
+
interface StrategyHookBeforeCloseContext extends StrategyHookAfterDecisionContext {
|
|
570
|
+
decision: ExitDecision;
|
|
509
571
|
}
|
|
510
|
-
interface StrategyHookEnrichContext
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
572
|
+
interface StrategyHookEnrichContext {
|
|
573
|
+
ctx: StrategyHookCtx;
|
|
574
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
575
|
+
decision: EntryDecision;
|
|
576
|
+
entry: StrategyHookEntryContext;
|
|
577
|
+
ml: StrategyHookMlContext;
|
|
516
578
|
}
|
|
517
579
|
interface StrategyHookAfterAiContext extends StrategyHookEnrichContext {
|
|
518
|
-
|
|
580
|
+
ai: StrategyHookAiContext;
|
|
519
581
|
}
|
|
520
|
-
interface
|
|
582
|
+
interface StrategyHookPolicyContext {
|
|
583
|
+
aiQuality?: number;
|
|
521
584
|
makeOrdersEnabled: boolean;
|
|
522
585
|
minAiQuality: number;
|
|
523
586
|
}
|
|
524
|
-
interface
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
decision:
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
587
|
+
interface StrategyHookBeforeEntryGateContext {
|
|
588
|
+
ctx: StrategyHookCtx;
|
|
589
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
590
|
+
decision: EntryDecision;
|
|
591
|
+
entry: StrategyHookEntryContext;
|
|
592
|
+
policy: StrategyHookPolicyContext;
|
|
593
|
+
ml?: StrategyHookMlContext;
|
|
594
|
+
ai?: StrategyHookAiContext;
|
|
595
|
+
}
|
|
596
|
+
interface StrategyHookBeforePlaceOrderContext {
|
|
597
|
+
ctx: StrategyHookCtx;
|
|
598
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
599
|
+
decision: EntryDecision;
|
|
600
|
+
entry: StrategyHookEntryContext;
|
|
601
|
+
policy: StrategyHookPolicyContext;
|
|
602
|
+
ml?: StrategyHookMlContext;
|
|
603
|
+
ai?: StrategyHookAiContext;
|
|
604
|
+
}
|
|
605
|
+
interface StrategyHookOrderContext {
|
|
606
|
+
result: Signal | string;
|
|
607
|
+
}
|
|
608
|
+
interface StrategyHookAfterPlaceOrderContext {
|
|
609
|
+
ctx: StrategyHookCtx;
|
|
610
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
611
|
+
decision: EntryDecision;
|
|
612
|
+
entry: StrategyHookEntryContext;
|
|
613
|
+
policy: StrategyHookPolicyContext;
|
|
614
|
+
ml?: StrategyHookMlContext;
|
|
615
|
+
ai?: StrategyHookAiContext;
|
|
616
|
+
order: StrategyHookOrderContext;
|
|
534
617
|
}
|
|
535
618
|
interface StrategyManifest {
|
|
536
619
|
name: string;
|
|
@@ -839,4 +922,4 @@ interface IndicatorPluginDefinition {
|
|
|
839
922
|
indicatorEntries: IndicatorPluginEntry[];
|
|
840
923
|
}
|
|
841
924
|
|
|
842
|
-
export type { AIChatHistory, AIChatMessage, AiPayload, BacktestPriceMode, BacktestRunConfig, BaseIndicatorsHistorySnapshot, Bot, BotConfig, BotResults, BotStatus, BuildStrategySignalDraft, BuildStrategySignalParams, Candle, ChartColor, CompletedTest, Connector, ConnectorConfig, ConnectorCreator, ConnectorPluginDefinition, ConnectorRegistryEntry, CreateStrategyCore, CreateStrategyCoreParams, Direction, EOMPoint, Figure, Filters, GetTickers, Indicator, IndicatorPluginComputeParams, IndicatorPluginDefinition, IndicatorPluginEntry, IndicatorPluginFigureRenderer, IndicatorPluginRenderer, IndicatorSnapshot, Indicators, IndicatorsHistorySnapshot, Interval, Item, Items, Kline, KlineChartData, KlineChartItem, KlineRequest, MetricThreshold, Metrics, MinimalStat, MlCandleIndicatorsSnapshot, MonthlyEquityStats, OnChangeCompare, OnChangeFilters, Order, OrderLog, OrderLogData, OrderType, Position, PositionLog, PositionLogData, Provider, Signal, SignalAnalysis, SimpleOrderLogData, Sl, Strategy, StrategyAPI, StrategyAPIEntryParams, StrategyAPIMarketDataParams, StrategyAdditionalIndicatorsMap, StrategyAiAdapter, StrategyClosePlan, StrategyConfig, StrategyConfigGrid, StrategyCoreRunner, StrategyCreator, StrategyCreatorParams, StrategyDecision, StrategyDirectionalTpSlParams, StrategyDirectionalTpSlResult, StrategyEntryBaseParams, StrategyEntryModelFigures, StrategyEntryOrderPlan, StrategyEntryRuntimeBaseParams, StrategyEntryRuntimeBuilderParams, StrategyEntryRuntimeOptions, StrategyEntrySignalContext, StrategyEntrySignalDecisionBuilderParams, StrategyEntryTakeProfitsParams, StrategyFigureLine, StrategyFigurePoint, StrategyFigurePoints, StrategyFigureZone, StrategyHookAfterAiContext, StrategyHookAfterDecisionContext, StrategyHookAfterPlaceOrderContext,
|
|
925
|
+
export type { AIChatHistory, AIChatMessage, AiPayload, BacktestPriceMode, BacktestRunConfig, BaseIndicatorsHistorySnapshot, Bot, BotConfig, BotResults, BotStatus, BuildStrategySignalDraft, BuildStrategySignalParams, Candle, ChartColor, CompletedTest, Connector, ConnectorConfig, ConnectorCreator, ConnectorPluginDefinition, ConnectorRegistryEntry, CreateStrategyCore, CreateStrategyCoreParams, DerivativesInterval, DerivativesRow, Direction, EOMPoint, Figure, Filters, GetTickers, Indicator, IndicatorPluginComputeParams, IndicatorPluginDefinition, IndicatorPluginEntry, IndicatorPluginFigureRenderer, IndicatorPluginRenderer, IndicatorSnapshot, Indicators, IndicatorsHistorySnapshot, Interval, Item, Items, Kline, KlineChartData, KlineChartItem, KlineRequest, MetricThreshold, Metrics, MinimalStat, MlCandleIndicatorsSnapshot, MonthlyEquityStats, OnChangeCompare, OnChangeFilters, Order, OrderLog, OrderLogData, OrderType, Position, PositionLog, PositionLogData, Provider, Signal, SignalAnalysis, SimpleOrderLogData, Sl, SpreadRow, Strategy, StrategyAPI, StrategyAPIEntryParams, StrategyAPIMarketDataParams, StrategyAdditionalIndicatorsMap, StrategyAiAdapter, StrategyClosePlan, StrategyConfig, StrategyConfigGrid, StrategyCoreRunner, StrategyCreator, StrategyCreatorParams, StrategyDecision, StrategyDirectionalTpSlParams, StrategyDirectionalTpSlResult, StrategyEntryBaseParams, StrategyEntryModelFigures, StrategyEntryOrderPlan, StrategyEntryRuntimeBaseParams, StrategyEntryRuntimeBuilderParams, StrategyEntryRuntimeOptions, StrategyEntrySignalContext, StrategyEntrySignalDecisionBuilderParams, StrategyEntryTakeProfitsParams, StrategyFigureLine, StrategyFigurePoint, StrategyFigurePoints, StrategyFigureZone, StrategyHookAfterAiContext, StrategyHookAfterDecisionContext, StrategyHookAfterPlaceOrderContext, StrategyHookAiContext, StrategyHookAiSkippedReason, StrategyHookBeforeCloseContext, StrategyHookBeforeEntryGateContext, StrategyHookBeforePlaceOrderContext, StrategyHookCtx, StrategyHookEnrichContext, StrategyHookEntryContext, StrategyHookErrorContext, StrategyHookErrorPayload, StrategyHookGateResult, StrategyHookInitContext, StrategyHookMarketContext, StrategyHookMlContext, StrategyHookMlSkippedReason, StrategyHookOrderContext, StrategyHookPolicyContext, StrategyHookSkipContext, StrategyHookStage, StrategyIndicatorsMap, StrategyIndicatorsState, StrategyLastTradeController, StrategyLastTradeControllerParams, StrategyManifest, StrategyMarketSnapshot, StrategyMlAdapter, StrategyPluginDefinition, StrategyRegistryEntry, StrategyResultConfig, StrategyResultEntry, StrategyResults, StrategyRuntimeAiOptions, StrategyRuntimeMlOptions, StrategySignalMetaParams, StrategySignalPriceParams, Test, TestCompare, TestCompareList, TestConnector, TestConnectorContext, TestConnectorCreator, TestResult, TestStat, TestSuite, TestThresholds, TestThresholdsKey, TestWorkerResult, TestingBox, TestingBoxResult, TestingOptions, ThresholdLevel, Ticker, Tp, Trend, TrendLine, TrendLineMode, TrendLineOptions, UIFilters };
|
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,27 @@ interface KlineRequest {
|
|
|
75
75
|
silent?: boolean;
|
|
76
76
|
cacheOnly?: boolean;
|
|
77
77
|
}
|
|
78
|
+
type DerivativesInterval = '15m' | '1h';
|
|
79
|
+
type DerivativesRow = {
|
|
80
|
+
symbol: string;
|
|
81
|
+
interval: DerivativesInterval;
|
|
82
|
+
ts: Date;
|
|
83
|
+
openInterest?: number | null;
|
|
84
|
+
fundingRate?: number | null;
|
|
85
|
+
liqLong?: number | null;
|
|
86
|
+
liqShort?: number | null;
|
|
87
|
+
liqTotal?: number | null;
|
|
88
|
+
source?: string | null;
|
|
89
|
+
};
|
|
90
|
+
type SpreadRow = {
|
|
91
|
+
symbol: string;
|
|
92
|
+
interval: DerivativesInterval;
|
|
93
|
+
ts: Date;
|
|
94
|
+
binancePrice?: number | null;
|
|
95
|
+
coinbasePrice?: number | null;
|
|
96
|
+
spread?: number | null;
|
|
97
|
+
source?: string | null;
|
|
98
|
+
};
|
|
78
99
|
interface Tp {
|
|
79
100
|
price: number;
|
|
80
101
|
rate: number;
|
|
@@ -473,64 +494,126 @@ interface StrategyHookGateResult {
|
|
|
473
494
|
allow?: boolean;
|
|
474
495
|
reason?: string;
|
|
475
496
|
}
|
|
476
|
-
|
|
497
|
+
type EntryDecision = Extract<StrategyDecision, {
|
|
498
|
+
kind: 'entry';
|
|
499
|
+
}>;
|
|
500
|
+
type ExitDecision = Extract<StrategyDecision, {
|
|
501
|
+
kind: 'exit';
|
|
502
|
+
}>;
|
|
503
|
+
interface StrategyHookCtx {
|
|
477
504
|
connector: Connector;
|
|
478
505
|
strategyName: string;
|
|
479
506
|
userName: string;
|
|
480
507
|
symbol: string;
|
|
481
|
-
|
|
508
|
+
strategyConfig: StrategyConfig;
|
|
482
509
|
env: string;
|
|
483
510
|
isConfigFromBacktest: boolean;
|
|
484
511
|
}
|
|
485
|
-
interface
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
512
|
+
interface StrategyHookMarketContext {
|
|
513
|
+
candle?: KlineChartItem;
|
|
514
|
+
btcCandle?: KlineChartItem;
|
|
515
|
+
data?: KlineChartItem[];
|
|
516
|
+
btcData?: KlineChartItem[];
|
|
517
|
+
}
|
|
518
|
+
interface StrategyHookEntryContext {
|
|
519
|
+
context: StrategyEntrySignalContext;
|
|
520
|
+
orderPlan: StrategyEntryOrderPlan;
|
|
489
521
|
signal?: Signal;
|
|
522
|
+
runtime: {
|
|
523
|
+
raw?: StrategyEntryRuntimeOptions;
|
|
524
|
+
resolved: StrategyEntryRuntimeOptions;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type StrategyHookMlSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_STRATEGY_CONFIG' | 'NO_THRESHOLD' | 'NO_RESULT';
|
|
528
|
+
interface StrategyHookMlContext {
|
|
529
|
+
config?: StrategyRuntimeMlOptions;
|
|
530
|
+
attempted: boolean;
|
|
531
|
+
applied: boolean;
|
|
532
|
+
result?: Signal['ml'];
|
|
533
|
+
skippedReason?: StrategyHookMlSkippedReason;
|
|
534
|
+
}
|
|
535
|
+
type StrategyHookAiSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_QUALITY';
|
|
536
|
+
interface StrategyHookAiContext {
|
|
537
|
+
config?: StrategyRuntimeAiOptions;
|
|
538
|
+
attempted: boolean;
|
|
539
|
+
applied: boolean;
|
|
540
|
+
quality?: number;
|
|
541
|
+
skippedReason?: StrategyHookAiSkippedReason;
|
|
542
|
+
}
|
|
543
|
+
type StrategyHookStage = 'onInit' | 'afterCoreDecision' | 'onSkip' | 'beforeClosePosition' | 'afterEnrichMl' | 'afterEnrichAi' | 'beforeEntryGate' | 'beforePlaceOrder' | 'afterPlaceOrder' | 'runtime.beforePlaceOrder' | 'enrichSignalWithMl' | 'enrichSignalWithAi' | 'closePosition' | 'placeOrder';
|
|
544
|
+
interface StrategyHookErrorPayload {
|
|
545
|
+
stage: StrategyHookStage;
|
|
546
|
+
cause: unknown;
|
|
490
547
|
}
|
|
491
|
-
interface
|
|
492
|
-
|
|
493
|
-
|
|
548
|
+
interface StrategyHookErrorContext {
|
|
549
|
+
ctx: StrategyHookCtx;
|
|
550
|
+
market?: StrategyHookMarketContext;
|
|
551
|
+
decision?: StrategyDecision;
|
|
552
|
+
entry?: StrategyHookEntryContext;
|
|
553
|
+
error: StrategyHookErrorPayload;
|
|
554
|
+
}
|
|
555
|
+
interface StrategyHookInitContext {
|
|
556
|
+
ctx: StrategyHookCtx;
|
|
557
|
+
market: Required<Pick<StrategyHookMarketContext, 'data' | 'btcData'>>;
|
|
494
558
|
}
|
|
495
|
-
interface StrategyHookAfterDecisionContext
|
|
559
|
+
interface StrategyHookAfterDecisionContext {
|
|
560
|
+
ctx: StrategyHookCtx;
|
|
561
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
496
562
|
decision: StrategyDecision;
|
|
497
|
-
candle: KlineChartItem;
|
|
498
|
-
btcCandle: KlineChartItem;
|
|
499
563
|
}
|
|
500
564
|
interface StrategyHookSkipContext extends StrategyHookAfterDecisionContext {
|
|
501
565
|
decision: Extract<StrategyDecision, {
|
|
502
566
|
kind: 'skip';
|
|
503
567
|
}>;
|
|
504
568
|
}
|
|
505
|
-
interface StrategyHookBeforeCloseContext extends
|
|
506
|
-
decision:
|
|
507
|
-
kind: 'exit';
|
|
508
|
-
}>;
|
|
569
|
+
interface StrategyHookBeforeCloseContext extends StrategyHookAfterDecisionContext {
|
|
570
|
+
decision: ExitDecision;
|
|
509
571
|
}
|
|
510
|
-
interface StrategyHookEnrichContext
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
572
|
+
interface StrategyHookEnrichContext {
|
|
573
|
+
ctx: StrategyHookCtx;
|
|
574
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
575
|
+
decision: EntryDecision;
|
|
576
|
+
entry: StrategyHookEntryContext;
|
|
577
|
+
ml: StrategyHookMlContext;
|
|
516
578
|
}
|
|
517
579
|
interface StrategyHookAfterAiContext extends StrategyHookEnrichContext {
|
|
518
|
-
|
|
580
|
+
ai: StrategyHookAiContext;
|
|
519
581
|
}
|
|
520
|
-
interface
|
|
582
|
+
interface StrategyHookPolicyContext {
|
|
583
|
+
aiQuality?: number;
|
|
521
584
|
makeOrdersEnabled: boolean;
|
|
522
585
|
minAiQuality: number;
|
|
523
586
|
}
|
|
524
|
-
interface
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
decision:
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
587
|
+
interface StrategyHookBeforeEntryGateContext {
|
|
588
|
+
ctx: StrategyHookCtx;
|
|
589
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
590
|
+
decision: EntryDecision;
|
|
591
|
+
entry: StrategyHookEntryContext;
|
|
592
|
+
policy: StrategyHookPolicyContext;
|
|
593
|
+
ml?: StrategyHookMlContext;
|
|
594
|
+
ai?: StrategyHookAiContext;
|
|
595
|
+
}
|
|
596
|
+
interface StrategyHookBeforePlaceOrderContext {
|
|
597
|
+
ctx: StrategyHookCtx;
|
|
598
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
599
|
+
decision: EntryDecision;
|
|
600
|
+
entry: StrategyHookEntryContext;
|
|
601
|
+
policy: StrategyHookPolicyContext;
|
|
602
|
+
ml?: StrategyHookMlContext;
|
|
603
|
+
ai?: StrategyHookAiContext;
|
|
604
|
+
}
|
|
605
|
+
interface StrategyHookOrderContext {
|
|
606
|
+
result: Signal | string;
|
|
607
|
+
}
|
|
608
|
+
interface StrategyHookAfterPlaceOrderContext {
|
|
609
|
+
ctx: StrategyHookCtx;
|
|
610
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
611
|
+
decision: EntryDecision;
|
|
612
|
+
entry: StrategyHookEntryContext;
|
|
613
|
+
policy: StrategyHookPolicyContext;
|
|
614
|
+
ml?: StrategyHookMlContext;
|
|
615
|
+
ai?: StrategyHookAiContext;
|
|
616
|
+
order: StrategyHookOrderContext;
|
|
534
617
|
}
|
|
535
618
|
interface StrategyManifest {
|
|
536
619
|
name: string;
|
|
@@ -839,4 +922,4 @@ interface IndicatorPluginDefinition {
|
|
|
839
922
|
indicatorEntries: IndicatorPluginEntry[];
|
|
840
923
|
}
|
|
841
924
|
|
|
842
|
-
export type { AIChatHistory, AIChatMessage, AiPayload, BacktestPriceMode, BacktestRunConfig, BaseIndicatorsHistorySnapshot, Bot, BotConfig, BotResults, BotStatus, BuildStrategySignalDraft, BuildStrategySignalParams, Candle, ChartColor, CompletedTest, Connector, ConnectorConfig, ConnectorCreator, ConnectorPluginDefinition, ConnectorRegistryEntry, CreateStrategyCore, CreateStrategyCoreParams, Direction, EOMPoint, Figure, Filters, GetTickers, Indicator, IndicatorPluginComputeParams, IndicatorPluginDefinition, IndicatorPluginEntry, IndicatorPluginFigureRenderer, IndicatorPluginRenderer, IndicatorSnapshot, Indicators, IndicatorsHistorySnapshot, Interval, Item, Items, Kline, KlineChartData, KlineChartItem, KlineRequest, MetricThreshold, Metrics, MinimalStat, MlCandleIndicatorsSnapshot, MonthlyEquityStats, OnChangeCompare, OnChangeFilters, Order, OrderLog, OrderLogData, OrderType, Position, PositionLog, PositionLogData, Provider, Signal, SignalAnalysis, SimpleOrderLogData, Sl, Strategy, StrategyAPI, StrategyAPIEntryParams, StrategyAPIMarketDataParams, StrategyAdditionalIndicatorsMap, StrategyAiAdapter, StrategyClosePlan, StrategyConfig, StrategyConfigGrid, StrategyCoreRunner, StrategyCreator, StrategyCreatorParams, StrategyDecision, StrategyDirectionalTpSlParams, StrategyDirectionalTpSlResult, StrategyEntryBaseParams, StrategyEntryModelFigures, StrategyEntryOrderPlan, StrategyEntryRuntimeBaseParams, StrategyEntryRuntimeBuilderParams, StrategyEntryRuntimeOptions, StrategyEntrySignalContext, StrategyEntrySignalDecisionBuilderParams, StrategyEntryTakeProfitsParams, StrategyFigureLine, StrategyFigurePoint, StrategyFigurePoints, StrategyFigureZone, StrategyHookAfterAiContext, StrategyHookAfterDecisionContext, StrategyHookAfterPlaceOrderContext,
|
|
925
|
+
export type { AIChatHistory, AIChatMessage, AiPayload, BacktestPriceMode, BacktestRunConfig, BaseIndicatorsHistorySnapshot, Bot, BotConfig, BotResults, BotStatus, BuildStrategySignalDraft, BuildStrategySignalParams, Candle, ChartColor, CompletedTest, Connector, ConnectorConfig, ConnectorCreator, ConnectorPluginDefinition, ConnectorRegistryEntry, CreateStrategyCore, CreateStrategyCoreParams, DerivativesInterval, DerivativesRow, Direction, EOMPoint, Figure, Filters, GetTickers, Indicator, IndicatorPluginComputeParams, IndicatorPluginDefinition, IndicatorPluginEntry, IndicatorPluginFigureRenderer, IndicatorPluginRenderer, IndicatorSnapshot, Indicators, IndicatorsHistorySnapshot, Interval, Item, Items, Kline, KlineChartData, KlineChartItem, KlineRequest, MetricThreshold, Metrics, MinimalStat, MlCandleIndicatorsSnapshot, MonthlyEquityStats, OnChangeCompare, OnChangeFilters, Order, OrderLog, OrderLogData, OrderType, Position, PositionLog, PositionLogData, Provider, Signal, SignalAnalysis, SimpleOrderLogData, Sl, SpreadRow, Strategy, StrategyAPI, StrategyAPIEntryParams, StrategyAPIMarketDataParams, StrategyAdditionalIndicatorsMap, StrategyAiAdapter, StrategyClosePlan, StrategyConfig, StrategyConfigGrid, StrategyCoreRunner, StrategyCreator, StrategyCreatorParams, StrategyDecision, StrategyDirectionalTpSlParams, StrategyDirectionalTpSlResult, StrategyEntryBaseParams, StrategyEntryModelFigures, StrategyEntryOrderPlan, StrategyEntryRuntimeBaseParams, StrategyEntryRuntimeBuilderParams, StrategyEntryRuntimeOptions, StrategyEntrySignalContext, StrategyEntrySignalDecisionBuilderParams, StrategyEntryTakeProfitsParams, StrategyFigureLine, StrategyFigurePoint, StrategyFigurePoints, StrategyFigureZone, StrategyHookAfterAiContext, StrategyHookAfterDecisionContext, StrategyHookAfterPlaceOrderContext, StrategyHookAiContext, StrategyHookAiSkippedReason, StrategyHookBeforeCloseContext, StrategyHookBeforeEntryGateContext, StrategyHookBeforePlaceOrderContext, StrategyHookCtx, StrategyHookEnrichContext, StrategyHookEntryContext, StrategyHookErrorContext, StrategyHookErrorPayload, StrategyHookGateResult, StrategyHookInitContext, StrategyHookMarketContext, StrategyHookMlContext, StrategyHookMlSkippedReason, StrategyHookOrderContext, StrategyHookPolicyContext, StrategyHookSkipContext, StrategyHookStage, StrategyIndicatorsMap, StrategyIndicatorsState, StrategyLastTradeController, StrategyLastTradeControllerParams, StrategyManifest, StrategyMarketSnapshot, StrategyMlAdapter, StrategyPluginDefinition, StrategyRegistryEntry, StrategyResultConfig, StrategyResultEntry, StrategyResults, StrategyRuntimeAiOptions, StrategyRuntimeMlOptions, StrategySignalMetaParams, StrategySignalPriceParams, Test, TestCompare, TestCompareList, TestConnector, TestConnectorContext, TestConnectorCreator, TestResult, TestStat, TestSuite, TestThresholds, TestThresholdsKey, TestWorkerResult, TestingBox, TestingBoxResult, TestingOptions, ThresholdLevel, Ticker, Tp, Trend, TrendLine, TrendLineMode, TrendLineOptions, UIFilters };
|