-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSingleAnalysisSample.fs
More file actions
25 lines (19 loc) · 867 Bytes
/
SingleAnalysisSample.fs
File metadata and controls
25 lines (19 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module StockAdvisorFS.SingleAnalysisSample
open System.Threading.Tasks
// ============================================================================
// SINGLE ANALYSIS SAMPLE
// Demonstrates calling async stock tools directly without a workflow.
// ============================================================================
/// Runs a single stock analysis showing info, volatility, and history
let run (symbol: string) : Task<unit> = task {
printfn $"\nAnalyzing {symbol}..."
printfn "\nFetching stock info..."
let! info = StockTools.getStockInfo symbol
printfn "%s" info
printfn "\nFetching volatility..."
let! volatility = StockTools.calculateVolatility symbol
printfn "%s" volatility
printfn "\nFetching historical prices (7 days)..."
let! history = StockTools.getHistoricalPrices symbol 7
printfn "%s" history
}