@dshtrading/strategies 0.2.0 → 0.3.0
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/lib/api/lib/index.d.ts +37 -1
- package/package.json +5 -5
package/lib/api/lib/index.d.ts
CHANGED
|
@@ -325,6 +325,10 @@ declare module '@deepseek-ai/cordis' {
|
|
|
325
325
|
tradingCnMarketData: MarketDataService;
|
|
326
326
|
/** hk 市场行情服务(由腾讯连接器同包双实例提供,config.market 分流;cn+hk 切片 2026-08-31 补齐)。 */
|
|
327
327
|
tradingHkMarketData: MarketDataService;
|
|
328
|
+
/** futures 市场行情服务(由同花顺期货连接器提供,issue #97;日K + 当日分时聚合)。 */
|
|
329
|
+
tradingFuturesMarketData: MarketDataService;
|
|
330
|
+
/** 全球品种行情(global 市场:大宗/外汇/海外指数;@dshtrading/connector-jin10 dataplane 行提供)。 */
|
|
331
|
+
tradingGlobalMarketData: MarketDataService;
|
|
328
332
|
/**
|
|
329
333
|
* crypto 市场交易服务(R3 2026-08-29 补齐,crypto 市场第一个真实 TradeService):
|
|
330
334
|
* 由 connector-okx 实现(签名 demo/live 下单),与 connector-binance 经
|
|
@@ -355,6 +359,8 @@ declare module '@deepseek-ai/cordis' {
|
|
|
355
359
|
* 各市场 Kit apply 时注册 aggregateNews 纯函数,GUI 行情桥按市场获取。
|
|
356
360
|
*/
|
|
357
361
|
tradingNewsRegistry: TradingNewsRegistry;
|
|
362
|
+
/** 跨市场快讯源(@dshtrading/connector-jin10 提供;缺席 = 未安装快讯连接器)。 */
|
|
363
|
+
tradingFlashFeed: FlashFeedService;
|
|
358
364
|
}
|
|
359
365
|
}
|
|
360
366
|
/**
|
|
@@ -430,6 +436,8 @@ interface NewsItem {
|
|
|
430
436
|
readonly publishedAt: string;
|
|
431
437
|
/** 关联标的代码(可选,格式随源不同)。 */
|
|
432
438
|
readonly relatedCodes?: readonly string[];
|
|
439
|
+
/** 热度等级(可选;金十快讯网页版 火/热/沸/爆,其他源不填)。 */
|
|
440
|
+
readonly hot?: string;
|
|
433
441
|
}
|
|
434
442
|
/** 新闻聚合请求选项。 */
|
|
435
443
|
interface AggregateNewsOptions {
|
|
@@ -441,6 +449,11 @@ interface AggregateNewsOptions {
|
|
|
441
449
|
symbol?: string | undefined;
|
|
442
450
|
/** CryptoPanic API token(仅 crypto 市场使用,可选)。 */
|
|
443
451
|
cryptoPanicKey?: string | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* 启用的新闻/公告源 id 列表(issue #96 源配置化;各 kit 的 NewsSource 词汇)。
|
|
454
|
+
* 缺省 = 该市场全部默认源;空数组 = 显式关闭(返回空结果)。
|
|
455
|
+
*/
|
|
456
|
+
sources?: readonly string[] | undefined;
|
|
444
457
|
}
|
|
445
458
|
/** 新闻聚合结果。 */
|
|
446
459
|
interface AggregateNewsResult {
|
|
@@ -451,6 +464,29 @@ interface AggregateNewsResult {
|
|
|
451
464
|
}
|
|
452
465
|
/** 新闻聚合器函数签名(各 Kit 导出的 aggregateNews 符合此形状)。 */
|
|
453
466
|
type NewsAggregator = (options?: AggregateNewsOptions) => Promise<AggregateNewsResult>;
|
|
467
|
+
/**
|
|
468
|
+
* 跨市场快讯源契约(2026-09-13 金十接入):host 平面由快讯连接器 provide
|
|
469
|
+
* tradingFlashFeed,GUI 快讯面板(桥 /dshtrading/api/flash)与 agent 快讯工具
|
|
470
|
+
* 共用同一取数实现;服务缺席 = 未安装/未启用该数据源 → 消费方报
|
|
471
|
+
* TRADING_NOT_IMPLEMENTED,绝不把「没有数据源」伪装成「没有快讯」。
|
|
472
|
+
*/
|
|
473
|
+
interface FlashFeedService {
|
|
474
|
+
/**
|
|
475
|
+
* 最新快讯流(cursor 翻页);条目只含元数据(标题/时间/链接)。
|
|
476
|
+
* `hot` 非空时按热度等级服务端过滤(金十网页版 火/热/沸/爆)。
|
|
477
|
+
*/
|
|
478
|
+
listFlash(options?: {
|
|
479
|
+
cursor?: string | undefined;
|
|
480
|
+
limit?: number | undefined;
|
|
481
|
+
hot?: readonly string[] | undefined;
|
|
482
|
+
}): Promise<{
|
|
483
|
+
readonly items: readonly NewsItem[];
|
|
484
|
+
readonly nextCursor?: string | undefined;
|
|
485
|
+
readonly hasMore: boolean;
|
|
486
|
+
}>;
|
|
487
|
+
/** 关键词搜快讯(上游一次性返回、不支持翻页)。 */
|
|
488
|
+
searchFlash(keyword: string, limit?: number | undefined): Promise<readonly NewsItem[]>;
|
|
489
|
+
}
|
|
454
490
|
/** 新闻聚合器注册表契约(Issue #37,router 插件提供)。 */
|
|
455
491
|
interface TradingNewsRegistry {
|
|
456
492
|
register(market: string, aggregator: NewsAggregator): () => void;
|
|
@@ -458,4 +494,4 @@ interface TradingNewsRegistry {
|
|
|
458
494
|
markets(): string[];
|
|
459
495
|
}
|
|
460
496
|
//#endregion
|
|
461
|
-
export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, Interval, Kline, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingNewsRegistry };
|
|
497
|
+
export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, FlashFeedService, Interval, Kline, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingNewsRegistry };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dshtrading/strategies",
|
|
3
3
|
"description": "Trading strategies kernel for dsh-trading: pure math backtesting engine, strategy contracts, and 6 reference paradigms (short, swing, long). Pure library (zero runtime dependencies, browser-packable).",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@dshtrading/
|
|
25
|
-
"@dshtrading/
|
|
24
|
+
"@dshtrading/dsh-home": "^0.3.0",
|
|
25
|
+
"@dshtrading/indicators": "0.3.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@deepseek-ai/cordis": ">=4.0.0",
|
|
29
|
-
"@deepseek-ai/dsh-tools": ">=0.1.
|
|
29
|
+
"@deepseek-ai/dsh-tools": ">=0.1.5-rc.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"tsdown": "^0.22.0",
|
|
33
33
|
"vitest": "^3.0.0",
|
|
34
34
|
"typescript": "^5.5.0",
|
|
35
|
-
"@dshtrading/api": "0.
|
|
35
|
+
"@dshtrading/api": "0.3.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsdown",
|