This class is a wrapper for the Taapi NPM client. It is used to interact with the Taapi API, making it a little easier to use with this framework.

Hierarchy

  • default

Constructors

  • Initializes a new instance of the Taapi NPM client. Setts the default exchange to the one specified in the configuration.

    Parameters

    • systemConfig: {}

      Contains the concatinated configuration from the config.yml and strategy.yml files

      Returns default

    Properties

    npmClient: any
    systemConfig: any

    Contains the concatinated configuration from the config.yml and strategy.yml files

    Methods

    • Adds a calculation to the bulk construct. As standard, you may add 20 calculations to a construct, but if your plan supports multiple constructs, you can fetch data accross multiple assets pairs / timeframes in one request.

      See

      Example

      this.addCalculation("rsi", "BTC/USDT", "1h", "rsi_1h"); // Construct 1
      this.addCalculation("ema", "BTC/USDT", "1h", "ema_1h", { period: 20 }); // Construct 1
      this.addCalculation("macd", "BTC/USDT", "4h", "macd_4h"); // Construct 2
      this.addCalculation("ema", "ETH/USDT", "1d", "ema_1d", { period: 200 }, "bybit"); // Construct 3 + Override default exchange

      Parameters

      • indicator: string

        The indicator to calculate

      • symbol: string

        The symbol to calculate the indicator for

      • interval: string

        The interval to calculate the indicator for

      • id: string

        Your own unique ID of the calculation. This is used to identify the calculation in the result.

      • params: {}

        The parameters to pass to the calculation

        • exchangeId: string = ...

          The exchange to calculate the indicator for, defaults to what's defined in the system config

        Returns Promise<void>

      • Fetches the TAAPI.IO data for the calculations added to the bulk construct.

        Returns Promise<any>