增加交易策略、交易指标、量化库代码等文件夹

This commit is contained in:
Win_home
2025-04-27 15:54:09 +08:00
parent ca3b209096
commit f57150dae8
589 changed files with 854346 additions and 1757 deletions

View File

@@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "2d85dda4",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pandas as pd\n",
"import talib\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "65b4b7aa",
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_csv('D:/of_data/主力连续/tick生成的OF数据(5M)/data_rs_merged/上期所/ag888/ag888_rs_2021_5T_back_ofdata_dj.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "edd4f1e5",
"metadata": {},
"outputs": [],
"source": [
"df['HT_TRENDLINE'] = talib.HT_TRENDLINE(df['delta'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "25c70609",
"metadata": {},
"outputs": [],
"source": [
"df[['delta','HT_TRENDLINE']].plot(title = '希尔伯特瞬时变换')\n",
"plt.grid()\n",
"plt.legend(['delta','HT_TRENDLINE'])\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}