TradeBench 1.0.0
Algorithmic Trading Backtesting Platform
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
App\Services\BinanceService Class Reference

Service providing external communication capabilities with the Binance REST API. More...

Public Member Functions

 fetchHistoricalData (string $symbol, string $interval, int $startTimeMs, int $endTimeMs, int $limit=1000)
 Fetches historical klines (candlesticks) from Binance.
 

Private Attributes

string $baseUrl = 'https://api.binance.com/api/v3/'
 

Detailed Description

Service providing external communication capabilities with the Binance REST API.

Member Function Documentation

◆ fetchHistoricalData()

App\Services\BinanceService::fetchHistoricalData ( string $symbol,
string $interval,
int $startTimeMs,
int $endTimeMs,
int $limit = 1000 )

Fetches historical klines (candlesticks) from Binance.

Parameters
string$symbolTrading pair identifier (e.g., 'BTCUSDT').
string$intervalCandlestick dimension (e.g., '1h', '15m').
int$startTimeMsUNIX Start time in milliseconds.
int$endTimeMsUNIX End time in milliseconds.
int$limitMaximum number of candles to return (Max 1000).
Returns
array Decoded JSON array of candlestick data.
Exceptions
ExceptionIf the cURL request fails or returns an invalid code.

Field Documentation

◆ $baseUrl

string App\Services\BinanceService::$baseUrl = 'https://api.binance.com/api/v3/'
private

The documentation for this class was generated from the following file: