@muhammedaksam/borsats 0.7.2 → 0.8.4
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/dist/index.cjs +4 -4
- package/dist/index.d.cts +124 -1
- package/dist/index.d.ts +124 -1
- package/dist/index.js +4 -4
- package/package.json +16 -15
package/dist/index.d.cts
CHANGED
|
@@ -312,6 +312,13 @@ declare function calculateSupertrend(data: OHLCVData[], atrPeriod?: number, mult
|
|
|
312
312
|
lower: number;
|
|
313
313
|
}>;
|
|
314
314
|
declare function calculateTilsonT3(data: OHLCVData[], period?: number, vfactor?: number): number[];
|
|
315
|
+
declare function calculateHHV(data: OHLCVData[], period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
316
|
+
declare function calculateLLV(data: OHLCVData[], period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
317
|
+
declare function calculateMOM(data: OHLCVData[], period?: number): number[];
|
|
318
|
+
declare function calculateROC(data: OHLCVData[], period?: number): number[];
|
|
319
|
+
declare function calculateWMA(data: OHLCVData[], period?: number): number[];
|
|
320
|
+
declare function calculateDEMA(data: OHLCVData[], period?: number): number[];
|
|
321
|
+
declare function calculateTEMA(data: OHLCVData[], period?: number): number[];
|
|
315
322
|
declare function calculateCCI(data: OHLCVData[], period?: number): number[];
|
|
316
323
|
declare function calculateWilliamsR(data: OHLCVData[], period?: number): number[];
|
|
317
324
|
declare function calculatePivotPoints(data: OHLCVData[]): Array<{
|
|
@@ -345,6 +352,13 @@ interface AddIndicatorsOptions {
|
|
|
345
352
|
supertrendMultiplier?: number;
|
|
346
353
|
cciPeriod?: number;
|
|
347
354
|
williamsRPeriod?: number;
|
|
355
|
+
hhvPeriod?: number;
|
|
356
|
+
llvPeriod?: number;
|
|
357
|
+
momPeriod?: number;
|
|
358
|
+
rocPeriod?: number;
|
|
359
|
+
wmaPeriod?: number;
|
|
360
|
+
demaPeriod?: number;
|
|
361
|
+
temaPeriod?: number;
|
|
348
362
|
}
|
|
349
363
|
declare function addIndicators(data: OHLCVData[], options?: AddIndicatorsOptions): IndicatorData[];
|
|
350
364
|
declare class TechnicalAnalyzer {
|
|
@@ -380,6 +394,13 @@ declare class TechnicalAnalyzer {
|
|
|
380
394
|
lower: number;
|
|
381
395
|
}>;
|
|
382
396
|
tilsonT3(period?: number, vfactor?: number): number[];
|
|
397
|
+
hhv(period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
398
|
+
llv(period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
399
|
+
mom(period?: number): number[];
|
|
400
|
+
roc(period?: number): number[];
|
|
401
|
+
wma(period?: number): number[];
|
|
402
|
+
dema(period?: number): number[];
|
|
403
|
+
tema(period?: number): number[];
|
|
383
404
|
cci(period?: number): number[];
|
|
384
405
|
williamsR(period?: number): number[];
|
|
385
406
|
pivotPoints(): Array<{
|
|
@@ -462,7 +483,9 @@ declare class Ticker {
|
|
|
462
483
|
start?: Date | string;
|
|
463
484
|
end?: Date | string;
|
|
464
485
|
actions?: boolean;
|
|
486
|
+
adjust?: boolean;
|
|
465
487
|
}): Promise<OHLCVWithActions[]>;
|
|
488
|
+
private _unadjustPrices;
|
|
466
489
|
private _mergeActions;
|
|
467
490
|
get balanceSheet(): Promise<BalanceSheet>;
|
|
468
491
|
get incomeStmt(): Promise<IncomeStatement>;
|
|
@@ -470,6 +493,21 @@ declare class Ticker {
|
|
|
470
493
|
get quarterlyBalanceSheet(): Promise<BalanceSheet>;
|
|
471
494
|
get quarterlyIncomeStmt(): Promise<IncomeStatement>;
|
|
472
495
|
get quarterlyCashflow(): Promise<CashFlowStatement>;
|
|
496
|
+
getBalanceSheet(options?: {
|
|
497
|
+
quarterly?: boolean;
|
|
498
|
+
lastN?: number | string;
|
|
499
|
+
financialGroup?: string;
|
|
500
|
+
}): Promise<BalanceSheet>;
|
|
501
|
+
getIncomeStmt(options?: {
|
|
502
|
+
quarterly?: boolean;
|
|
503
|
+
lastN?: number | string;
|
|
504
|
+
financialGroup?: string;
|
|
505
|
+
}): Promise<IncomeStatement>;
|
|
506
|
+
getCashflow(options?: {
|
|
507
|
+
quarterly?: boolean;
|
|
508
|
+
lastN?: number | string;
|
|
509
|
+
financialGroup?: string;
|
|
510
|
+
}): Promise<CashFlowStatement>;
|
|
473
511
|
get dividends(): Promise<DividendData[]>;
|
|
474
512
|
get splits(): Promise<CapitalIncreaseData[]>;
|
|
475
513
|
get majorHolders(): Promise<HolderData[]>;
|
|
@@ -503,6 +541,13 @@ declare class Ticker {
|
|
|
503
541
|
obv(period?: Period): Promise<number>;
|
|
504
542
|
vwap(period?: Period): Promise<number>;
|
|
505
543
|
adx(period?: Period, adxPeriod?: number): Promise<number>;
|
|
544
|
+
hhv(period?: Period, hhvPeriod?: number): Promise<number>;
|
|
545
|
+
llv(period?: Period, llvPeriod?: number): Promise<number>;
|
|
546
|
+
mom(period?: Period, momPeriod?: number): Promise<number>;
|
|
547
|
+
roc(period?: Period, rocPeriod?: number): Promise<number>;
|
|
548
|
+
wma(period?: Period, wmaPeriod?: number): Promise<number>;
|
|
549
|
+
dema(period?: Period, demaPeriod?: number): Promise<number>;
|
|
550
|
+
tema(period?: Period, temaPeriod?: number): Promise<number>;
|
|
506
551
|
heikinAshi(period?: Period, interval?: Interval): Promise<OHLCVData[]>;
|
|
507
552
|
private calculateStartDate;
|
|
508
553
|
private daysYTD;
|
|
@@ -622,6 +667,13 @@ declare class Fund {
|
|
|
622
667
|
technicals(period?: string): Promise<TechnicalAnalyzer>;
|
|
623
668
|
riskMetrics(period?: string, rfRate?: number): Promise<FundRiskMetrics>;
|
|
624
669
|
sharpeRatio(period?: string, rfRate?: number): Promise<number>;
|
|
670
|
+
get managementFee(): Promise<{
|
|
671
|
+
applied_fee: number | null;
|
|
672
|
+
prospectus_fee: number | null;
|
|
673
|
+
max_expense_ratio: number | null;
|
|
674
|
+
} | null>;
|
|
675
|
+
get taxCategory(): Promise<string>;
|
|
676
|
+
withholdingTaxRate(purchaseDate?: Date, holdingDays?: number): Promise<number>;
|
|
625
677
|
}
|
|
626
678
|
declare function searchFunds(query: string): Promise<{
|
|
627
679
|
fund_code: string;
|
|
@@ -629,6 +681,16 @@ declare function searchFunds(query: string): Promise<{
|
|
|
629
681
|
fund_type: string;
|
|
630
682
|
return_1y?: number;
|
|
631
683
|
}[]>;
|
|
684
|
+
declare function managementFees(fundType?: "YAT" | "EMK", founder?: string): Promise<{
|
|
685
|
+
fund_code: string;
|
|
686
|
+
name: string;
|
|
687
|
+
fund_category: string;
|
|
688
|
+
founder_code: string;
|
|
689
|
+
applied_fee: number | null;
|
|
690
|
+
prospectus_fee: number | null;
|
|
691
|
+
max_expense_ratio: number | null;
|
|
692
|
+
annual_return: number | null;
|
|
693
|
+
}[]>;
|
|
632
694
|
declare function screenFunds(options: Record<string, unknown>): Promise<unknown[]>;
|
|
633
695
|
declare function compareFunds(fundCodes: string[]): Promise<{
|
|
634
696
|
funds: FundDetail[];
|
|
@@ -811,6 +873,7 @@ declare function searchCompanies(query: string): Promise<CompanyInfo[]>;
|
|
|
811
873
|
declare class Portfolio {
|
|
812
874
|
private holdings;
|
|
813
875
|
private benchmark;
|
|
876
|
+
private targetWeights;
|
|
814
877
|
add(symbol: string, options: {
|
|
815
878
|
shares: number;
|
|
816
879
|
cost?: number;
|
|
@@ -835,12 +898,14 @@ declare class Portfolio {
|
|
|
835
898
|
holdings: Array<Holding & {
|
|
836
899
|
symbol: string;
|
|
837
900
|
}>;
|
|
901
|
+
targetWeights?: Record<string, number>;
|
|
838
902
|
};
|
|
839
903
|
static fromDict(data: {
|
|
840
904
|
benchmark?: string;
|
|
841
905
|
holdings: Array<Holding & {
|
|
842
906
|
symbol: string;
|
|
843
907
|
}>;
|
|
908
|
+
targetWeights?: Record<string, number>;
|
|
844
909
|
}): Portfolio;
|
|
845
910
|
clear(): Portfolio;
|
|
846
911
|
private detectAssetType;
|
|
@@ -881,6 +946,34 @@ declare class Portfolio {
|
|
|
881
946
|
sortinoRatio(period?: string): Promise<number>;
|
|
882
947
|
beta(benchmarkSymbol?: string, period?: string): Promise<number>;
|
|
883
948
|
correlationMatrix(period?: string): Promise<Record<string, Record<string, number>>>;
|
|
949
|
+
setTargetWeights(weights: Record<string, number>): Portfolio;
|
|
950
|
+
getTargetWeights(): Record<string, number>;
|
|
951
|
+
drift(): Promise<Array<{
|
|
952
|
+
symbol: string;
|
|
953
|
+
currentWeight: number;
|
|
954
|
+
targetWeight: number;
|
|
955
|
+
drift: number;
|
|
956
|
+
driftPct: number;
|
|
957
|
+
}>>;
|
|
958
|
+
rebalancePlan(threshold?: number): Promise<Array<{
|
|
959
|
+
symbol: string;
|
|
960
|
+
action: "buy" | "sell";
|
|
961
|
+
currentWeight: number;
|
|
962
|
+
targetWeight: number;
|
|
963
|
+
weightDelta: number;
|
|
964
|
+
valueDelta: number;
|
|
965
|
+
}>>;
|
|
966
|
+
rebalance(threshold?: number, dryRun?: boolean): Promise<{
|
|
967
|
+
plan: Array<{
|
|
968
|
+
symbol: string;
|
|
969
|
+
action: "buy" | "sell";
|
|
970
|
+
currentWeight: number;
|
|
971
|
+
targetWeight: number;
|
|
972
|
+
weightDelta: number;
|
|
973
|
+
valueDelta: number;
|
|
974
|
+
}>;
|
|
975
|
+
executed: boolean;
|
|
976
|
+
}>;
|
|
884
977
|
}
|
|
885
978
|
|
|
886
979
|
declare function calculateHeikinAshi(data: OHLCVData[] | null): OHLCVData[];
|
|
@@ -1441,6 +1534,36 @@ declare class InvalidIntervalError extends BorsaTSError {
|
|
|
1441
1534
|
constructor(interval: string, validIntervals: string[]);
|
|
1442
1535
|
}
|
|
1443
1536
|
|
|
1537
|
+
declare const TAX_CATEGORIES: {
|
|
1538
|
+
readonly HISSE_YOĞUN: "Hisse Yoğun Fon";
|
|
1539
|
+
readonly HISSE_ENDEKS: "Hisse Endeks Fon";
|
|
1540
|
+
readonly DIGER: "Diğer Fon";
|
|
1541
|
+
readonly GIRISIM_SERMAYESI: "Girişim Sermayesi Fon";
|
|
1542
|
+
readonly GAYRIMENKUL: "Gayrimenkul Yatırım Fon";
|
|
1543
|
+
readonly ALTIN_GUMUS: "Altın/Gümüş ve Kıymetli Maden Fonları";
|
|
1544
|
+
readonly DOVIZ: "Döviz Fonları";
|
|
1545
|
+
readonly KATILIM: "Katılım Fonları (Faiz Dışı)";
|
|
1546
|
+
readonly BYF_HISSE: "BYF Hisse";
|
|
1547
|
+
readonly BYF_DIGER: "BYF Diğer";
|
|
1548
|
+
};
|
|
1549
|
+
type TaxCategory = (typeof TAX_CATEGORIES)[keyof typeof TAX_CATEGORIES];
|
|
1550
|
+
interface TaxPeriod {
|
|
1551
|
+
startDate: Date;
|
|
1552
|
+
endDate: Date | null;
|
|
1553
|
+
label: string;
|
|
1554
|
+
}
|
|
1555
|
+
declare const TAX_PERIODS: TaxPeriod[];
|
|
1556
|
+
declare function classifyFundTaxCategory(category: string, fundName?: string): string;
|
|
1557
|
+
declare function getWithholdingTaxRate(taxCategory: string, purchaseDate?: Date, _holdingDays?: number): number;
|
|
1558
|
+
declare function withholdingTaxRate(fundCode: string, purchaseDate?: Date, holdingDays?: number): Promise<number>;
|
|
1559
|
+
declare function withholdingTaxTable(): Array<{
|
|
1560
|
+
category: string;
|
|
1561
|
+
periods: Array<{
|
|
1562
|
+
label: string;
|
|
1563
|
+
rate: number;
|
|
1564
|
+
}>;
|
|
1565
|
+
}>;
|
|
1566
|
+
|
|
1444
1567
|
declare const FIELD_MAP: Record<string, string>;
|
|
1445
1568
|
declare const OPERATORS: Record<string, string>;
|
|
1446
1569
|
declare const LOCAL_CALC_FIELDS: Set<string>;
|
|
@@ -1505,4 +1628,4 @@ declare class ZiraatEurobondProvider extends BaseProvider {
|
|
|
1505
1628
|
}
|
|
1506
1629
|
declare function getEurobondProvider(): ZiraatEurobondProvider;
|
|
1507
1630
|
|
|
1508
|
-
export { APIError, type ActionData, type AddIndicatorsOptions, type AllRatesRecord, type AllocationData, type AssetType, AuthenticationError, Backtest, BacktestEngine, type BacktestResult, type BacktestSummaryData, type BalanceSheet, type BankRate, Bond, BorsaTSError, COUNTRIES, type CacheOptions, type CalendarEvent, type Candle, type CashFlowStatement, type CompanyInfo, Crypto, type CryptoPair, type CurrentData, DEFAULT_COLUMNS, DataNotAvailableError, type DividendData, type ETFHolder, EconomicCalendar, type EnrichedInfo, Eurobond$1 as Eurobond, type EurobondData, FIELD_MAP, FX, FastInfo, type FinancialRow, Fund, type FundInfo, type FundRiskMetrics, type FundType, type HolderData, type Holding, INDICATOR_OUTPUTS, INDICES, INTERVAL_MAP, type IncomeStatement, Index, type IndexComponent, type IndexInfo, type IndicatorData, type IndicatorMetadata, Inflation, type InstitutionRate, type Interval, InvalidIntervalError, InvalidPeriodError, LOCAL_CALC_FIELDS, MOVING_AVERAGE_COLUMNS, type MetalInstitutionRate, type NewsItem, type OHLCVData, type OHLCVWithActions, OPERATORS, OSCILLATOR_COLUMNS, type Period, PineFacadeProvider, type PineStudy, Portfolio, type Position, type PriceTarget, type ProviderConfig, type Quote, RateLimitError, type RateRecord, type Recommendation, type ReplayCandle, ReplaySession, type ReplayStats, type RequestOptions, type RiskMetrics, STANDARD_INDICATORS, type ScanOptions, type ScanResult$1 as ScanResult, Screener, type ScreenerCriteria, type ScreenerResult, type SearchResult, type Signal, type SplitData, type StrategyFunc, type StreamCandle, StudySession, type TASignalGroup, type TASignals, TCMB, type ScanResult as TVScanResult, TVScreenerProvider, TechnicalAnalyzer, TechnicalScanner, Ticker, TickerNotFoundError, type Trade, TradingViewETFProvider, TradingViewScannerProvider, TradingViewSearchProvider, TradingViewStream, type UnifiedSearchResult, VIOP, type VIOPContract, type Eurobond as ZiraatEurobondData, ZiraatEurobondProvider, addIndicators, allIndices, backtest, banks, bonds, calculateADX, calculateATR, calculateBollingerBands, calculateCCI, calculateEMA, calculateHeikinAshi, calculateIchimoku, calculateMACD, calculateOBV, calculatePivotPoints, calculateRSI, calculateSMA, calculateStochastic, calculateSupertrend, calculateTilsonT3, calculateVWAP, calculateWilliamsR, companies, compareFunds, createReplay, cryptoList, economicCalendar, eurobonds, getEurobondProvider, getPineFacadeProvider, getScannerProvider, getSearchProvider, getTVScreenerProvider, getTradingViewETFProvider, index, indices, metalInstitutions, policyRate, riskFreeRate, scan, screenFunds, screenStocks, screenerCriteria, search, searchBist, searchCompanies, searchCrypto, searchForex, searchFunds, searchIndex, searchViop, sectors, stockIndices, viopContracts };
|
|
1631
|
+
export { APIError, type ActionData, type AddIndicatorsOptions, type AllRatesRecord, type AllocationData, type AssetType, AuthenticationError, Backtest, BacktestEngine, type BacktestResult, type BacktestSummaryData, type BalanceSheet, type BankRate, Bond, BorsaTSError, COUNTRIES, type CacheOptions, type CalendarEvent, type Candle, type CashFlowStatement, type CompanyInfo, Crypto, type CryptoPair, type CurrentData, DEFAULT_COLUMNS, DataNotAvailableError, type DividendData, type ETFHolder, EconomicCalendar, type EnrichedInfo, Eurobond$1 as Eurobond, type EurobondData, FIELD_MAP, FX, FastInfo, type FinancialRow, Fund, type FundInfo, type FundRiskMetrics, type FundType, type HolderData, type Holding, INDICATOR_OUTPUTS, INDICES, INTERVAL_MAP, type IncomeStatement, Index, type IndexComponent, type IndexInfo, type IndicatorData, type IndicatorMetadata, Inflation, type InstitutionRate, type Interval, InvalidIntervalError, InvalidPeriodError, LOCAL_CALC_FIELDS, MOVING_AVERAGE_COLUMNS, type MetalInstitutionRate, type NewsItem, type OHLCVData, type OHLCVWithActions, OPERATORS, OSCILLATOR_COLUMNS, type Period, PineFacadeProvider, type PineStudy, Portfolio, type Position, type PriceTarget, type ProviderConfig, type Quote, RateLimitError, type RateRecord, type Recommendation, type ReplayCandle, ReplaySession, type ReplayStats, type RequestOptions, type RiskMetrics, STANDARD_INDICATORS, type ScanOptions, type ScanResult$1 as ScanResult, Screener, type ScreenerCriteria, type ScreenerResult, type SearchResult, type Signal, type SplitData, type StrategyFunc, type StreamCandle, StudySession, type TASignalGroup, type TASignals, TAX_CATEGORIES, TAX_PERIODS, TCMB, type ScanResult as TVScanResult, TVScreenerProvider, type TaxCategory, type TaxPeriod, TechnicalAnalyzer, TechnicalScanner, Ticker, TickerNotFoundError, type Trade, TradingViewETFProvider, TradingViewScannerProvider, TradingViewSearchProvider, TradingViewStream, type UnifiedSearchResult, VIOP, type VIOPContract, type Eurobond as ZiraatEurobondData, ZiraatEurobondProvider, addIndicators, allIndices, backtest, banks, bonds, calculateADX, calculateATR, calculateBollingerBands, calculateCCI, calculateDEMA, calculateEMA, calculateHHV, calculateHeikinAshi, calculateIchimoku, calculateLLV, calculateMACD, calculateMOM, calculateOBV, calculatePivotPoints, calculateROC, calculateRSI, calculateSMA, calculateStochastic, calculateSupertrend, calculateTEMA, calculateTilsonT3, calculateVWAP, calculateWMA, calculateWilliamsR, classifyFundTaxCategory, companies, compareFunds, createReplay, cryptoList, economicCalendar, eurobonds, getEurobondProvider, getPineFacadeProvider, getScannerProvider, getSearchProvider, getTVScreenerProvider, getTradingViewETFProvider, getWithholdingTaxRate, index, indices, managementFees, metalInstitutions, policyRate, riskFreeRate, scan, screenFunds, screenStocks, screenerCriteria, search, searchBist, searchCompanies, searchCrypto, searchForex, searchFunds, searchIndex, searchViop, sectors, stockIndices, viopContracts, withholdingTaxRate, withholdingTaxTable };
|
package/dist/index.d.ts
CHANGED
|
@@ -312,6 +312,13 @@ declare function calculateSupertrend(data: OHLCVData[], atrPeriod?: number, mult
|
|
|
312
312
|
lower: number;
|
|
313
313
|
}>;
|
|
314
314
|
declare function calculateTilsonT3(data: OHLCVData[], period?: number, vfactor?: number): number[];
|
|
315
|
+
declare function calculateHHV(data: OHLCVData[], period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
316
|
+
declare function calculateLLV(data: OHLCVData[], period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
317
|
+
declare function calculateMOM(data: OHLCVData[], period?: number): number[];
|
|
318
|
+
declare function calculateROC(data: OHLCVData[], period?: number): number[];
|
|
319
|
+
declare function calculateWMA(data: OHLCVData[], period?: number): number[];
|
|
320
|
+
declare function calculateDEMA(data: OHLCVData[], period?: number): number[];
|
|
321
|
+
declare function calculateTEMA(data: OHLCVData[], period?: number): number[];
|
|
315
322
|
declare function calculateCCI(data: OHLCVData[], period?: number): number[];
|
|
316
323
|
declare function calculateWilliamsR(data: OHLCVData[], period?: number): number[];
|
|
317
324
|
declare function calculatePivotPoints(data: OHLCVData[]): Array<{
|
|
@@ -345,6 +352,13 @@ interface AddIndicatorsOptions {
|
|
|
345
352
|
supertrendMultiplier?: number;
|
|
346
353
|
cciPeriod?: number;
|
|
347
354
|
williamsRPeriod?: number;
|
|
355
|
+
hhvPeriod?: number;
|
|
356
|
+
llvPeriod?: number;
|
|
357
|
+
momPeriod?: number;
|
|
358
|
+
rocPeriod?: number;
|
|
359
|
+
wmaPeriod?: number;
|
|
360
|
+
demaPeriod?: number;
|
|
361
|
+
temaPeriod?: number;
|
|
348
362
|
}
|
|
349
363
|
declare function addIndicators(data: OHLCVData[], options?: AddIndicatorsOptions): IndicatorData[];
|
|
350
364
|
declare class TechnicalAnalyzer {
|
|
@@ -380,6 +394,13 @@ declare class TechnicalAnalyzer {
|
|
|
380
394
|
lower: number;
|
|
381
395
|
}>;
|
|
382
396
|
tilsonT3(period?: number, vfactor?: number): number[];
|
|
397
|
+
hhv(period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
398
|
+
llv(period?: number, column?: "high" | "low" | "close" | "open"): number[];
|
|
399
|
+
mom(period?: number): number[];
|
|
400
|
+
roc(period?: number): number[];
|
|
401
|
+
wma(period?: number): number[];
|
|
402
|
+
dema(period?: number): number[];
|
|
403
|
+
tema(period?: number): number[];
|
|
383
404
|
cci(period?: number): number[];
|
|
384
405
|
williamsR(period?: number): number[];
|
|
385
406
|
pivotPoints(): Array<{
|
|
@@ -462,7 +483,9 @@ declare class Ticker {
|
|
|
462
483
|
start?: Date | string;
|
|
463
484
|
end?: Date | string;
|
|
464
485
|
actions?: boolean;
|
|
486
|
+
adjust?: boolean;
|
|
465
487
|
}): Promise<OHLCVWithActions[]>;
|
|
488
|
+
private _unadjustPrices;
|
|
466
489
|
private _mergeActions;
|
|
467
490
|
get balanceSheet(): Promise<BalanceSheet>;
|
|
468
491
|
get incomeStmt(): Promise<IncomeStatement>;
|
|
@@ -470,6 +493,21 @@ declare class Ticker {
|
|
|
470
493
|
get quarterlyBalanceSheet(): Promise<BalanceSheet>;
|
|
471
494
|
get quarterlyIncomeStmt(): Promise<IncomeStatement>;
|
|
472
495
|
get quarterlyCashflow(): Promise<CashFlowStatement>;
|
|
496
|
+
getBalanceSheet(options?: {
|
|
497
|
+
quarterly?: boolean;
|
|
498
|
+
lastN?: number | string;
|
|
499
|
+
financialGroup?: string;
|
|
500
|
+
}): Promise<BalanceSheet>;
|
|
501
|
+
getIncomeStmt(options?: {
|
|
502
|
+
quarterly?: boolean;
|
|
503
|
+
lastN?: number | string;
|
|
504
|
+
financialGroup?: string;
|
|
505
|
+
}): Promise<IncomeStatement>;
|
|
506
|
+
getCashflow(options?: {
|
|
507
|
+
quarterly?: boolean;
|
|
508
|
+
lastN?: number | string;
|
|
509
|
+
financialGroup?: string;
|
|
510
|
+
}): Promise<CashFlowStatement>;
|
|
473
511
|
get dividends(): Promise<DividendData[]>;
|
|
474
512
|
get splits(): Promise<CapitalIncreaseData[]>;
|
|
475
513
|
get majorHolders(): Promise<HolderData[]>;
|
|
@@ -503,6 +541,13 @@ declare class Ticker {
|
|
|
503
541
|
obv(period?: Period): Promise<number>;
|
|
504
542
|
vwap(period?: Period): Promise<number>;
|
|
505
543
|
adx(period?: Period, adxPeriod?: number): Promise<number>;
|
|
544
|
+
hhv(period?: Period, hhvPeriod?: number): Promise<number>;
|
|
545
|
+
llv(period?: Period, llvPeriod?: number): Promise<number>;
|
|
546
|
+
mom(period?: Period, momPeriod?: number): Promise<number>;
|
|
547
|
+
roc(period?: Period, rocPeriod?: number): Promise<number>;
|
|
548
|
+
wma(period?: Period, wmaPeriod?: number): Promise<number>;
|
|
549
|
+
dema(period?: Period, demaPeriod?: number): Promise<number>;
|
|
550
|
+
tema(period?: Period, temaPeriod?: number): Promise<number>;
|
|
506
551
|
heikinAshi(period?: Period, interval?: Interval): Promise<OHLCVData[]>;
|
|
507
552
|
private calculateStartDate;
|
|
508
553
|
private daysYTD;
|
|
@@ -622,6 +667,13 @@ declare class Fund {
|
|
|
622
667
|
technicals(period?: string): Promise<TechnicalAnalyzer>;
|
|
623
668
|
riskMetrics(period?: string, rfRate?: number): Promise<FundRiskMetrics>;
|
|
624
669
|
sharpeRatio(period?: string, rfRate?: number): Promise<number>;
|
|
670
|
+
get managementFee(): Promise<{
|
|
671
|
+
applied_fee: number | null;
|
|
672
|
+
prospectus_fee: number | null;
|
|
673
|
+
max_expense_ratio: number | null;
|
|
674
|
+
} | null>;
|
|
675
|
+
get taxCategory(): Promise<string>;
|
|
676
|
+
withholdingTaxRate(purchaseDate?: Date, holdingDays?: number): Promise<number>;
|
|
625
677
|
}
|
|
626
678
|
declare function searchFunds(query: string): Promise<{
|
|
627
679
|
fund_code: string;
|
|
@@ -629,6 +681,16 @@ declare function searchFunds(query: string): Promise<{
|
|
|
629
681
|
fund_type: string;
|
|
630
682
|
return_1y?: number;
|
|
631
683
|
}[]>;
|
|
684
|
+
declare function managementFees(fundType?: "YAT" | "EMK", founder?: string): Promise<{
|
|
685
|
+
fund_code: string;
|
|
686
|
+
name: string;
|
|
687
|
+
fund_category: string;
|
|
688
|
+
founder_code: string;
|
|
689
|
+
applied_fee: number | null;
|
|
690
|
+
prospectus_fee: number | null;
|
|
691
|
+
max_expense_ratio: number | null;
|
|
692
|
+
annual_return: number | null;
|
|
693
|
+
}[]>;
|
|
632
694
|
declare function screenFunds(options: Record<string, unknown>): Promise<unknown[]>;
|
|
633
695
|
declare function compareFunds(fundCodes: string[]): Promise<{
|
|
634
696
|
funds: FundDetail[];
|
|
@@ -811,6 +873,7 @@ declare function searchCompanies(query: string): Promise<CompanyInfo[]>;
|
|
|
811
873
|
declare class Portfolio {
|
|
812
874
|
private holdings;
|
|
813
875
|
private benchmark;
|
|
876
|
+
private targetWeights;
|
|
814
877
|
add(symbol: string, options: {
|
|
815
878
|
shares: number;
|
|
816
879
|
cost?: number;
|
|
@@ -835,12 +898,14 @@ declare class Portfolio {
|
|
|
835
898
|
holdings: Array<Holding & {
|
|
836
899
|
symbol: string;
|
|
837
900
|
}>;
|
|
901
|
+
targetWeights?: Record<string, number>;
|
|
838
902
|
};
|
|
839
903
|
static fromDict(data: {
|
|
840
904
|
benchmark?: string;
|
|
841
905
|
holdings: Array<Holding & {
|
|
842
906
|
symbol: string;
|
|
843
907
|
}>;
|
|
908
|
+
targetWeights?: Record<string, number>;
|
|
844
909
|
}): Portfolio;
|
|
845
910
|
clear(): Portfolio;
|
|
846
911
|
private detectAssetType;
|
|
@@ -881,6 +946,34 @@ declare class Portfolio {
|
|
|
881
946
|
sortinoRatio(period?: string): Promise<number>;
|
|
882
947
|
beta(benchmarkSymbol?: string, period?: string): Promise<number>;
|
|
883
948
|
correlationMatrix(period?: string): Promise<Record<string, Record<string, number>>>;
|
|
949
|
+
setTargetWeights(weights: Record<string, number>): Portfolio;
|
|
950
|
+
getTargetWeights(): Record<string, number>;
|
|
951
|
+
drift(): Promise<Array<{
|
|
952
|
+
symbol: string;
|
|
953
|
+
currentWeight: number;
|
|
954
|
+
targetWeight: number;
|
|
955
|
+
drift: number;
|
|
956
|
+
driftPct: number;
|
|
957
|
+
}>>;
|
|
958
|
+
rebalancePlan(threshold?: number): Promise<Array<{
|
|
959
|
+
symbol: string;
|
|
960
|
+
action: "buy" | "sell";
|
|
961
|
+
currentWeight: number;
|
|
962
|
+
targetWeight: number;
|
|
963
|
+
weightDelta: number;
|
|
964
|
+
valueDelta: number;
|
|
965
|
+
}>>;
|
|
966
|
+
rebalance(threshold?: number, dryRun?: boolean): Promise<{
|
|
967
|
+
plan: Array<{
|
|
968
|
+
symbol: string;
|
|
969
|
+
action: "buy" | "sell";
|
|
970
|
+
currentWeight: number;
|
|
971
|
+
targetWeight: number;
|
|
972
|
+
weightDelta: number;
|
|
973
|
+
valueDelta: number;
|
|
974
|
+
}>;
|
|
975
|
+
executed: boolean;
|
|
976
|
+
}>;
|
|
884
977
|
}
|
|
885
978
|
|
|
886
979
|
declare function calculateHeikinAshi(data: OHLCVData[] | null): OHLCVData[];
|
|
@@ -1441,6 +1534,36 @@ declare class InvalidIntervalError extends BorsaTSError {
|
|
|
1441
1534
|
constructor(interval: string, validIntervals: string[]);
|
|
1442
1535
|
}
|
|
1443
1536
|
|
|
1537
|
+
declare const TAX_CATEGORIES: {
|
|
1538
|
+
readonly HISSE_YOĞUN: "Hisse Yoğun Fon";
|
|
1539
|
+
readonly HISSE_ENDEKS: "Hisse Endeks Fon";
|
|
1540
|
+
readonly DIGER: "Diğer Fon";
|
|
1541
|
+
readonly GIRISIM_SERMAYESI: "Girişim Sermayesi Fon";
|
|
1542
|
+
readonly GAYRIMENKUL: "Gayrimenkul Yatırım Fon";
|
|
1543
|
+
readonly ALTIN_GUMUS: "Altın/Gümüş ve Kıymetli Maden Fonları";
|
|
1544
|
+
readonly DOVIZ: "Döviz Fonları";
|
|
1545
|
+
readonly KATILIM: "Katılım Fonları (Faiz Dışı)";
|
|
1546
|
+
readonly BYF_HISSE: "BYF Hisse";
|
|
1547
|
+
readonly BYF_DIGER: "BYF Diğer";
|
|
1548
|
+
};
|
|
1549
|
+
type TaxCategory = (typeof TAX_CATEGORIES)[keyof typeof TAX_CATEGORIES];
|
|
1550
|
+
interface TaxPeriod {
|
|
1551
|
+
startDate: Date;
|
|
1552
|
+
endDate: Date | null;
|
|
1553
|
+
label: string;
|
|
1554
|
+
}
|
|
1555
|
+
declare const TAX_PERIODS: TaxPeriod[];
|
|
1556
|
+
declare function classifyFundTaxCategory(category: string, fundName?: string): string;
|
|
1557
|
+
declare function getWithholdingTaxRate(taxCategory: string, purchaseDate?: Date, _holdingDays?: number): number;
|
|
1558
|
+
declare function withholdingTaxRate(fundCode: string, purchaseDate?: Date, holdingDays?: number): Promise<number>;
|
|
1559
|
+
declare function withholdingTaxTable(): Array<{
|
|
1560
|
+
category: string;
|
|
1561
|
+
periods: Array<{
|
|
1562
|
+
label: string;
|
|
1563
|
+
rate: number;
|
|
1564
|
+
}>;
|
|
1565
|
+
}>;
|
|
1566
|
+
|
|
1444
1567
|
declare const FIELD_MAP: Record<string, string>;
|
|
1445
1568
|
declare const OPERATORS: Record<string, string>;
|
|
1446
1569
|
declare const LOCAL_CALC_FIELDS: Set<string>;
|
|
@@ -1505,4 +1628,4 @@ declare class ZiraatEurobondProvider extends BaseProvider {
|
|
|
1505
1628
|
}
|
|
1506
1629
|
declare function getEurobondProvider(): ZiraatEurobondProvider;
|
|
1507
1630
|
|
|
1508
|
-
export { APIError, type ActionData, type AddIndicatorsOptions, type AllRatesRecord, type AllocationData, type AssetType, AuthenticationError, Backtest, BacktestEngine, type BacktestResult, type BacktestSummaryData, type BalanceSheet, type BankRate, Bond, BorsaTSError, COUNTRIES, type CacheOptions, type CalendarEvent, type Candle, type CashFlowStatement, type CompanyInfo, Crypto, type CryptoPair, type CurrentData, DEFAULT_COLUMNS, DataNotAvailableError, type DividendData, type ETFHolder, EconomicCalendar, type EnrichedInfo, Eurobond$1 as Eurobond, type EurobondData, FIELD_MAP, FX, FastInfo, type FinancialRow, Fund, type FundInfo, type FundRiskMetrics, type FundType, type HolderData, type Holding, INDICATOR_OUTPUTS, INDICES, INTERVAL_MAP, type IncomeStatement, Index, type IndexComponent, type IndexInfo, type IndicatorData, type IndicatorMetadata, Inflation, type InstitutionRate, type Interval, InvalidIntervalError, InvalidPeriodError, LOCAL_CALC_FIELDS, MOVING_AVERAGE_COLUMNS, type MetalInstitutionRate, type NewsItem, type OHLCVData, type OHLCVWithActions, OPERATORS, OSCILLATOR_COLUMNS, type Period, PineFacadeProvider, type PineStudy, Portfolio, type Position, type PriceTarget, type ProviderConfig, type Quote, RateLimitError, type RateRecord, type Recommendation, type ReplayCandle, ReplaySession, type ReplayStats, type RequestOptions, type RiskMetrics, STANDARD_INDICATORS, type ScanOptions, type ScanResult$1 as ScanResult, Screener, type ScreenerCriteria, type ScreenerResult, type SearchResult, type Signal, type SplitData, type StrategyFunc, type StreamCandle, StudySession, type TASignalGroup, type TASignals, TCMB, type ScanResult as TVScanResult, TVScreenerProvider, TechnicalAnalyzer, TechnicalScanner, Ticker, TickerNotFoundError, type Trade, TradingViewETFProvider, TradingViewScannerProvider, TradingViewSearchProvider, TradingViewStream, type UnifiedSearchResult, VIOP, type VIOPContract, type Eurobond as ZiraatEurobondData, ZiraatEurobondProvider, addIndicators, allIndices, backtest, banks, bonds, calculateADX, calculateATR, calculateBollingerBands, calculateCCI, calculateEMA, calculateHeikinAshi, calculateIchimoku, calculateMACD, calculateOBV, calculatePivotPoints, calculateRSI, calculateSMA, calculateStochastic, calculateSupertrend, calculateTilsonT3, calculateVWAP, calculateWilliamsR, companies, compareFunds, createReplay, cryptoList, economicCalendar, eurobonds, getEurobondProvider, getPineFacadeProvider, getScannerProvider, getSearchProvider, getTVScreenerProvider, getTradingViewETFProvider, index, indices, metalInstitutions, policyRate, riskFreeRate, scan, screenFunds, screenStocks, screenerCriteria, search, searchBist, searchCompanies, searchCrypto, searchForex, searchFunds, searchIndex, searchViop, sectors, stockIndices, viopContracts };
|
|
1631
|
+
export { APIError, type ActionData, type AddIndicatorsOptions, type AllRatesRecord, type AllocationData, type AssetType, AuthenticationError, Backtest, BacktestEngine, type BacktestResult, type BacktestSummaryData, type BalanceSheet, type BankRate, Bond, BorsaTSError, COUNTRIES, type CacheOptions, type CalendarEvent, type Candle, type CashFlowStatement, type CompanyInfo, Crypto, type CryptoPair, type CurrentData, DEFAULT_COLUMNS, DataNotAvailableError, type DividendData, type ETFHolder, EconomicCalendar, type EnrichedInfo, Eurobond$1 as Eurobond, type EurobondData, FIELD_MAP, FX, FastInfo, type FinancialRow, Fund, type FundInfo, type FundRiskMetrics, type FundType, type HolderData, type Holding, INDICATOR_OUTPUTS, INDICES, INTERVAL_MAP, type IncomeStatement, Index, type IndexComponent, type IndexInfo, type IndicatorData, type IndicatorMetadata, Inflation, type InstitutionRate, type Interval, InvalidIntervalError, InvalidPeriodError, LOCAL_CALC_FIELDS, MOVING_AVERAGE_COLUMNS, type MetalInstitutionRate, type NewsItem, type OHLCVData, type OHLCVWithActions, OPERATORS, OSCILLATOR_COLUMNS, type Period, PineFacadeProvider, type PineStudy, Portfolio, type Position, type PriceTarget, type ProviderConfig, type Quote, RateLimitError, type RateRecord, type Recommendation, type ReplayCandle, ReplaySession, type ReplayStats, type RequestOptions, type RiskMetrics, STANDARD_INDICATORS, type ScanOptions, type ScanResult$1 as ScanResult, Screener, type ScreenerCriteria, type ScreenerResult, type SearchResult, type Signal, type SplitData, type StrategyFunc, type StreamCandle, StudySession, type TASignalGroup, type TASignals, TAX_CATEGORIES, TAX_PERIODS, TCMB, type ScanResult as TVScanResult, TVScreenerProvider, type TaxCategory, type TaxPeriod, TechnicalAnalyzer, TechnicalScanner, Ticker, TickerNotFoundError, type Trade, TradingViewETFProvider, TradingViewScannerProvider, TradingViewSearchProvider, TradingViewStream, type UnifiedSearchResult, VIOP, type VIOPContract, type Eurobond as ZiraatEurobondData, ZiraatEurobondProvider, addIndicators, allIndices, backtest, banks, bonds, calculateADX, calculateATR, calculateBollingerBands, calculateCCI, calculateDEMA, calculateEMA, calculateHHV, calculateHeikinAshi, calculateIchimoku, calculateLLV, calculateMACD, calculateMOM, calculateOBV, calculatePivotPoints, calculateROC, calculateRSI, calculateSMA, calculateStochastic, calculateSupertrend, calculateTEMA, calculateTilsonT3, calculateVWAP, calculateWMA, calculateWilliamsR, classifyFundTaxCategory, companies, compareFunds, createReplay, cryptoList, economicCalendar, eurobonds, getEurobondProvider, getPineFacadeProvider, getScannerProvider, getSearchProvider, getTVScreenerProvider, getTradingViewETFProvider, getWithholdingTaxRate, index, indices, managementFees, metalInstitutions, policyRate, riskFreeRate, scan, screenFunds, screenStocks, screenerCriteria, search, searchBist, searchCompanies, searchCrypto, searchForex, searchFunds, searchIndex, searchViop, sectors, stockIndices, viopContracts, withholdingTaxRate, withholdingTaxTable };
|