@muhammedaksam/borsats 0.7.2 → 0.8.7

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.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<{
@@ -400,9 +421,11 @@ declare class TechnicalAnalyzer {
400
421
  }>;
401
422
  }
402
423
 
424
+ declare function computeAdjClose(closePrices: number[], closeDates: Date[], dividends: DividendData[]): number[];
403
425
  type OHLCVWithActions = OHLCVData & {
404
426
  dividend?: number;
405
427
  split?: number;
428
+ adjClose?: number;
406
429
  };
407
430
  interface EnrichedInfo extends CurrentData {
408
431
  marketCap?: number;
@@ -462,7 +485,10 @@ declare class Ticker {
462
485
  start?: Date | string;
463
486
  end?: Date | string;
464
487
  actions?: boolean;
488
+ adjust?: boolean;
489
+ autoAdjust?: boolean;
465
490
  }): Promise<OHLCVWithActions[]>;
491
+ private _unadjustPrices;
466
492
  private _mergeActions;
467
493
  get balanceSheet(): Promise<BalanceSheet>;
468
494
  get incomeStmt(): Promise<IncomeStatement>;
@@ -470,6 +496,21 @@ declare class Ticker {
470
496
  get quarterlyBalanceSheet(): Promise<BalanceSheet>;
471
497
  get quarterlyIncomeStmt(): Promise<IncomeStatement>;
472
498
  get quarterlyCashflow(): Promise<CashFlowStatement>;
499
+ getBalanceSheet(options?: {
500
+ quarterly?: boolean;
501
+ lastN?: number | string;
502
+ financialGroup?: string;
503
+ }): Promise<BalanceSheet>;
504
+ getIncomeStmt(options?: {
505
+ quarterly?: boolean;
506
+ lastN?: number | string;
507
+ financialGroup?: string;
508
+ }): Promise<IncomeStatement>;
509
+ getCashflow(options?: {
510
+ quarterly?: boolean;
511
+ lastN?: number | string;
512
+ financialGroup?: string;
513
+ }): Promise<CashFlowStatement>;
473
514
  get dividends(): Promise<DividendData[]>;
474
515
  get splits(): Promise<CapitalIncreaseData[]>;
475
516
  get majorHolders(): Promise<HolderData[]>;
@@ -503,6 +544,13 @@ declare class Ticker {
503
544
  obv(period?: Period): Promise<number>;
504
545
  vwap(period?: Period): Promise<number>;
505
546
  adx(period?: Period, adxPeriod?: number): Promise<number>;
547
+ hhv(period?: Period, hhvPeriod?: number): Promise<number>;
548
+ llv(period?: Period, llvPeriod?: number): Promise<number>;
549
+ mom(period?: Period, momPeriod?: number): Promise<number>;
550
+ roc(period?: Period, rocPeriod?: number): Promise<number>;
551
+ wma(period?: Period, wmaPeriod?: number): Promise<number>;
552
+ dema(period?: Period, demaPeriod?: number): Promise<number>;
553
+ tema(period?: Period, temaPeriod?: number): Promise<number>;
506
554
  heikinAshi(period?: Period, interval?: Interval): Promise<OHLCVData[]>;
507
555
  private calculateStartDate;
508
556
  private daysYTD;
@@ -622,6 +670,13 @@ declare class Fund {
622
670
  technicals(period?: string): Promise<TechnicalAnalyzer>;
623
671
  riskMetrics(period?: string, rfRate?: number): Promise<FundRiskMetrics>;
624
672
  sharpeRatio(period?: string, rfRate?: number): Promise<number>;
673
+ get managementFee(): Promise<{
674
+ applied_fee: number | null;
675
+ prospectus_fee: number | null;
676
+ max_expense_ratio: number | null;
677
+ } | null>;
678
+ get taxCategory(): Promise<string>;
679
+ withholdingTaxRate(purchaseDate?: Date, holdingDays?: number): Promise<number>;
625
680
  }
626
681
  declare function searchFunds(query: string): Promise<{
627
682
  fund_code: string;
@@ -629,6 +684,16 @@ declare function searchFunds(query: string): Promise<{
629
684
  fund_type: string;
630
685
  return_1y?: number;
631
686
  }[]>;
687
+ declare function managementFees(fundType?: "YAT" | "EMK", founder?: string): Promise<{
688
+ fund_code: string;
689
+ name: string;
690
+ fund_category: string;
691
+ founder_code: string;
692
+ applied_fee: number | null;
693
+ prospectus_fee: number | null;
694
+ max_expense_ratio: number | null;
695
+ annual_return: number | null;
696
+ }[]>;
632
697
  declare function screenFunds(options: Record<string, unknown>): Promise<unknown[]>;
633
698
  declare function compareFunds(fundCodes: string[]): Promise<{
634
699
  funds: FundDetail[];
@@ -811,6 +876,7 @@ declare function searchCompanies(query: string): Promise<CompanyInfo[]>;
811
876
  declare class Portfolio {
812
877
  private holdings;
813
878
  private benchmark;
879
+ private targetWeights;
814
880
  add(symbol: string, options: {
815
881
  shares: number;
816
882
  cost?: number;
@@ -835,12 +901,14 @@ declare class Portfolio {
835
901
  holdings: Array<Holding & {
836
902
  symbol: string;
837
903
  }>;
904
+ targetWeights?: Record<string, number>;
838
905
  };
839
906
  static fromDict(data: {
840
907
  benchmark?: string;
841
908
  holdings: Array<Holding & {
842
909
  symbol: string;
843
910
  }>;
911
+ targetWeights?: Record<string, number>;
844
912
  }): Portfolio;
845
913
  clear(): Portfolio;
846
914
  private detectAssetType;
@@ -881,6 +949,34 @@ declare class Portfolio {
881
949
  sortinoRatio(period?: string): Promise<number>;
882
950
  beta(benchmarkSymbol?: string, period?: string): Promise<number>;
883
951
  correlationMatrix(period?: string): Promise<Record<string, Record<string, number>>>;
952
+ setTargetWeights(weights: Record<string, number>): Portfolio;
953
+ getTargetWeights(): Record<string, number>;
954
+ drift(): Promise<Array<{
955
+ symbol: string;
956
+ currentWeight: number;
957
+ targetWeight: number;
958
+ drift: number;
959
+ driftPct: number;
960
+ }>>;
961
+ rebalancePlan(threshold?: number): Promise<Array<{
962
+ symbol: string;
963
+ action: "buy" | "sell";
964
+ currentWeight: number;
965
+ targetWeight: number;
966
+ weightDelta: number;
967
+ valueDelta: number;
968
+ }>>;
969
+ rebalance(threshold?: number, dryRun?: boolean): Promise<{
970
+ plan: Array<{
971
+ symbol: string;
972
+ action: "buy" | "sell";
973
+ currentWeight: number;
974
+ targetWeight: number;
975
+ weightDelta: number;
976
+ valueDelta: number;
977
+ }>;
978
+ executed: boolean;
979
+ }>;
884
980
  }
885
981
 
886
982
  declare function calculateHeikinAshi(data: OHLCVData[] | null): OHLCVData[];
@@ -1387,6 +1483,40 @@ declare class Inflation {
1387
1483
  }>;
1388
1484
  }
1389
1485
 
1486
+ interface Eurobond$1 {
1487
+ isin: string;
1488
+ maturity: Date | null;
1489
+ daysToMaturity: number;
1490
+ currency: string;
1491
+ bidPrice: number | null;
1492
+ bidYield: number | null;
1493
+ askPrice: number | null;
1494
+ askYield: number | null;
1495
+ }
1496
+ interface EurobondHistoryRow {
1497
+ date: Date;
1498
+ bidPrice: number | null;
1499
+ bidYield: number | null;
1500
+ askPrice: number | null;
1501
+ askYield: number | null;
1502
+ daysToMaturity: number;
1503
+ }
1504
+ declare class ZiraatEurobondProvider extends BaseProvider {
1505
+ private _cache;
1506
+ private _cacheTime;
1507
+ private readonly CACHE_TTL;
1508
+ private parseTurkishNumber;
1509
+ private parseDate;
1510
+ private fetchBondsForDate;
1511
+ private hasValidYields;
1512
+ getEurobonds(currency?: string): Promise<Eurobond$1[]>;
1513
+ getEurobond(isin: string): Promise<Eurobond$1 | null>;
1514
+ private fetchBondsForDateCached;
1515
+ static iterBusinessDates(start: Date, end: Date, skipWeekends?: boolean): Date[];
1516
+ getHistory(isin: string, start: Date, end: Date, skipWeekends?: boolean, maxWorkers?: number): Promise<EurobondHistoryRow[]>;
1517
+ }
1518
+ declare function getEurobondProvider(): ZiraatEurobondProvider;
1519
+
1390
1520
  interface EurobondData {
1391
1521
  isin: string;
1392
1522
  maturity: Date | null;
@@ -1398,7 +1528,7 @@ interface EurobondData {
1398
1528
  askYield: number | null;
1399
1529
  }
1400
1530
  declare function eurobonds(currency?: string): Promise<EurobondData[]>;
1401
- declare class Eurobond$1 {
1531
+ declare class Eurobond {
1402
1532
  readonly isin: string;
1403
1533
  constructor(isin: string);
1404
1534
  maturity(): Promise<Date | null>;
@@ -1411,6 +1541,12 @@ declare class Eurobond$1 {
1411
1541
  askYield(): Promise<number | null>;
1412
1542
  getData(): Promise<EurobondData | null>;
1413
1543
  info(): Promise<EurobondData | null>;
1544
+ history(options?: {
1545
+ period?: string;
1546
+ start?: string | Date;
1547
+ end?: string | Date;
1548
+ skipWeekends?: boolean;
1549
+ }): Promise<EurobondHistoryRow[]>;
1414
1550
  }
1415
1551
 
1416
1552
  declare class BorsaTSError extends Error {
@@ -1441,6 +1577,36 @@ declare class InvalidIntervalError extends BorsaTSError {
1441
1577
  constructor(interval: string, validIntervals: string[]);
1442
1578
  }
1443
1579
 
1580
+ declare const TAX_CATEGORIES: {
1581
+ readonly HISSE_YOĞUN: "Hisse Yoğun Fon";
1582
+ readonly HISSE_ENDEKS: "Hisse Endeks Fon";
1583
+ readonly DIGER: "Diğer Fon";
1584
+ readonly GIRISIM_SERMAYESI: "Girişim Sermayesi Fon";
1585
+ readonly GAYRIMENKUL: "Gayrimenkul Yatırım Fon";
1586
+ readonly ALTIN_GUMUS: "Altın/Gümüş ve Kıymetli Maden Fonları";
1587
+ readonly DOVIZ: "Döviz Fonları";
1588
+ readonly KATILIM: "Katılım Fonları (Faiz Dışı)";
1589
+ readonly BYF_HISSE: "BYF Hisse";
1590
+ readonly BYF_DIGER: "BYF Diğer";
1591
+ };
1592
+ type TaxCategory = (typeof TAX_CATEGORIES)[keyof typeof TAX_CATEGORIES];
1593
+ interface TaxPeriod {
1594
+ startDate: Date;
1595
+ endDate: Date | null;
1596
+ label: string;
1597
+ }
1598
+ declare const TAX_PERIODS: TaxPeriod[];
1599
+ declare function classifyFundTaxCategory(category: string, fundName?: string): string;
1600
+ declare function getWithholdingTaxRate(taxCategory: string, purchaseDate?: Date, _holdingDays?: number): number;
1601
+ declare function withholdingTaxRate(fundCode: string, purchaseDate?: Date, holdingDays?: number): Promise<number>;
1602
+ declare function withholdingTaxTable(): Array<{
1603
+ category: string;
1604
+ periods: Array<{
1605
+ label: string;
1606
+ rate: number;
1607
+ }>;
1608
+ }>;
1609
+
1444
1610
  declare const FIELD_MAP: Record<string, string>;
1445
1611
  declare const OPERATORS: Record<string, string>;
1446
1612
  declare const LOCAL_CALC_FIELDS: Set<string>;
@@ -1482,27 +1648,4 @@ declare class TVScreenerProvider extends BaseProvider {
1482
1648
  }
1483
1649
  declare function getTVScreenerProvider(): TVScreenerProvider;
1484
1650
 
1485
- interface Eurobond {
1486
- isin: string;
1487
- maturity: Date | null;
1488
- daysToMaturity: number;
1489
- currency: string;
1490
- bidPrice: number | null;
1491
- bidYield: number | null;
1492
- askPrice: number | null;
1493
- askYield: number | null;
1494
- }
1495
- declare class ZiraatEurobondProvider extends BaseProvider {
1496
- private _cache;
1497
- private _cacheTime;
1498
- private readonly CACHE_TTL;
1499
- private parseTurkishNumber;
1500
- private parseDate;
1501
- private fetchBondsForDate;
1502
- private hasValidYields;
1503
- getEurobonds(currency?: string): Promise<Eurobond[]>;
1504
- getEurobond(isin: string): Promise<Eurobond | null>;
1505
- }
1506
- declare function getEurobondProvider(): ZiraatEurobondProvider;
1507
-
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 };
1651
+ 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, type EurobondData, type EurobondHistoryRow, 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$1 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, computeAdjClose, 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<{
@@ -400,9 +421,11 @@ declare class TechnicalAnalyzer {
400
421
  }>;
401
422
  }
402
423
 
424
+ declare function computeAdjClose(closePrices: number[], closeDates: Date[], dividends: DividendData[]): number[];
403
425
  type OHLCVWithActions = OHLCVData & {
404
426
  dividend?: number;
405
427
  split?: number;
428
+ adjClose?: number;
406
429
  };
407
430
  interface EnrichedInfo extends CurrentData {
408
431
  marketCap?: number;
@@ -462,7 +485,10 @@ declare class Ticker {
462
485
  start?: Date | string;
463
486
  end?: Date | string;
464
487
  actions?: boolean;
488
+ adjust?: boolean;
489
+ autoAdjust?: boolean;
465
490
  }): Promise<OHLCVWithActions[]>;
491
+ private _unadjustPrices;
466
492
  private _mergeActions;
467
493
  get balanceSheet(): Promise<BalanceSheet>;
468
494
  get incomeStmt(): Promise<IncomeStatement>;
@@ -470,6 +496,21 @@ declare class Ticker {
470
496
  get quarterlyBalanceSheet(): Promise<BalanceSheet>;
471
497
  get quarterlyIncomeStmt(): Promise<IncomeStatement>;
472
498
  get quarterlyCashflow(): Promise<CashFlowStatement>;
499
+ getBalanceSheet(options?: {
500
+ quarterly?: boolean;
501
+ lastN?: number | string;
502
+ financialGroup?: string;
503
+ }): Promise<BalanceSheet>;
504
+ getIncomeStmt(options?: {
505
+ quarterly?: boolean;
506
+ lastN?: number | string;
507
+ financialGroup?: string;
508
+ }): Promise<IncomeStatement>;
509
+ getCashflow(options?: {
510
+ quarterly?: boolean;
511
+ lastN?: number | string;
512
+ financialGroup?: string;
513
+ }): Promise<CashFlowStatement>;
473
514
  get dividends(): Promise<DividendData[]>;
474
515
  get splits(): Promise<CapitalIncreaseData[]>;
475
516
  get majorHolders(): Promise<HolderData[]>;
@@ -503,6 +544,13 @@ declare class Ticker {
503
544
  obv(period?: Period): Promise<number>;
504
545
  vwap(period?: Period): Promise<number>;
505
546
  adx(period?: Period, adxPeriod?: number): Promise<number>;
547
+ hhv(period?: Period, hhvPeriod?: number): Promise<number>;
548
+ llv(period?: Period, llvPeriod?: number): Promise<number>;
549
+ mom(period?: Period, momPeriod?: number): Promise<number>;
550
+ roc(period?: Period, rocPeriod?: number): Promise<number>;
551
+ wma(period?: Period, wmaPeriod?: number): Promise<number>;
552
+ dema(period?: Period, demaPeriod?: number): Promise<number>;
553
+ tema(period?: Period, temaPeriod?: number): Promise<number>;
506
554
  heikinAshi(period?: Period, interval?: Interval): Promise<OHLCVData[]>;
507
555
  private calculateStartDate;
508
556
  private daysYTD;
@@ -622,6 +670,13 @@ declare class Fund {
622
670
  technicals(period?: string): Promise<TechnicalAnalyzer>;
623
671
  riskMetrics(period?: string, rfRate?: number): Promise<FundRiskMetrics>;
624
672
  sharpeRatio(period?: string, rfRate?: number): Promise<number>;
673
+ get managementFee(): Promise<{
674
+ applied_fee: number | null;
675
+ prospectus_fee: number | null;
676
+ max_expense_ratio: number | null;
677
+ } | null>;
678
+ get taxCategory(): Promise<string>;
679
+ withholdingTaxRate(purchaseDate?: Date, holdingDays?: number): Promise<number>;
625
680
  }
626
681
  declare function searchFunds(query: string): Promise<{
627
682
  fund_code: string;
@@ -629,6 +684,16 @@ declare function searchFunds(query: string): Promise<{
629
684
  fund_type: string;
630
685
  return_1y?: number;
631
686
  }[]>;
687
+ declare function managementFees(fundType?: "YAT" | "EMK", founder?: string): Promise<{
688
+ fund_code: string;
689
+ name: string;
690
+ fund_category: string;
691
+ founder_code: string;
692
+ applied_fee: number | null;
693
+ prospectus_fee: number | null;
694
+ max_expense_ratio: number | null;
695
+ annual_return: number | null;
696
+ }[]>;
632
697
  declare function screenFunds(options: Record<string, unknown>): Promise<unknown[]>;
633
698
  declare function compareFunds(fundCodes: string[]): Promise<{
634
699
  funds: FundDetail[];
@@ -811,6 +876,7 @@ declare function searchCompanies(query: string): Promise<CompanyInfo[]>;
811
876
  declare class Portfolio {
812
877
  private holdings;
813
878
  private benchmark;
879
+ private targetWeights;
814
880
  add(symbol: string, options: {
815
881
  shares: number;
816
882
  cost?: number;
@@ -835,12 +901,14 @@ declare class Portfolio {
835
901
  holdings: Array<Holding & {
836
902
  symbol: string;
837
903
  }>;
904
+ targetWeights?: Record<string, number>;
838
905
  };
839
906
  static fromDict(data: {
840
907
  benchmark?: string;
841
908
  holdings: Array<Holding & {
842
909
  symbol: string;
843
910
  }>;
911
+ targetWeights?: Record<string, number>;
844
912
  }): Portfolio;
845
913
  clear(): Portfolio;
846
914
  private detectAssetType;
@@ -881,6 +949,34 @@ declare class Portfolio {
881
949
  sortinoRatio(period?: string): Promise<number>;
882
950
  beta(benchmarkSymbol?: string, period?: string): Promise<number>;
883
951
  correlationMatrix(period?: string): Promise<Record<string, Record<string, number>>>;
952
+ setTargetWeights(weights: Record<string, number>): Portfolio;
953
+ getTargetWeights(): Record<string, number>;
954
+ drift(): Promise<Array<{
955
+ symbol: string;
956
+ currentWeight: number;
957
+ targetWeight: number;
958
+ drift: number;
959
+ driftPct: number;
960
+ }>>;
961
+ rebalancePlan(threshold?: number): Promise<Array<{
962
+ symbol: string;
963
+ action: "buy" | "sell";
964
+ currentWeight: number;
965
+ targetWeight: number;
966
+ weightDelta: number;
967
+ valueDelta: number;
968
+ }>>;
969
+ rebalance(threshold?: number, dryRun?: boolean): Promise<{
970
+ plan: Array<{
971
+ symbol: string;
972
+ action: "buy" | "sell";
973
+ currentWeight: number;
974
+ targetWeight: number;
975
+ weightDelta: number;
976
+ valueDelta: number;
977
+ }>;
978
+ executed: boolean;
979
+ }>;
884
980
  }
885
981
 
886
982
  declare function calculateHeikinAshi(data: OHLCVData[] | null): OHLCVData[];
@@ -1387,6 +1483,40 @@ declare class Inflation {
1387
1483
  }>;
1388
1484
  }
1389
1485
 
1486
+ interface Eurobond$1 {
1487
+ isin: string;
1488
+ maturity: Date | null;
1489
+ daysToMaturity: number;
1490
+ currency: string;
1491
+ bidPrice: number | null;
1492
+ bidYield: number | null;
1493
+ askPrice: number | null;
1494
+ askYield: number | null;
1495
+ }
1496
+ interface EurobondHistoryRow {
1497
+ date: Date;
1498
+ bidPrice: number | null;
1499
+ bidYield: number | null;
1500
+ askPrice: number | null;
1501
+ askYield: number | null;
1502
+ daysToMaturity: number;
1503
+ }
1504
+ declare class ZiraatEurobondProvider extends BaseProvider {
1505
+ private _cache;
1506
+ private _cacheTime;
1507
+ private readonly CACHE_TTL;
1508
+ private parseTurkishNumber;
1509
+ private parseDate;
1510
+ private fetchBondsForDate;
1511
+ private hasValidYields;
1512
+ getEurobonds(currency?: string): Promise<Eurobond$1[]>;
1513
+ getEurobond(isin: string): Promise<Eurobond$1 | null>;
1514
+ private fetchBondsForDateCached;
1515
+ static iterBusinessDates(start: Date, end: Date, skipWeekends?: boolean): Date[];
1516
+ getHistory(isin: string, start: Date, end: Date, skipWeekends?: boolean, maxWorkers?: number): Promise<EurobondHistoryRow[]>;
1517
+ }
1518
+ declare function getEurobondProvider(): ZiraatEurobondProvider;
1519
+
1390
1520
  interface EurobondData {
1391
1521
  isin: string;
1392
1522
  maturity: Date | null;
@@ -1398,7 +1528,7 @@ interface EurobondData {
1398
1528
  askYield: number | null;
1399
1529
  }
1400
1530
  declare function eurobonds(currency?: string): Promise<EurobondData[]>;
1401
- declare class Eurobond$1 {
1531
+ declare class Eurobond {
1402
1532
  readonly isin: string;
1403
1533
  constructor(isin: string);
1404
1534
  maturity(): Promise<Date | null>;
@@ -1411,6 +1541,12 @@ declare class Eurobond$1 {
1411
1541
  askYield(): Promise<number | null>;
1412
1542
  getData(): Promise<EurobondData | null>;
1413
1543
  info(): Promise<EurobondData | null>;
1544
+ history(options?: {
1545
+ period?: string;
1546
+ start?: string | Date;
1547
+ end?: string | Date;
1548
+ skipWeekends?: boolean;
1549
+ }): Promise<EurobondHistoryRow[]>;
1414
1550
  }
1415
1551
 
1416
1552
  declare class BorsaTSError extends Error {
@@ -1441,6 +1577,36 @@ declare class InvalidIntervalError extends BorsaTSError {
1441
1577
  constructor(interval: string, validIntervals: string[]);
1442
1578
  }
1443
1579
 
1580
+ declare const TAX_CATEGORIES: {
1581
+ readonly HISSE_YOĞUN: "Hisse Yoğun Fon";
1582
+ readonly HISSE_ENDEKS: "Hisse Endeks Fon";
1583
+ readonly DIGER: "Diğer Fon";
1584
+ readonly GIRISIM_SERMAYESI: "Girişim Sermayesi Fon";
1585
+ readonly GAYRIMENKUL: "Gayrimenkul Yatırım Fon";
1586
+ readonly ALTIN_GUMUS: "Altın/Gümüş ve Kıymetli Maden Fonları";
1587
+ readonly DOVIZ: "Döviz Fonları";
1588
+ readonly KATILIM: "Katılım Fonları (Faiz Dışı)";
1589
+ readonly BYF_HISSE: "BYF Hisse";
1590
+ readonly BYF_DIGER: "BYF Diğer";
1591
+ };
1592
+ type TaxCategory = (typeof TAX_CATEGORIES)[keyof typeof TAX_CATEGORIES];
1593
+ interface TaxPeriod {
1594
+ startDate: Date;
1595
+ endDate: Date | null;
1596
+ label: string;
1597
+ }
1598
+ declare const TAX_PERIODS: TaxPeriod[];
1599
+ declare function classifyFundTaxCategory(category: string, fundName?: string): string;
1600
+ declare function getWithholdingTaxRate(taxCategory: string, purchaseDate?: Date, _holdingDays?: number): number;
1601
+ declare function withholdingTaxRate(fundCode: string, purchaseDate?: Date, holdingDays?: number): Promise<number>;
1602
+ declare function withholdingTaxTable(): Array<{
1603
+ category: string;
1604
+ periods: Array<{
1605
+ label: string;
1606
+ rate: number;
1607
+ }>;
1608
+ }>;
1609
+
1444
1610
  declare const FIELD_MAP: Record<string, string>;
1445
1611
  declare const OPERATORS: Record<string, string>;
1446
1612
  declare const LOCAL_CALC_FIELDS: Set<string>;
@@ -1482,27 +1648,4 @@ declare class TVScreenerProvider extends BaseProvider {
1482
1648
  }
1483
1649
  declare function getTVScreenerProvider(): TVScreenerProvider;
1484
1650
 
1485
- interface Eurobond {
1486
- isin: string;
1487
- maturity: Date | null;
1488
- daysToMaturity: number;
1489
- currency: string;
1490
- bidPrice: number | null;
1491
- bidYield: number | null;
1492
- askPrice: number | null;
1493
- askYield: number | null;
1494
- }
1495
- declare class ZiraatEurobondProvider extends BaseProvider {
1496
- private _cache;
1497
- private _cacheTime;
1498
- private readonly CACHE_TTL;
1499
- private parseTurkishNumber;
1500
- private parseDate;
1501
- private fetchBondsForDate;
1502
- private hasValidYields;
1503
- getEurobonds(currency?: string): Promise<Eurobond[]>;
1504
- getEurobond(isin: string): Promise<Eurobond | null>;
1505
- }
1506
- declare function getEurobondProvider(): ZiraatEurobondProvider;
1507
-
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 };
1651
+ 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, type EurobondData, type EurobondHistoryRow, 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$1 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, computeAdjClose, 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 };