MCPcopy Create free account

hub / github.com/cyfcyfff/investment / functions

Functions99 in github.com/cyfcyfff/investment

↓ 63 callersFunctionmakeHolding
(overrides: Partial<AssetHolding> & { ticker: string })
src/services/__tests__/rebalanceService.test.ts:6
↓ 31 callersFunctionmakeSnapshot
( overrides: Partial<PortfolioSnapshot> & Pick<PortfolioSnapshot, 'id' | 'timestamp' | 'totalValue'>, )
src/services/__tests__/performanceService.test.ts:7
↓ 17 callersFunctiongenerateRebalancePlan
( holdings: AssetHolding[], prices: Record<string, number>, fxRates: Record<string, number>, config: R
src/services/rebalanceService.ts:115
↓ 16 callersFunctionformatCurrency
(value: number, currency: string = 'USD', decimals: number = 2)
src/utils/formatters.ts:9
↓ 15 callersFunctionisValidTicker
(ticker: string)
src/utils/validators.ts:7
↓ 14 callersFunctioncalculatePerformance
( snapshots: PortfolioSnapshot[], )
src/services/performanceService.ts:10
↓ 13 callersFunctionmakeHolding
(overrides: Partial<AssetHolding> & { ticker: string })
src/services/__tests__/calcService.test.ts:10
↓ 12 callersFunctionisValidCurrency
(code: string)
src/utils/validators.ts:11
↓ 11 callersFunctioncalculateCategoryWeights
( holdings: AssetHolding[], prices: Record<string, number>, fxRates: Record<string, number> = { USD: 1 }
src/services/calcService.ts:8
↓ 11 callersFunctionisRebalanceTriggered
( weights: Record<Category, number>, config: RebalanceConfig = DEFAULT_REBALANCE_CONFIG, lastRebalanceDa
src/services/calcService.ts:50
↓ 10 callersFunctiongenerateId
()
src/utils/formatters.ts:26
↓ 9 callersFunctionisValidDate
(dateStr: string)
src/utils/validators.ts:15
↓ 9 callersFunctionisValidWeight
(w: number)
src/utils/validators.ts:20
↓ 8 callersFunctioncreateSnapshot
( holdings: AssetHolding[], prices: Record<string, number>, fxRates: Record<string, number>, baseCurre
src/services/snapshotService.ts:24
↓ 8 callersFunctiongetFxRate
* Get the FX rate for converting a currency to the base currency. * Returns 1 if same currency, otherwise looks up the pair in fxRates.
src/services/rebalanceService.ts:17
↓ 8 callersFunctionmockYahooResponse
(overrides: Record<string, unknown> = {})
src/services/__tests__/quoteService.test.ts:25
↓ 7 callersFunctioncalcMarketValue
(quantity: number, price: number, fxRate: number = 1)
src/services/calcService.ts:4
↓ 7 callersFunctionfetchFromStooq
(ticker: string)
src/services/quoteService.ts:203
↓ 7 callersFunctionfetchFxRates
( pairs: Array<{ base: string; quote: string }>, )
src/services/fxService.ts:36
↓ 7 callersFunctionmockErApiResponse
(rates: Record<string, number>)
src/services/__tests__/fxService.test.ts:4
↓ 6 callersFunctionfetchQuote
(ticker: string, apiKey: string, market?: Market)
src/services/quoteService.ts:254
↓ 6 callersFunctionfetchQuotes
(tickers: string[], apiKey: string, markets?: Record<string, Market>)
src/services/quoteService.ts:271
↓ 5 callersFunctionensureDailySnapshot
( holdings: AssetHolding[], prices: Record<string, number>, fxRates: Record<string, number>, baseCurre
src/services/snapshotService.ts:77
↓ 5 callersFunctionfetchFromYahoo
(ticker: string)
src/services/quoteService.ts:81
↓ 5 callersFunctionformatNumber
(value: number)
src/utils/formatters.ts:22
↓ 5 callersFunctionformatPercent
(value: number, decimals: number = 2)
src/utils/formatters.ts:18
↓ 4 callersFunctionfetchFromTencent
(ticker: string, market?: Market)
src/services/quoteService.ts:124
↓ 4 callersFunctionfetchFxRate
(base: string, quote: string)
src/services/fxService.ts:5
↓ 4 callersFunctiongetTimeoutSignal
(timeoutMs: number)
src/services/quoteService.ts:4
↓ 4 callersFunctionsaveToStorage
(key: string, value: T)
src/stores/configStore.ts:15
↓ 3 callersFunctionfetchFromFmp
(symbols: string, apiKey: string)
src/services/quoteService.ts:37
↓ 3 callersFunctiongetTodayKeyBeijing
()
src/services/snapshotService.ts:13
↓ 3 callersFunctionupdateItem
(index: number, field: keyof Omit<TradeRecordItem, 'holdingId'>, value: number | null)
src/components/forms/TradeRecordForm.tsx:38
↓ 2 callersFunctioncalcCategoryValue
* Calculate the current value of a single category in base currency.
src/services/rebalanceService.ts:48
↓ 2 callersFunctioncalcDistributionProportions
* Calculate per-holding proportions within a category based on distribution mode. * * @returns Array of proportions (sum to 1.0), parallel to catego
src/services/rebalanceService.ts:71
↓ 2 callersFunctioncheckAndNotify
()
src/App.tsx:29
↓ 2 callersFunctiondoAutoBackup
()
src/pages/Settings/index.tsx:267
↓ 2 callersFunctionexportAllToJson
()
src/services/backupService.ts:20
↓ 2 callersFunctionfetchFromPublicSources
(ticker: string, market?: Market)
src/services/quoteService.ts:215
↓ 2 callersFunctionloadConfigFromStorage
(key: string, fallback: T)
src/services/backupService.ts:177
↓ 2 callersFunctionloadFromStorage
(key: string, fallback: T)
src/stores/configStore.ts:8
↓ 2 callersFunctionmockFmpQuoteResponse
(overrides: Record<string, unknown> = {})
src/services/__tests__/quoteService.test.ts:6
↓ 2 callersFunctionrequestBackupFileHandle
()
src/services/backupService.ts:94
↓ 2 callersFunctionsaveConfigToStorage
(key: string, value: T)
src/services/backupService.ts:184
↓ 2 callersFunctionsendTelegramNotification
( botToken: string, chatId: string, message: string, )
src/services/notificationService.ts:7
↓ 2 callersFunctionwriteToExistingHandle
(handle: FileSystemFileHandle, data: BackupData)
src/services/backupService.ts:112
↓ 1 callersFunctionbuildRebalanceMessage
( weights: Record<Category, number>, config: RebalanceConfig, breachCategories: Category[], totalValue
src/services/notificationService.ts:39
↓ 1 callersFunctionbuildTestMessage
()
src/services/notificationService.ts:75
↓ 1 callersFunctioncalcTotalPortfolioValue
* Calculate the total portfolio value in base currency.
src/services/rebalanceService.ts:29
↓ 1 callersMethodcreateWritable
()
src/types/portfolio.ts:190
↓ 1 callersMethodgetFile
()
src/types/portfolio.ts:191
↓ 1 callersFunctiongetFxRate
Get FX rate for a currency pair, defaulting to 1
src/services/snapshotService.ts:18
↓ 1 callersFunctiongetLastNotifiedAt
()
src/services/notificationService.ts:89
↓ 1 callersFunctionhandleDistributeEvenly
(category: Category, holdings: AssetHolding[])
src/components/forms/DistributionConfigPanel.tsx:44
↓ 1 callersFunctionhandleModeChange
(category: Category, mode: string)
src/components/forms/DistributionConfigPanel.tsx:24
↓ 1 callersFunctionhandleRatioChange
(category: Category, holdingId: string, ratio: number | null)
src/components/forms/DistributionConfigPanel.tsx:37
↓ 1 callersFunctionhandleSubmit
()
src/components/forms/TradeRecordForm.tsx:46
↓ 1 callersFunctionimportFromData
(data: BackupData)
src/services/backupService.ts:45
↓ 1 callersFunctioninferCurrency
(symbol: string)
src/services/searchService.ts:176
↓ 1 callersFunctioninferMarket
(symbol: string)
src/services/searchService.ts:186
↓ 1 callersFunctionloadFromFile
()
src/services/backupService.ts:143
↓ 1 callersFunctionnormalizeSinaSymbol
新浪代码 → 标准代码:code 用于判断交易所,symbol 是实际 ticker
src/services/searchService.ts:71
↓ 1 callersFunctionnormalizeTencentSymbol
(ticker: string, market?: Market)
src/services/quoteService.ts:92
↓ 1 callersFunctionparseStooqQuote
(ticker: string, csv: string)
src/services/quoteService.ts:167
↓ 1 callersFunctionparseTencentAsOf
(raw: string)
src/services/quoteService.ts:113
↓ 1 callersFunctionparseYahooQuote
(ticker: string, meta: YahooMeta)
src/services/quoteService.ts:67
↓ 1 callersFunctionsaveToFile
(data: BackupData)
src/services/backupService.ts:129
↓ 1 callersFunctionsearchFromSina
(query: string, limit = 10)
src/services/searchService.ts:17
↓ 1 callersFunctionsearchFromYahoo
(query: string, limit = 10)
src/services/searchService.ts:148
↓ 1 callersFunctionsearchTickers
( query: string, _fmpApiKey?: string, limit = 10, )
src/services/searchService.ts:200
↓ 1 callersFunctionsetLastNotifiedAt
(ts: number)
src/services/notificationService.ts:97
↓ 1 callersMethodshowOpenFilePicker
(options?: { types?: Array<{ description: string; accept: Record<string, string[]> }> })
src/types/portfolio.ts:182
↓ 1 callersMethodshowSaveFilePicker
(options?: { suggestedName?: string types?: Array<{ description: string; accept: Record<string, st
src/types/portfolio.ts:178
↓ 1 callersFunctionsinaCurrency
(market: string)
src/services/searchService.ts:83
↓ 1 callersFunctionsinaExchange
(_code: string)
src/services/searchService.ts:93
↓ 1 callersFunctionsinaExchangeShort
(market: string)
src/services/searchService.ts:126
↓ 1 callersFunctionsinaMarket
(marketCode: string, code: string)
src/services/searchService.ts:101
↓ 1 callersFunctiontoStooqSymbol
(ticker: string)
src/services/quoteService.ts:157
↓ 1 callersFunctionuseTelegramNotification
()
src/App.tsx:23
FunctionApp
()
src/App.tsx:111
FunctionBandGauge
({ weights, config }: BandGaugeProps)
src/components/charts/BandGauge.tsx:16
FunctionDashboard
()
src/pages/Dashboard/index.tsx:22
FunctionDistributionConfigPanel
({ holdingsByCategory, value, onChange, }: DistributionConfigPanelProps)
src/components/forms/DistributionConfigPanel.tsx:14
FunctionHistory
()
src/pages/History/index.tsx:21
FunctionHoldingForm
({ initialValues, onSubmit, onCancel, loading }: HoldingFormProps)
src/components/forms/HoldingForm.tsx:80
FunctionHoldings
()
src/pages/Holdings/index.tsx:23
FunctionMainLayout
()
src/components/Layout/MainLayout.tsx:22
FunctionNetValueChart
({ snapshots, baseCurrency }: NetValueChartProps)
src/components/charts/NetValueChart.tsx:9
FunctionRebalance
()
src/pages/Rebalance/index.tsx:22
FunctionSettings
()
src/pages/Settings/index.tsx:46
FunctionTradeRecordForm
({ trades, onSubmit, onCancel }: TradeRecordFormProps)
src/components/forms/TradeRecordForm.tsx:26
FunctionWeightComparisonChart
({ currentWeights, targetWeights, postWeights }: WeightComparisonChartProps)
src/components/charts/WeightComparisonChart.tsx:12
FunctionWeightPieChart
({ weights, config }: WeightPieChartProps)
src/components/charts/WeightPieChart.tsx:23
Methodconstructor
()
src/db/index.ts:9
FunctiondownloadBackup
(data: BackupData)
src/services/backupService.ts:164
FunctionhandleBatchRecord
(data: TradeRecordFormData)
src/pages/Rebalance/index.tsx:133
FunctionhandleGenerate
()
src/pages/Rebalance/index.tsx:116
FunctioninitDb
()
src/db/index.ts:21
FunctionparseFmpQuote
(item: FmpQuoteResponse)
src/services/quoteService.ts:22