You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`symbol`|`str`| The symbol (e.g., `"BTC/USDT"`) for which data is downloaded. |
38
+
|`market`|`str`| (Optional) The market to download data from (e.g., `"binance"`). |
39
+
|`date`|`str`| (Optional) Specific date to retrieve data for. |
40
+
|`time_frame`|`str`| The time frame for data (e.g., `"1d"`, `"1h"`). |
41
+
|`data_type`|`str`| Type of data to retrieve: `"ohlcv"` (default) or`"ticker"`. |
42
+
|`start_date`|`str`| (Optional) Start of the date range to retrieve data. |
43
+
|`end_date`|`str`| (Optional) End of the date range. |
44
+
|`window_size`|`int`| Number of records to retrieve (default: 200). |
45
+
|`pandas`|`bool`| If `True`, returns a `pandas.DataFrame`; otherwise returns a `polars.DataFrame`. |
46
+
|`save`|`bool`| If `True`, saves the downloaded data to disk. |
47
+
|`storage_path`|`str`| (Optional) Path to store the data when save=True. Also used to load from disk if data already exists.|
48
48
49
49
50
50
## Returns
51
51
The function returns a DataFrame (pandas or polars) containing the requested market data, ready for analysis, visualization, or model training.
52
52
53
+
## How It Works with storage_path
54
+
When a storage_path is provided, the function first checks if the requested data already exists at the specified path. If the fileis found and readable, the function loads it directly from disk, avoiding unnecessary network calls. If not, it downloads the data and saves it to the path (ifsave=True).
55
+
56
+
This makes repeated experiments much faster and reduces API usage and rate-limiting issues.
57
+
53
58
## Why It's Useful?
54
59
This function streamlines the process of acquiring market data by:
55
60
* Automatically selecting the correct data provider
@@ -78,10 +83,3 @@ This enables quick preparation of time-series datasets for supervised learning t
0 commit comments