Add data retrieval and processing scripts for futures data

- Implemented a function to fetch futures data from the API with error handling and response validation.
- Added example usage for fetching and saving K-line data to CSV.
- Updated CSV files with new data entries for specified date ranges.
- Enhanced the structure of the data retrieval function to include parameters for depth and adjust type.
This commit is contained in:
2025-11-21 20:24:49 +08:00
parent 7ba84a6dd7
commit 800883b6ec
7 changed files with 1954 additions and 164 deletions

View File

@@ -88,10 +88,22 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 1,
"id": "65b4b7aa",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'ssquant.SQDATA'",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mssquant\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mSQDATA\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m TakeData\n\u001b[32m 2\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpandas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mas\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpd\u001b[39;00m\n",
"\u001b[31mModuleNotFoundError\u001b[39m: No module named 'ssquant.SQDATA'"
]
}
],
"source": [
"from ssquant.SQDATA import TakeData\n",
"import pandas as pd"
@@ -227,7 +239,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
@@ -241,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.13.2"
}
},
"nbformat": 4,