Connection
This handler integrates with the Binance API to make aggregate trade (kline) data available to use for model training and predictions. Since there are no parameters required to connect to Binance using MindsDB, you can use the below statement:Usage
Select Data
By default, aggregate data (klines) from the latest 1000 trading intervals with a length of one minute (1m) each will be returned.Response
Response
Here is the sample output data:where:
symbol
- Trading pair (BTC to USDT in the above example)open_time
- Start time of interval in seconds since the Unix epoch (default interval is 1m)open_price
- Price of a base asset at the beginning of a trading intervalhigh_price
- The highest price of a base asset during trading intervallow_price
- Lowest price of a base asset during a trading intervalclose_price
- Price of a base asset at the end of a trading intervalvolume
- Total amount of base asset traded during an intervalclose_time
- End time of interval in seconds since the Unix epochquote_asset_volume
- Total amount of quote asset (USDT in the above case) traded during an intervalnumber_of_trades
- Total number of trades made during an intervaltaker_buy_base_asset_volume
- How much of the base asset volume is contributed by taker buy orderstaker_buy_quote_asset_volume
- How much of the quote asset volume is contributed by taker buy orders
Supported intervals are listed here
Train a Model
Here is how to create a time series model using 10000 trading intervals in the past with a duration of 1m.For more accuracy, the limit can be set to a higher value (e.g. 100,000)