UNPKG

@gviper/alphavantage-api

Version:

TypeScript SDK for Alpha Vantage API with comprehensive type safety and all endpoint support

238 lines 9.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Technicals = void 0; class Technicals { constructor(client) { this.client = client; } /** * Returns the simple moving average (SMA) values for the specified symbol and time period. * * @param params - Parameters including symbol, interval, time_period, and series_type * @returns Promise resolving to SMA indicator data * @example https://www.alphavantage.co/query?function=SMA&symbol=IBM&interval=weekly&time_period=10&series_type=open&apikey=demo */ async sma(params) { return this.client.request({ function: 'SMA', ...params, }); } /** * Returns the exponential moving average (EMA) values for the specified symbol and time period. * * @param params - Parameters including symbol, interval, time_period, and series_type * @returns Promise resolving to EMA indicator data * @example https://www.alphavantage.co/query?function=EMA&symbol=IBM&interval=weekly&time_period=10&series_type=open&apikey=demo */ async ema(params) { return this.client.request({ function: 'EMA', ...params, }); } /** * Returns the weighted moving average (WMA) values for the specified symbol and time period. * * @param params - Parameters including symbol, interval, time_period, and series_type * @returns Promise resolving to WMA indicator data * @example https://www.alphavantage.co/query?function=WMA&symbol=IBM&interval=weekly&time_period=10&series_type=open&apikey=demo */ async wma(params) { return this.client.request({ function: 'WMA', ...params, }); } async dema(params) { return this.client.request({ function: 'DEMA', ...params }); } async tema(params) { return this.client.request({ function: 'TEMA', ...params }); } async trima(params) { return this.client.request({ function: 'TRIMA', ...params }); } async kama(params) { return this.client.request({ function: 'KAMA', ...params }); } async mama(params) { return this.client.request({ function: 'MAMA', ...params }); } async t3(params) { return this.client.request({ function: 'T3', ...params }); } /** * Returns the moving average convergence / divergence (MACD) values for the specified symbol. * * @param params - Parameters including symbol, interval, and series_type * @returns Promise resolving to MACD indicator data * @example https://www.alphavantage.co/query?function=MACD&symbol=IBM&interval=daily&series_type=open&apikey=demo */ async macd(params) { return this.client.request({ function: 'MACD', ...params }); } /** * Returns the moving average convergence / divergence (MACD) values with controllable moving average type. * * @param params - Parameters including symbol, interval, series_type, and moving average types * @returns Promise resolving to MACD extended indicator data * @example https://www.alphavantage.co/query?function=MACDEXT&symbol=IBM&interval=daily&series_type=open&apikey=demo */ async macdext(params) { return this.client.request({ function: 'MACDEXT', ...params }); } /** * Returns the stochastic oscillator values for the specified symbol. * * @param params - Parameters including symbol, interval, and time periods * @returns Promise resolving to stochastic oscillator data * @example https://www.alphavantage.co/query?function=STOCH&symbol=IBM&interval=daily&apikey=demo */ async stoch(params) { return this.client.request({ function: 'STOCH', ...params }); } /** * Returns the stochastic fast oscillator values for the specified symbol. * * @param params - Parameters including symbol, interval, and time periods * @returns Promise resolving to stochastic fast oscillator data * @example https://www.alphavantage.co/query?function=STOCHF&symbol=IBM&interval=daily&apikey=demo */ async stochf(params) { return this.client.request({ function: 'STOCHF', ...params }); } /** * Returns the relative strength index (RSI) values for the specified symbol. * * @param params - Parameters including symbol, interval, time_period, and series_type * @returns Promise resolving to RSI indicator data * @example https://www.alphavantage.co/query?function=RSI&symbol=IBM&interval=weekly&time_period=10&series_type=open&apikey=demo */ async rsi(params) { return this.client.request({ function: 'RSI', ...params }); } async stochrsi(params) { return this.client.request({ function: 'STOCHRSI', ...params }); } async willr(params) { return this.client.request({ function: 'WILLR', ...params }); } async adx(params) { return this.client.request({ function: 'ADX', ...params }); } async adxr(params) { return this.client.request({ function: 'ADXR', ...params }); } async apo(params) { return this.client.request({ function: 'APO', ...params }); } async ppo(params) { return this.client.request({ function: 'PPO', ...params }); } async mom(params) { return this.client.request({ function: 'MOM', ...params }); } async bop(params) { return this.client.request({ function: 'BOP', ...params }); } async cci(params) { return this.client.request({ function: 'CCI', ...params }); } async cmo(params) { return this.client.request({ function: 'CMO', ...params }); } async roc(params) { return this.client.request({ function: 'ROC', ...params }); } async rocr(params) { return this.client.request({ function: 'ROCR', ...params }); } async aroon(params) { return this.client.request({ function: 'AROON', ...params }); } async aroonosc(params) { return this.client.request({ function: 'AROONOSC', ...params }); } async mfi(params) { return this.client.request({ function: 'MFI', ...params }); } async trix(params) { return this.client.request({ function: 'TRIX', ...params }); } async ultosc(params) { return this.client.request({ function: 'ULTOSC', ...params }); } async dx(params) { return this.client.request({ function: 'DX', ...params }); } async minus_di(params) { return this.client.request({ function: 'MINUS_DI', ...params }); } async plus_di(params) { return this.client.request({ function: 'PLUS_DI', ...params }); } async minus_dm(params) { return this.client.request({ function: 'MINUS_DM', ...params }); } async plus_dm(params) { return this.client.request({ function: 'PLUS_DM', ...params }); } /** * Returns the Bollinger bands (BBANDS) values for the specified symbol. * * @param params - Parameters including symbol, interval, time_period, series_type, and optional deviation * @returns Promise resolving to Bollinger bands data * @example https://www.alphavantage.co/query?function=BBANDS&symbol=IBM&interval=weekly&time_period=5&series_type=close&nbdevup=2&nbdevdn=2&apikey=demo */ async bbands(params) { return this.client.request({ function: 'BBANDS', ...params }); } async midpoint(params) { return this.client.request({ function: 'MIDPOINT', ...params }); } async midprice(params) { return this.client.request({ function: 'MIDPRICE', ...params }); } async sar(params) { return this.client.request({ function: 'SAR', ...params }); } async trange(params) { return this.client.request({ function: 'TRANGE', ...params }); } async atr(params) { return this.client.request({ function: 'ATR', ...params }); } async natr(params) { return this.client.request({ function: 'NATR', ...params }); } async ad(params) { return this.client.request({ function: 'AD', ...params }); } async adosc(params) { return this.client.request({ function: 'ADOSC', ...params }); } async obv(params) { return this.client.request({ function: 'OBV', ...params }); } async ht_trendline(params) { return this.client.request({ function: 'HT_TRENDLINE', ...params }); } async ht_sine(params) { return this.client.request({ function: 'HT_SINE', ...params }); } async ht_trendmode(params) { return this.client.request({ function: 'HT_TRENDMODE', ...params }); } async ht_dcperiod(params) { return this.client.request({ function: 'HT_DCPERIOD', ...params }); } async ht_dcphase(params) { return this.client.request({ function: 'HT_DCPHASE', ...params }); } async ht_phasor(params) { return this.client.request({ function: 'HT_PHASOR', ...params }); } } exports.Technicals = Technicals; //# sourceMappingURL=technicals.js.map