backtest-kit 2.0.7 → 2.0.9
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/build/index.cjs +23841 -21924
- package/build/index.mjs +23833 -21925
- package/package.json +1 -1
- package/types.d.ts +784 -2
package/types.d.ts
CHANGED
|
@@ -6783,6 +6783,214 @@ declare function getContext(): Promise<IMethodContext>;
|
|
|
6783
6783
|
*/
|
|
6784
6784
|
declare function getOrderBook(symbol: string, depth?: number): Promise<IOrderBookData>;
|
|
6785
6785
|
|
|
6786
|
+
/**
|
|
6787
|
+
* Commits signal prompt history to the message array.
|
|
6788
|
+
*
|
|
6789
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6790
|
+
* then adds signal-specific system prompts at the beginning and user prompt
|
|
6791
|
+
* at the end of the history array if they are not empty.
|
|
6792
|
+
*
|
|
6793
|
+
* Context extraction:
|
|
6794
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6795
|
+
* - backtest mode: From ExecutionContext
|
|
6796
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6797
|
+
*
|
|
6798
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6799
|
+
* @param history - Message array to append prompts to
|
|
6800
|
+
* @returns Promise that resolves when prompts are added
|
|
6801
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6802
|
+
*
|
|
6803
|
+
* @example
|
|
6804
|
+
* ```typescript
|
|
6805
|
+
* const messages: MessageModel[] = [];
|
|
6806
|
+
* await commitSignalPromptHistory("BTCUSDT", messages);
|
|
6807
|
+
* // messages now contains system prompts at start and user prompt at end
|
|
6808
|
+
* ```
|
|
6809
|
+
*/
|
|
6810
|
+
declare function commitSignalPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6811
|
+
/**
|
|
6812
|
+
* Commits risk rejection prompt history to the message array.
|
|
6813
|
+
*
|
|
6814
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6815
|
+
* then adds risk-specific system prompts at the beginning and user prompt
|
|
6816
|
+
* at the end of the history array if they are not empty.
|
|
6817
|
+
*
|
|
6818
|
+
* Context extraction:
|
|
6819
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6820
|
+
* - backtest mode: From ExecutionContext
|
|
6821
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6822
|
+
*
|
|
6823
|
+
* Used for AI-powered analysis when signals fail risk validation.
|
|
6824
|
+
*
|
|
6825
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6826
|
+
* @param history - Message array to append prompts to
|
|
6827
|
+
* @returns Promise that resolves when prompts are added
|
|
6828
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6829
|
+
*
|
|
6830
|
+
* @example
|
|
6831
|
+
* ```typescript
|
|
6832
|
+
* const messages: MessageModel[] = [];
|
|
6833
|
+
* await commitRiskPromptHistory("BTCUSDT", messages);
|
|
6834
|
+
* ```
|
|
6835
|
+
*/
|
|
6836
|
+
declare function commitRiskPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6837
|
+
/**
|
|
6838
|
+
* Commits trailing take-profit prompt history to the message array.
|
|
6839
|
+
*
|
|
6840
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6841
|
+
* then adds trailing take-profit specific system prompts at the beginning
|
|
6842
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6843
|
+
*
|
|
6844
|
+
* Context extraction:
|
|
6845
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6846
|
+
* - backtest mode: From ExecutionContext
|
|
6847
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6848
|
+
*
|
|
6849
|
+
* Used for AI-powered analysis of trailing take-profit adjustments.
|
|
6850
|
+
*
|
|
6851
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6852
|
+
* @param history - Message array to append prompts to
|
|
6853
|
+
* @returns Promise that resolves when prompts are added
|
|
6854
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6855
|
+
*
|
|
6856
|
+
* @example
|
|
6857
|
+
* ```typescript
|
|
6858
|
+
* const messages: MessageModel[] = [];
|
|
6859
|
+
* await commitTrailingTakePromptHistory("BTCUSDT", messages);
|
|
6860
|
+
* ```
|
|
6861
|
+
*/
|
|
6862
|
+
declare function commitTrailingTakePromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6863
|
+
/**
|
|
6864
|
+
* Commits trailing stop-loss prompt history to the message array.
|
|
6865
|
+
*
|
|
6866
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6867
|
+
* then adds trailing stop-loss specific system prompts at the beginning
|
|
6868
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6869
|
+
*
|
|
6870
|
+
* Context extraction:
|
|
6871
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6872
|
+
* - backtest mode: From ExecutionContext
|
|
6873
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6874
|
+
*
|
|
6875
|
+
* Used for AI-powered analysis of trailing stop-loss adjustments.
|
|
6876
|
+
*
|
|
6877
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6878
|
+
* @param history - Message array to append prompts to
|
|
6879
|
+
* @returns Promise that resolves when prompts are added
|
|
6880
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6881
|
+
*
|
|
6882
|
+
* @example
|
|
6883
|
+
* ```typescript
|
|
6884
|
+
* const messages: MessageModel[] = [];
|
|
6885
|
+
* await commitTrailingStopPromptHistory("BTCUSDT", messages);
|
|
6886
|
+
* ```
|
|
6887
|
+
*/
|
|
6888
|
+
declare function commitTrailingStopPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6889
|
+
/**
|
|
6890
|
+
* Commits partial profit prompt history to the message array.
|
|
6891
|
+
*
|
|
6892
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6893
|
+
* then adds partial profit specific system prompts at the beginning
|
|
6894
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6895
|
+
*
|
|
6896
|
+
* Context extraction:
|
|
6897
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6898
|
+
* - backtest mode: From ExecutionContext
|
|
6899
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6900
|
+
*
|
|
6901
|
+
* Used for AI-powered analysis of partial profit milestones.
|
|
6902
|
+
*
|
|
6903
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6904
|
+
* @param history - Message array to append prompts to
|
|
6905
|
+
* @returns Promise that resolves when prompts are added
|
|
6906
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6907
|
+
*
|
|
6908
|
+
* @example
|
|
6909
|
+
* ```typescript
|
|
6910
|
+
* const messages: MessageModel[] = [];
|
|
6911
|
+
* await commitPartialProfitPromptHistory("BTCUSDT", messages);
|
|
6912
|
+
* ```
|
|
6913
|
+
*/
|
|
6914
|
+
declare function commitPartialProfitPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6915
|
+
/**
|
|
6916
|
+
* Commits partial loss prompt history to the message array.
|
|
6917
|
+
*
|
|
6918
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6919
|
+
* then adds partial loss specific system prompts at the beginning
|
|
6920
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6921
|
+
*
|
|
6922
|
+
* Context extraction:
|
|
6923
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6924
|
+
* - backtest mode: From ExecutionContext
|
|
6925
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6926
|
+
*
|
|
6927
|
+
* Used for AI-powered analysis of partial loss milestones.
|
|
6928
|
+
*
|
|
6929
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6930
|
+
* @param history - Message array to append prompts to
|
|
6931
|
+
* @returns Promise that resolves when prompts are added
|
|
6932
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6933
|
+
*
|
|
6934
|
+
* @example
|
|
6935
|
+
* ```typescript
|
|
6936
|
+
* const messages: MessageModel[] = [];
|
|
6937
|
+
* await commitPartialLossPromptHistory("BTCUSDT", messages);
|
|
6938
|
+
* ```
|
|
6939
|
+
*/
|
|
6940
|
+
declare function commitPartialLossPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6941
|
+
/**
|
|
6942
|
+
* Commits breakeven prompt history to the message array.
|
|
6943
|
+
*
|
|
6944
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6945
|
+
* then adds breakeven specific system prompts at the beginning
|
|
6946
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6947
|
+
*
|
|
6948
|
+
* Context extraction:
|
|
6949
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6950
|
+
* - backtest mode: From ExecutionContext
|
|
6951
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6952
|
+
*
|
|
6953
|
+
* Used for AI-powered analysis of breakeven events.
|
|
6954
|
+
*
|
|
6955
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6956
|
+
* @param history - Message array to append prompts to
|
|
6957
|
+
* @returns Promise that resolves when prompts are added
|
|
6958
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6959
|
+
*
|
|
6960
|
+
* @example
|
|
6961
|
+
* ```typescript
|
|
6962
|
+
* const messages: MessageModel[] = [];
|
|
6963
|
+
* await commitBreakevenPromptHistory("BTCUSDT", messages);
|
|
6964
|
+
* ```
|
|
6965
|
+
*/
|
|
6966
|
+
declare function commitBreakevenPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6967
|
+
/**
|
|
6968
|
+
* Commits schedule cancellation prompt history to the message array.
|
|
6969
|
+
*
|
|
6970
|
+
* Extracts trading context from ExecutionContext and MethodContext,
|
|
6971
|
+
* then adds schedule cancellation specific system prompts at the beginning
|
|
6972
|
+
* and user prompt at the end of the history array if they are not empty.
|
|
6973
|
+
*
|
|
6974
|
+
* Context extraction:
|
|
6975
|
+
* - symbol: Provided as parameter for debugging convenience
|
|
6976
|
+
* - backtest mode: From ExecutionContext
|
|
6977
|
+
* - strategyName, exchangeName, frameName: From MethodContext
|
|
6978
|
+
*
|
|
6979
|
+
* Used for AI-powered analysis of schedule cancellation events.
|
|
6980
|
+
*
|
|
6981
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT") for debugging convenience
|
|
6982
|
+
* @param history - Message array to append prompts to
|
|
6983
|
+
* @returns Promise that resolves when prompts are added
|
|
6984
|
+
* @throws Error if ExecutionContext or MethodContext is not active
|
|
6985
|
+
*
|
|
6986
|
+
* @example
|
|
6987
|
+
* ```typescript
|
|
6988
|
+
* const messages: MessageModel[] = [];
|
|
6989
|
+
* await commitScheduleCancelPromptHistory("BTCUSDT", messages);
|
|
6990
|
+
* ```
|
|
6991
|
+
*/
|
|
6992
|
+
declare function commitScheduleCancelPromptHistory(symbol: string, history: MessageModel[]): Promise<void>;
|
|
6993
|
+
|
|
6786
6994
|
/**
|
|
6787
6995
|
* Dumps signal data and LLM conversation history to markdown files.
|
|
6788
6996
|
* Used by AI-powered strategies to save debug logs for analysis.
|
|
@@ -13192,6 +13400,200 @@ declare class BreakevenUtils {
|
|
|
13192
13400
|
*/
|
|
13193
13401
|
declare const Breakeven: BreakevenUtils;
|
|
13194
13402
|
|
|
13403
|
+
/**
|
|
13404
|
+
* Proxy wrapper for user-defined action handlers with automatic error capture.
|
|
13405
|
+
*
|
|
13406
|
+
* Wraps all IPublicAction methods with trycatch to prevent user code errors from crashing the system.
|
|
13407
|
+
* All errors are logged, sent to errorEmitter, and returned as null (non-breaking).
|
|
13408
|
+
*
|
|
13409
|
+
* Key features:
|
|
13410
|
+
* - Automatic error catching and logging for all action methods
|
|
13411
|
+
* - Safe execution of partial user implementations (missing methods return null)
|
|
13412
|
+
* - Consistent error capture across all action lifecycle events
|
|
13413
|
+
* - Non-breaking failure mode (errors logged but execution continues)
|
|
13414
|
+
*
|
|
13415
|
+
* Architecture:
|
|
13416
|
+
* - Private constructor enforces factory pattern via fromInstance()
|
|
13417
|
+
* - Each method checks if target implements the method before calling
|
|
13418
|
+
* - Errors caught with fallback handler (warn log + errorEmitter)
|
|
13419
|
+
* - Returns null on error to prevent undefined behavior
|
|
13420
|
+
*
|
|
13421
|
+
* Used by:
|
|
13422
|
+
* - ClientAction to wrap user-provided action handlers
|
|
13423
|
+
* - ActionCoreService to safely invoke action callbacks
|
|
13424
|
+
*
|
|
13425
|
+
* @example
|
|
13426
|
+
* ```typescript
|
|
13427
|
+
* // Create proxy from user implementation
|
|
13428
|
+
* const userAction = {
|
|
13429
|
+
* signal: async (event) => {
|
|
13430
|
+
* // User code that might throw
|
|
13431
|
+
* throw new Error('User error');
|
|
13432
|
+
* }
|
|
13433
|
+
* };
|
|
13434
|
+
*
|
|
13435
|
+
* const proxy = ActionProxy.fromInstance(userAction);
|
|
13436
|
+
*
|
|
13437
|
+
* // Error is caught and logged, execution continues
|
|
13438
|
+
* await proxy.signal(event); // Logs error, returns null
|
|
13439
|
+
* await proxy.dispose(); // Safe call even though not implemented
|
|
13440
|
+
* ```
|
|
13441
|
+
*
|
|
13442
|
+
* @example
|
|
13443
|
+
* ```typescript
|
|
13444
|
+
* // Partial implementation is safe
|
|
13445
|
+
* const partialAction = {
|
|
13446
|
+
* init: async () => console.log('Initialized'),
|
|
13447
|
+
* // Other methods not implemented
|
|
13448
|
+
* };
|
|
13449
|
+
*
|
|
13450
|
+
* const proxy = ActionProxy.fromInstance(partialAction);
|
|
13451
|
+
* await proxy.init(); // Works
|
|
13452
|
+
* await proxy.signal(event); // Returns null (not implemented)
|
|
13453
|
+
* ```
|
|
13454
|
+
*/
|
|
13455
|
+
declare class ActionProxy implements IPublicAction {
|
|
13456
|
+
readonly _target: Partial<IPublicAction>;
|
|
13457
|
+
/**
|
|
13458
|
+
* Creates a new ActionProxy instance.
|
|
13459
|
+
*
|
|
13460
|
+
* @param _target - Partial action implementation to wrap with error capture
|
|
13461
|
+
* @private Use ActionProxy.fromInstance() instead
|
|
13462
|
+
*/
|
|
13463
|
+
private constructor();
|
|
13464
|
+
/**
|
|
13465
|
+
* Initializes the action handler with error capture.
|
|
13466
|
+
*
|
|
13467
|
+
* Wraps the user's init() method in trycatch to prevent initialization errors from crashing the system.
|
|
13468
|
+
* If the target doesn't implement init(), this method safely returns undefined.
|
|
13469
|
+
*
|
|
13470
|
+
* @returns Promise resolving to user's init() result or undefined if not implemented
|
|
13471
|
+
*/
|
|
13472
|
+
init(): Promise<any>;
|
|
13473
|
+
/**
|
|
13474
|
+
* Handles signal events from all modes with error capture.
|
|
13475
|
+
*
|
|
13476
|
+
* Wraps the user's signal() method to catch and log any errors.
|
|
13477
|
+
* Called on every tick/candle when strategy is evaluated.
|
|
13478
|
+
*
|
|
13479
|
+
* @param event - Signal state result with action, state, signal data, and context
|
|
13480
|
+
* @returns Promise resolving to user's signal() result or null on error
|
|
13481
|
+
*/
|
|
13482
|
+
signal(event: IStrategyTickResult): Promise<any>;
|
|
13483
|
+
/**
|
|
13484
|
+
* Handles signal events from live trading only with error capture.
|
|
13485
|
+
*
|
|
13486
|
+
* Wraps the user's signalLive() method to catch and log any errors.
|
|
13487
|
+
* Called every tick in live mode.
|
|
13488
|
+
*
|
|
13489
|
+
* @param event - Signal state result from live trading
|
|
13490
|
+
* @returns Promise resolving to user's signalLive() result or null on error
|
|
13491
|
+
*/
|
|
13492
|
+
signalLive(event: IStrategyTickResult): Promise<any>;
|
|
13493
|
+
/**
|
|
13494
|
+
* Handles signal events from backtest only with error capture.
|
|
13495
|
+
*
|
|
13496
|
+
* Wraps the user's signalBacktest() method to catch and log any errors.
|
|
13497
|
+
* Called every candle in backtest mode.
|
|
13498
|
+
*
|
|
13499
|
+
* @param event - Signal state result from backtest
|
|
13500
|
+
* @returns Promise resolving to user's signalBacktest() result or null on error
|
|
13501
|
+
*/
|
|
13502
|
+
signalBacktest(event: IStrategyTickResult): Promise<any>;
|
|
13503
|
+
/**
|
|
13504
|
+
* Handles breakeven events with error capture.
|
|
13505
|
+
*
|
|
13506
|
+
* Wraps the user's breakevenAvailable() method to catch and log any errors.
|
|
13507
|
+
* Called once per signal when stop-loss is moved to entry price.
|
|
13508
|
+
*
|
|
13509
|
+
* @param event - Breakeven milestone data with signal info, current price, timestamp
|
|
13510
|
+
* @returns Promise resolving to user's breakevenAvailable() result or null on error
|
|
13511
|
+
*/
|
|
13512
|
+
breakevenAvailable(event: BreakevenContract): Promise<any>;
|
|
13513
|
+
/**
|
|
13514
|
+
* Handles partial profit level events with error capture.
|
|
13515
|
+
*
|
|
13516
|
+
* Wraps the user's partialProfitAvailable() method to catch and log any errors.
|
|
13517
|
+
* Called once per profit level per signal (10%, 20%, 30%, etc).
|
|
13518
|
+
*
|
|
13519
|
+
* @param event - Profit milestone data with signal info, level, price, timestamp
|
|
13520
|
+
* @returns Promise resolving to user's partialProfitAvailable() result or null on error
|
|
13521
|
+
*/
|
|
13522
|
+
partialProfitAvailable(event: PartialProfitContract): Promise<any>;
|
|
13523
|
+
/**
|
|
13524
|
+
* Handles partial loss level events with error capture.
|
|
13525
|
+
*
|
|
13526
|
+
* Wraps the user's partialLossAvailable() method to catch and log any errors.
|
|
13527
|
+
* Called once per loss level per signal (-10%, -20%, -30%, etc).
|
|
13528
|
+
*
|
|
13529
|
+
* @param event - Loss milestone data with signal info, level, price, timestamp
|
|
13530
|
+
* @returns Promise resolving to user's partialLossAvailable() result or null on error
|
|
13531
|
+
*/
|
|
13532
|
+
partialLossAvailable(event: PartialLossContract): Promise<any>;
|
|
13533
|
+
/**
|
|
13534
|
+
* Handles scheduled ping events with error capture.
|
|
13535
|
+
*
|
|
13536
|
+
* Wraps the user's pingScheduled() method to catch and log any errors.
|
|
13537
|
+
* Called every minute while a scheduled signal is waiting for activation.
|
|
13538
|
+
*
|
|
13539
|
+
* @param event - Scheduled signal monitoring data with symbol, strategy info, signal data, timestamp
|
|
13540
|
+
* @returns Promise resolving to user's pingScheduled() result or null on error
|
|
13541
|
+
*/
|
|
13542
|
+
pingScheduled(event: SchedulePingContract): Promise<any>;
|
|
13543
|
+
/**
|
|
13544
|
+
* Handles active ping events with error capture.
|
|
13545
|
+
*
|
|
13546
|
+
* Wraps the user's pingActive() method to catch and log any errors.
|
|
13547
|
+
* Called every minute while a pending signal is active (position open).
|
|
13548
|
+
*
|
|
13549
|
+
* @param event - Active pending signal monitoring data with symbol, strategy info, signal data, timestamp
|
|
13550
|
+
* @returns Promise resolving to user's pingActive() result or null on error
|
|
13551
|
+
*/
|
|
13552
|
+
pingActive(event: ActivePingContract): Promise<any>;
|
|
13553
|
+
/**
|
|
13554
|
+
* Handles risk rejection events with error capture.
|
|
13555
|
+
*
|
|
13556
|
+
* Wraps the user's riskRejection() method to catch and log any errors.
|
|
13557
|
+
* Called only when signal is rejected by risk management validation.
|
|
13558
|
+
*
|
|
13559
|
+
* @param event - Risk rejection data with symbol, pending signal, rejection reason, timestamp
|
|
13560
|
+
* @returns Promise resolving to user's riskRejection() result or null on error
|
|
13561
|
+
*/
|
|
13562
|
+
riskRejection(event: RiskContract): Promise<any>;
|
|
13563
|
+
/**
|
|
13564
|
+
* Cleans up resources with error capture.
|
|
13565
|
+
*
|
|
13566
|
+
* Wraps the user's dispose() method to catch and log any errors.
|
|
13567
|
+
* Called once when strategy execution ends.
|
|
13568
|
+
*
|
|
13569
|
+
* @returns Promise resolving to user's dispose() result or null on error
|
|
13570
|
+
*/
|
|
13571
|
+
dispose(): Promise<any>;
|
|
13572
|
+
/**
|
|
13573
|
+
* Creates a new ActionProxy instance wrapping a user-provided action handler.
|
|
13574
|
+
*
|
|
13575
|
+
* Factory method enforcing the private constructor pattern.
|
|
13576
|
+
* Wraps all methods of the provided instance with error capture.
|
|
13577
|
+
*
|
|
13578
|
+
* @param instance - Partial action implementation to wrap
|
|
13579
|
+
* @returns New ActionProxy instance with error-safe method wrappers
|
|
13580
|
+
*
|
|
13581
|
+
* @example
|
|
13582
|
+
* ```typescript
|
|
13583
|
+
* const userAction = {
|
|
13584
|
+
* signal: async (event) => {
|
|
13585
|
+
* console.log('Signal received:', event);
|
|
13586
|
+
* },
|
|
13587
|
+
* dispose: async () => {
|
|
13588
|
+
* console.log('Cleanup complete');
|
|
13589
|
+
* }
|
|
13590
|
+
* };
|
|
13591
|
+
*
|
|
13592
|
+
* const proxy = ActionProxy.fromInstance(userAction);
|
|
13593
|
+
* ```
|
|
13594
|
+
*/
|
|
13595
|
+
static fromInstance(instance: Partial<IPublicAction>): ActionProxy;
|
|
13596
|
+
}
|
|
13195
13597
|
/**
|
|
13196
13598
|
* Base class for custom action handlers.
|
|
13197
13599
|
*
|
|
@@ -15385,7 +15787,7 @@ declare class ClientAction implements IAction {
|
|
|
15385
15787
|
* Handler instance created from params.handler constructor.
|
|
15386
15788
|
* Starts as null, gets initialized on first use.
|
|
15387
15789
|
*/
|
|
15388
|
-
_handlerInstance:
|
|
15790
|
+
_handlerInstance: ActionProxy | null;
|
|
15389
15791
|
/**
|
|
15390
15792
|
* Creates a new ClientAction instance.
|
|
15391
15793
|
*
|
|
@@ -18849,7 +19251,387 @@ declare class RiskReportService {
|
|
|
18849
19251
|
unsubscribe: () => Promise<void>;
|
|
18850
19252
|
}
|
|
18851
19253
|
|
|
19254
|
+
/**
|
|
19255
|
+
* Service for managing signal prompts for AI/LLM integrations.
|
|
19256
|
+
*
|
|
19257
|
+
* Provides access to system and user prompts configured in signal.prompt.cjs.
|
|
19258
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19259
|
+
*
|
|
19260
|
+
* Key responsibilities:
|
|
19261
|
+
* - Lazy-loads prompt configuration from config/prompt/signal.prompt.cjs
|
|
19262
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19263
|
+
* - Provides user prompt strings
|
|
19264
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19265
|
+
*
|
|
19266
|
+
* Used for AI-powered signal analysis and strategy recommendations.
|
|
19267
|
+
*/
|
|
19268
|
+
declare class SignalPromptService {
|
|
19269
|
+
private readonly loggerService;
|
|
19270
|
+
/**
|
|
19271
|
+
* Retrieves system prompts for AI context.
|
|
19272
|
+
*
|
|
19273
|
+
* System prompts can be:
|
|
19274
|
+
* - Static array of strings (returned directly)
|
|
19275
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19276
|
+
* - Undefined (returns empty array)
|
|
19277
|
+
*
|
|
19278
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19279
|
+
* @param strategyName - Strategy identifier
|
|
19280
|
+
* @param exchangeName - Exchange identifier
|
|
19281
|
+
* @param frameName - Timeframe identifier
|
|
19282
|
+
* @param backtest - Whether running in backtest mode
|
|
19283
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19284
|
+
*/
|
|
19285
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19286
|
+
/**
|
|
19287
|
+
* Retrieves user prompt string for AI input.
|
|
19288
|
+
*
|
|
19289
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19290
|
+
* @param strategyName - Strategy identifier
|
|
19291
|
+
* @param exchangeName - Exchange identifier
|
|
19292
|
+
* @param frameName - Timeframe identifier
|
|
19293
|
+
* @param backtest - Whether running in backtest mode
|
|
19294
|
+
* @returns Promise resolving to user prompt string
|
|
19295
|
+
*/
|
|
19296
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19297
|
+
}
|
|
19298
|
+
|
|
19299
|
+
/**
|
|
19300
|
+
* Service for managing risk rejection prompts for AI/LLM integrations.
|
|
19301
|
+
*
|
|
19302
|
+
* Provides access to system and user prompts configured in risk.prompt.cjs.
|
|
19303
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19304
|
+
*
|
|
19305
|
+
* Key responsibilities:
|
|
19306
|
+
* - Lazy-loads prompt configuration from config/prompt/risk.prompt.cjs
|
|
19307
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19308
|
+
* - Provides user prompt strings
|
|
19309
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19310
|
+
*
|
|
19311
|
+
* Used for AI-powered analysis when signals fail risk validation.
|
|
19312
|
+
* Triggered by: riskRejection() events in ActionBase
|
|
19313
|
+
* Use cases: Analyze rejection reasons, suggest risk adjustments, track rejection patterns
|
|
19314
|
+
*/
|
|
19315
|
+
declare class RiskPromptService {
|
|
19316
|
+
private readonly loggerService;
|
|
19317
|
+
/**
|
|
19318
|
+
* Retrieves system prompts for AI context.
|
|
19319
|
+
*
|
|
19320
|
+
* System prompts can be:
|
|
19321
|
+
* - Static array of strings (returned directly)
|
|
19322
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19323
|
+
* - Undefined (returns empty array)
|
|
19324
|
+
*
|
|
19325
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19326
|
+
* @param strategyName - Strategy identifier
|
|
19327
|
+
* @param exchangeName - Exchange identifier
|
|
19328
|
+
* @param frameName - Timeframe identifier
|
|
19329
|
+
* @param backtest - Whether running in backtest mode
|
|
19330
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19331
|
+
*/
|
|
19332
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19333
|
+
/**
|
|
19334
|
+
* Retrieves user prompt string for AI input.
|
|
19335
|
+
*
|
|
19336
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19337
|
+
* @param strategyName - Strategy identifier
|
|
19338
|
+
* @param exchangeName - Exchange identifier
|
|
19339
|
+
* @param frameName - Timeframe identifier
|
|
19340
|
+
* @param backtest - Whether running in backtest mode
|
|
19341
|
+
* @returns Promise resolving to user prompt string
|
|
19342
|
+
*/
|
|
19343
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19344
|
+
}
|
|
19345
|
+
|
|
19346
|
+
/**
|
|
19347
|
+
* Service for managing trailing take-profit prompts for AI/LLM integrations.
|
|
19348
|
+
*
|
|
19349
|
+
* Provides access to system and user prompts configured in trailing-take.prompt.cjs.
|
|
19350
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19351
|
+
*
|
|
19352
|
+
* Key responsibilities:
|
|
19353
|
+
* - Lazy-loads prompt configuration from config/prompt/trailing-take.prompt.cjs
|
|
19354
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19355
|
+
* - Provides user prompt strings
|
|
19356
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19357
|
+
*
|
|
19358
|
+
* Used for AI-powered analysis of trailing take-profit adjustments.
|
|
19359
|
+
* Use cases: Suggest optimal trailing levels, analyze profit-taking strategies, optimize exit timing
|
|
19360
|
+
*/
|
|
19361
|
+
declare class TrailingTakePromptService {
|
|
19362
|
+
private readonly loggerService;
|
|
19363
|
+
/**
|
|
19364
|
+
* Retrieves system prompts for AI context.
|
|
19365
|
+
*
|
|
19366
|
+
* System prompts can be:
|
|
19367
|
+
* - Static array of strings (returned directly)
|
|
19368
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19369
|
+
* - Undefined (returns empty array)
|
|
19370
|
+
*
|
|
19371
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19372
|
+
* @param strategyName - Strategy identifier
|
|
19373
|
+
* @param exchangeName - Exchange identifier
|
|
19374
|
+
* @param frameName - Timeframe identifier
|
|
19375
|
+
* @param backtest - Whether running in backtest mode
|
|
19376
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19377
|
+
*/
|
|
19378
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19379
|
+
/**
|
|
19380
|
+
* Retrieves user prompt string for AI input.
|
|
19381
|
+
*
|
|
19382
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19383
|
+
* @param strategyName - Strategy identifier
|
|
19384
|
+
* @param exchangeName - Exchange identifier
|
|
19385
|
+
* @param frameName - Timeframe identifier
|
|
19386
|
+
* @param backtest - Whether running in backtest mode
|
|
19387
|
+
* @returns Promise resolving to user prompt string
|
|
19388
|
+
*/
|
|
19389
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19390
|
+
}
|
|
19391
|
+
|
|
19392
|
+
/**
|
|
19393
|
+
* Service for managing trailing stop-loss prompts for AI/LLM integrations.
|
|
19394
|
+
*
|
|
19395
|
+
* Provides access to system and user prompts configured in trailing-stop.prompt.cjs.
|
|
19396
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19397
|
+
*
|
|
19398
|
+
* Key responsibilities:
|
|
19399
|
+
* - Lazy-loads prompt configuration from config/prompt/trailing-stop.prompt.cjs
|
|
19400
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19401
|
+
* - Provides user prompt strings
|
|
19402
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19403
|
+
*
|
|
19404
|
+
* Used for AI-powered analysis of trailing stop-loss adjustments.
|
|
19405
|
+
* Use cases: Suggest optimal trailing distances, analyze risk protection strategies, optimize stop placement
|
|
19406
|
+
*/
|
|
19407
|
+
declare class TrailingStopPromptService {
|
|
19408
|
+
private readonly loggerService;
|
|
19409
|
+
/**
|
|
19410
|
+
* Retrieves system prompts for AI context.
|
|
19411
|
+
*
|
|
19412
|
+
* System prompts can be:
|
|
19413
|
+
* - Static array of strings (returned directly)
|
|
19414
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19415
|
+
* - Undefined (returns empty array)
|
|
19416
|
+
*
|
|
19417
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19418
|
+
* @param strategyName - Strategy identifier
|
|
19419
|
+
* @param exchangeName - Exchange identifier
|
|
19420
|
+
* @param frameName - Timeframe identifier
|
|
19421
|
+
* @param backtest - Whether running in backtest mode
|
|
19422
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19423
|
+
*/
|
|
19424
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19425
|
+
/**
|
|
19426
|
+
* Retrieves user prompt string for AI input.
|
|
19427
|
+
*
|
|
19428
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19429
|
+
* @param strategyName - Strategy identifier
|
|
19430
|
+
* @param exchangeName - Exchange identifier
|
|
19431
|
+
* @param frameName - Timeframe identifier
|
|
19432
|
+
* @param backtest - Whether running in backtest mode
|
|
19433
|
+
* @returns Promise resolving to user prompt string
|
|
19434
|
+
*/
|
|
19435
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19436
|
+
}
|
|
19437
|
+
|
|
19438
|
+
/**
|
|
19439
|
+
* Service for managing partial profit prompts for AI/LLM integrations.
|
|
19440
|
+
*
|
|
19441
|
+
* Provides access to system and user prompts configured in partial-profit.prompt.cjs.
|
|
19442
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19443
|
+
*
|
|
19444
|
+
* Key responsibilities:
|
|
19445
|
+
* - Lazy-loads prompt configuration from config/prompt/partial-profit.prompt.cjs
|
|
19446
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19447
|
+
* - Provides user prompt strings
|
|
19448
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19449
|
+
*
|
|
19450
|
+
* Used for AI-powered analysis when profit milestones are reached (10%, 20%, 30%, etc).
|
|
19451
|
+
* Triggered by: partialProfitAvailable() events in ActionBase
|
|
19452
|
+
* Use cases: Suggest position adjustments, analyze profit-taking opportunities, optimize milestone actions
|
|
19453
|
+
*/
|
|
19454
|
+
declare class PartialProfitPromptService {
|
|
19455
|
+
private readonly loggerService;
|
|
19456
|
+
/**
|
|
19457
|
+
* Retrieves system prompts for AI context.
|
|
19458
|
+
*
|
|
19459
|
+
* System prompts can be:
|
|
19460
|
+
* - Static array of strings (returned directly)
|
|
19461
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19462
|
+
* - Undefined (returns empty array)
|
|
19463
|
+
*
|
|
19464
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19465
|
+
* @param strategyName - Strategy identifier
|
|
19466
|
+
* @param exchangeName - Exchange identifier
|
|
19467
|
+
* @param frameName - Timeframe identifier
|
|
19468
|
+
* @param backtest - Whether running in backtest mode
|
|
19469
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19470
|
+
*/
|
|
19471
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19472
|
+
/**
|
|
19473
|
+
* Retrieves user prompt string for AI input.
|
|
19474
|
+
*
|
|
19475
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19476
|
+
* @param strategyName - Strategy identifier
|
|
19477
|
+
* @param exchangeName - Exchange identifier
|
|
19478
|
+
* @param frameName - Timeframe identifier
|
|
19479
|
+
* @param backtest - Whether running in backtest mode
|
|
19480
|
+
* @returns Promise resolving to user prompt string
|
|
19481
|
+
*/
|
|
19482
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19483
|
+
}
|
|
19484
|
+
|
|
19485
|
+
/**
|
|
19486
|
+
* Service for managing partial loss prompts for AI/LLM integrations.
|
|
19487
|
+
*
|
|
19488
|
+
* Provides access to system and user prompts configured in partial-loss.prompt.cjs.
|
|
19489
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19490
|
+
*
|
|
19491
|
+
* Key responsibilities:
|
|
19492
|
+
* - Lazy-loads prompt configuration from config/prompt/partial-loss.prompt.cjs
|
|
19493
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19494
|
+
* - Provides user prompt strings
|
|
19495
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19496
|
+
*
|
|
19497
|
+
* Used for AI-powered analysis when loss milestones are reached (-10%, -20%, -30%, etc).
|
|
19498
|
+
* Triggered by: partialLossAvailable() events in ActionBase
|
|
19499
|
+
* Use cases: Suggest risk management actions, analyze loss mitigation strategies, optimize exit decisions
|
|
19500
|
+
*/
|
|
19501
|
+
declare class PartialLossPromptService {
|
|
19502
|
+
private readonly loggerService;
|
|
19503
|
+
/**
|
|
19504
|
+
* Retrieves system prompts for AI context.
|
|
19505
|
+
*
|
|
19506
|
+
* System prompts can be:
|
|
19507
|
+
* - Static array of strings (returned directly)
|
|
19508
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19509
|
+
* - Undefined (returns empty array)
|
|
19510
|
+
*
|
|
19511
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19512
|
+
* @param strategyName - Strategy identifier
|
|
19513
|
+
* @param exchangeName - Exchange identifier
|
|
19514
|
+
* @param frameName - Timeframe identifier
|
|
19515
|
+
* @param backtest - Whether running in backtest mode
|
|
19516
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19517
|
+
*/
|
|
19518
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19519
|
+
/**
|
|
19520
|
+
* Retrieves user prompt string for AI input.
|
|
19521
|
+
*
|
|
19522
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19523
|
+
* @param strategyName - Strategy identifier
|
|
19524
|
+
* @param exchangeName - Exchange identifier
|
|
19525
|
+
* @param frameName - Timeframe identifier
|
|
19526
|
+
* @param backtest - Whether running in backtest mode
|
|
19527
|
+
* @returns Promise resolving to user prompt string
|
|
19528
|
+
*/
|
|
19529
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19530
|
+
}
|
|
19531
|
+
|
|
19532
|
+
/**
|
|
19533
|
+
* Service for managing breakeven prompts for AI/LLM integrations.
|
|
19534
|
+
*
|
|
19535
|
+
* Provides access to system and user prompts configured in breakeven.prompt.cjs.
|
|
19536
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19537
|
+
*
|
|
19538
|
+
* Key responsibilities:
|
|
19539
|
+
* - Lazy-loads prompt configuration from config/prompt/breakeven.prompt.cjs
|
|
19540
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19541
|
+
* - Provides user prompt strings
|
|
19542
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19543
|
+
*
|
|
19544
|
+
* Used for AI-powered analysis when stop-loss is moved to entry price (risk-free position).
|
|
19545
|
+
* Triggered by: breakevenAvailable() events in ActionBase
|
|
19546
|
+
* Use cases: Suggest position management after breakeven, analyze profit potential, optimize trailing strategies
|
|
19547
|
+
*/
|
|
19548
|
+
declare class BreakevenPromptService {
|
|
19549
|
+
private readonly loggerService;
|
|
19550
|
+
/**
|
|
19551
|
+
* Retrieves system prompts for AI context.
|
|
19552
|
+
*
|
|
19553
|
+
* System prompts can be:
|
|
19554
|
+
* - Static array of strings (returned directly)
|
|
19555
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19556
|
+
* - Undefined (returns empty array)
|
|
19557
|
+
*
|
|
19558
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19559
|
+
* @param strategyName - Strategy identifier
|
|
19560
|
+
* @param exchangeName - Exchange identifier
|
|
19561
|
+
* @param frameName - Timeframe identifier
|
|
19562
|
+
* @param backtest - Whether running in backtest mode
|
|
19563
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19564
|
+
*/
|
|
19565
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19566
|
+
/**
|
|
19567
|
+
* Retrieves user prompt string for AI input.
|
|
19568
|
+
*
|
|
19569
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19570
|
+
* @param strategyName - Strategy identifier
|
|
19571
|
+
* @param exchangeName - Exchange identifier
|
|
19572
|
+
* @param frameName - Timeframe identifier
|
|
19573
|
+
* @param backtest - Whether running in backtest mode
|
|
19574
|
+
* @returns Promise resolving to user prompt string
|
|
19575
|
+
*/
|
|
19576
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19577
|
+
}
|
|
19578
|
+
|
|
19579
|
+
/**
|
|
19580
|
+
* Service for managing schedule cancellation prompts for AI/LLM integrations.
|
|
19581
|
+
*
|
|
19582
|
+
* Provides access to system and user prompts configured in schedule-cancel.prompt.cjs.
|
|
19583
|
+
* Supports both static prompt arrays and dynamic prompt functions.
|
|
19584
|
+
*
|
|
19585
|
+
* Key responsibilities:
|
|
19586
|
+
* - Lazy-loads prompt configuration from config/prompt/schedule-cancel.prompt.cjs
|
|
19587
|
+
* - Resolves system prompts (static arrays or async functions)
|
|
19588
|
+
* - Provides user prompt strings
|
|
19589
|
+
* - Falls back to empty prompts if configuration is missing
|
|
19590
|
+
*
|
|
19591
|
+
* Used for AI-powered analysis when scheduled signals are cancelled before activation.
|
|
19592
|
+
* Triggered by: signal() events with action='cancelled' in ActionBase
|
|
19593
|
+
* Use cases: Analyze cancellation reasons, track signal invalidation patterns, optimize scheduling logic
|
|
19594
|
+
*/
|
|
19595
|
+
declare class ScheduleCancelPromptService {
|
|
19596
|
+
private readonly loggerService;
|
|
19597
|
+
/**
|
|
19598
|
+
* Retrieves system prompts for AI context.
|
|
19599
|
+
*
|
|
19600
|
+
* System prompts can be:
|
|
19601
|
+
* - Static array of strings (returned directly)
|
|
19602
|
+
* - Async/sync function returning string array (executed and awaited)
|
|
19603
|
+
* - Undefined (returns empty array)
|
|
19604
|
+
*
|
|
19605
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19606
|
+
* @param strategyName - Strategy identifier
|
|
19607
|
+
* @param exchangeName - Exchange identifier
|
|
19608
|
+
* @param frameName - Timeframe identifier
|
|
19609
|
+
* @param backtest - Whether running in backtest mode
|
|
19610
|
+
* @returns Promise resolving to array of system prompt strings
|
|
19611
|
+
*/
|
|
19612
|
+
getSystemPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string[]>;
|
|
19613
|
+
/**
|
|
19614
|
+
* Retrieves user prompt string for AI input.
|
|
19615
|
+
*
|
|
19616
|
+
* @param symbol - Trading symbol (e.g., "BTCUSDT")
|
|
19617
|
+
* @param strategyName - Strategy identifier
|
|
19618
|
+
* @param exchangeName - Exchange identifier
|
|
19619
|
+
* @param frameName - Timeframe identifier
|
|
19620
|
+
* @param backtest - Whether running in backtest mode
|
|
19621
|
+
* @returns Promise resolving to user prompt string
|
|
19622
|
+
*/
|
|
19623
|
+
getUserPrompt: (symbol: string, strategyName: StrategyName, exchangeName: ExchangeName, frameName: FrameName, backtest: boolean) => Promise<string>;
|
|
19624
|
+
}
|
|
19625
|
+
|
|
18852
19626
|
declare const backtest: {
|
|
19627
|
+
signalPromptService: SignalPromptService;
|
|
19628
|
+
riskPromptService: RiskPromptService;
|
|
19629
|
+
trailingTakePromptService: TrailingTakePromptService;
|
|
19630
|
+
trailingStopPromptService: TrailingStopPromptService;
|
|
19631
|
+
partialProfitPromptService: PartialProfitPromptService;
|
|
19632
|
+
partialLossPromptService: PartialLossPromptService;
|
|
19633
|
+
breakevenPromptService: BreakevenPromptService;
|
|
19634
|
+
scheduleCancelPromptService: ScheduleCancelPromptService;
|
|
18853
19635
|
optimizerTemplateService: OptimizerTemplateService;
|
|
18854
19636
|
exchangeValidationService: ExchangeValidationService;
|
|
18855
19637
|
strategyValidationService: StrategyValidationService;
|
|
@@ -18924,4 +19706,4 @@ declare const backtest: {
|
|
|
18924
19706
|
loggerService: LoggerService;
|
|
18925
19707
|
};
|
|
18926
19708
|
|
|
18927
|
-
export { ActionBase, type ActivePingContract, Backtest, type BacktestDoneNotification, type BacktestStatisticsModel, type BootstrapNotification, Breakeven, type BreakevenContract, type BreakevenData, Cache, type CandleInterval, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, type IBidData, type ICandleData, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type IMarkdownDumpOptions, type IOptimizerCallbacks, type IOptimizerData, type IOptimizerFetchArgs, type IOptimizerFilterArgs, type IOptimizerRange, type IOptimizerSchema, type IOptimizerSource, type IOptimizerStrategy, type IOptimizerTemplate, type IOrderBookData, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Live, type LiveDoneNotification, type LiveStatisticsModel, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, type MessageModel, type MessageRole, MethodContextService, type MetricStats, Notification, type NotificationModel, Optimizer, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossContract, type PartialLossNotification, type PartialProfitContract, type PartialProfitNotification, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PositionSize, type ProgressBacktestContract, type ProgressBacktestNotification, type ProgressOptimizerContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenedNotification, type SignalScheduledNotification, type TMarkdownBase, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TickEvent, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addOptimizerSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, commitBreakeven, commitCancel, commitPartialLoss, commitPartialProfit, commitTrailingStop, commitTrailingTake, dumpSignalData, emitters, formatPrice, formatQuantity, get, getActionSchema, getAveragePrice, getBacktestTimeframe, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getExchangeSchema, getFrameSchema, getMode, getOptimizerSchema, getOrderBook, getRiskSchema, getSizingSchema, getStrategySchema, getSymbol, getWalkerSchema, hasTradeContext, backtest as lib, listExchangeSchema, listFrameSchema, listOptimizerSchema, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenOptimizerProgress, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideOptimizerSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, roundTicks, set, setColumns, setConfig, setLogger, stop, validate };
|
|
19709
|
+
export { ActionBase, type ActivePingContract, Backtest, type BacktestDoneNotification, type BacktestStatisticsModel, type BootstrapNotification, Breakeven, type BreakevenContract, type BreakevenData, Cache, type CandleInterval, type ColumnConfig, type ColumnModel, Constant, type CriticalErrorNotification, type DoneContract, type EntityId, Exchange, ExecutionContextService, type FrameInterval, type GlobalConfig, Heat, type HeatmapStatisticsModel, type IBidData, type ICandleData, type IExchangeSchema, type IFrameSchema, type IHeatmapRow, type IMarkdownDumpOptions, type IOptimizerCallbacks, type IOptimizerData, type IOptimizerFetchArgs, type IOptimizerFilterArgs, type IOptimizerRange, type IOptimizerSchema, type IOptimizerSource, type IOptimizerStrategy, type IOptimizerTemplate, type IOrderBookData, type IPersistBase, type IPositionSizeATRParams, type IPositionSizeFixedPercentageParams, type IPositionSizeKellyParams, type IPublicSignalRow, type IReportDumpOptions, type IRiskActivePosition, type IRiskCheckArgs, type IRiskSchema, type IRiskValidation, type IRiskValidationFn, type IRiskValidationPayload, type IScheduledSignalCancelRow, type IScheduledSignalRow, type ISignalDto, type ISignalRow, type ISizingCalculateParams, type ISizingCalculateParamsATR, type ISizingCalculateParamsFixedPercentage, type ISizingCalculateParamsKelly, type ISizingSchema, type ISizingSchemaATR, type ISizingSchemaFixedPercentage, type ISizingSchemaKelly, type IStrategyPnL, type IStrategyResult, type IStrategySchema, type IStrategyTickResult, type IStrategyTickResultActive, type IStrategyTickResultCancelled, type IStrategyTickResultClosed, type IStrategyTickResultIdle, type IStrategyTickResultOpened, type IStrategyTickResultScheduled, type IWalkerResults, type IWalkerSchema, type IWalkerStrategyResult, type InfoErrorNotification, Live, type LiveDoneNotification, type LiveStatisticsModel, Markdown, MarkdownFileBase, MarkdownFolderBase, type MarkdownName, type MessageModel, type MessageRole, MethodContextService, type MetricStats, Notification, type NotificationModel, Optimizer, Partial$1 as Partial, type PartialData, type PartialEvent, type PartialLossContract, type PartialLossNotification, type PartialProfitContract, type PartialProfitNotification, type PartialStatisticsModel, Performance, type PerformanceContract, type PerformanceMetricType, type PerformanceStatisticsModel, PersistBase, PersistBreakevenAdapter, PersistPartialAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistSignalAdapter, PositionSize, type ProgressBacktestContract, type ProgressBacktestNotification, type ProgressOptimizerContract, type ProgressWalkerContract, Report, ReportBase, type ReportName, Risk, type RiskContract, type RiskData, type RiskEvent, type RiskRejectionNotification, type RiskStatisticsModel, Schedule, type ScheduleData, type SchedulePingContract, type ScheduleStatisticsModel, type ScheduledEvent, type SignalCancelledNotification, type SignalClosedNotification, type SignalData, type SignalInterval, type SignalOpenedNotification, type SignalScheduledNotification, type TMarkdownBase, type TPersistBase, type TPersistBaseCtor, type TReportBase, type TickEvent, type ValidationErrorNotification, Walker, type WalkerCompleteContract, type WalkerContract, type WalkerMetric, type SignalData$1 as WalkerSignalData, type WalkerStatisticsModel, addActionSchema, addExchangeSchema, addFrameSchema, addOptimizerSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, commitBreakeven, commitBreakevenPromptHistory, commitCancel, commitPartialLoss, commitPartialLossPromptHistory, commitPartialProfit, commitPartialProfitPromptHistory, commitRiskPromptHistory, commitScheduleCancelPromptHistory, commitSignalPromptHistory, commitTrailingStop, commitTrailingStopPromptHistory, commitTrailingTake, commitTrailingTakePromptHistory, dumpSignalData, emitters, formatPrice, formatQuantity, get, getActionSchema, getAveragePrice, getBacktestTimeframe, getCandles, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getExchangeSchema, getFrameSchema, getMode, getOptimizerSchema, getOrderBook, getRiskSchema, getSizingSchema, getStrategySchema, getSymbol, getWalkerSchema, hasTradeContext, backtest as lib, listExchangeSchema, listFrameSchema, listOptimizerSchema, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenBacktestProgress, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenOptimizerProgress, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideOptimizerSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, roundTicks, set, setColumns, setConfig, setLogger, stop, validate };
|