summaryrefslogtreecommitdiff
path: root/src/FundLab.Api/MarketDataService.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 01:12:52 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 01:12:52 +0800
commit3cc0b4dcfeed042e5a69628c6b7f45580ad1e2f9 (patch)
treeb86805c2680327412d6f5d554d4506ebfe62fc2f /src/FundLab.Api/MarketDataService.fs
parent70e1ad4fc8ba248f835d415faade8a91ac3dc1f8 (diff)
downloadfund-lab-3cc0b4dcfeed042e5a69628c6b7f45580ad1e2f9.tar.gz
Add real AKShare bond quote probe slice (3d-14)
Diffstat (limited to 'src/FundLab.Api/MarketDataService.fs')
-rw-r--r--src/FundLab.Api/MarketDataService.fs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/FundLab.Api/MarketDataService.fs b/src/FundLab.Api/MarketDataService.fs
index e9993f3..0108ea7 100644
--- a/src/FundLab.Api/MarketDataService.fs
+++ b/src/FundLab.Api/MarketDataService.fs
@@ -18,6 +18,7 @@ type MarketDataFailure =
type IMarketDataCollector =
abstract Search: query: string * CancellationToken -> Result<string, string>
abstract FetchNav: code: string * CancellationToken -> Result<string, string>
+ abstract FetchBondQuote: code: string * CancellationToken -> Result<string, string>
type IMarketDataService =
abstract Search: query: string * CancellationToken -> Result<MarketDataSearchPayload, MarketDataFailure>
@@ -203,6 +204,9 @@ type ProcessMarketDataCollector(pythonExecutable: string, scriptPath: string, py
member _.FetchNav(code: string, token: CancellationToken) =
execute token [ "--operation"; "nav"; "--code"; code ]
+ member _.FetchBondQuote(code: string, token: CancellationToken) =
+ execute token [ "--operation"; "bond-quote"; "--code"; code ]
+
type MarketDataService(repository: FundRepository, collector: IMarketDataCollector) =
let codePattern = Text.RegularExpressions.Regex("^[0-9]{6}$", Text.RegularExpressions.RegexOptions.Compiled)