153 lines
19 KiB
Plaintext
153 lines
19 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"%matplotlib inline\n",
|
||
"\n",
|
||
"from datetime import datetime\n",
|
||
"\n",
|
||
"import numpy as np\n",
|
||
"import matplotlib.pyplot as plt\n",
|
||
"\n",
|
||
"from turtleEngine import BacktestingEngine"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"engine = BacktestingEngine()\n",
|
||
"engine.setPeriod(datetime(2015, 1, 1), datetime(2018, 11, 9))\n",
|
||
"engine.initPortfolio('setting.csv', 10000000)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 3,
|
||
"metadata": {
|
||
"scrolled": false
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"15:23:05.294000:IF99数据加载完成,总数据量:940\n",
|
||
"15:23:05.323000:I99数据加载完成,总数据量:940\n",
|
||
"15:23:05.348000:CU99数据加载完成,总数据量:940\n",
|
||
"15:23:05.375000:TA99数据加载完成,总数据量:940\n",
|
||
"15:23:05.375000:全部数据加载完成\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"engine.loadData()\n",
|
||
"engine.runBacktesting()\n",
|
||
"engine.calculateResult()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"scrolled": false
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"for dt, l in engine.tradeDict.items():\n",
|
||
" print dt\n",
|
||
" for trade in l:\n",
|
||
" print trade.vtSymbol, trade.direction, trade.offset, trade.price, trade.volume"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {
|
||
"scrolled": false
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"for result in engine.resultList:\n",
|
||
" if result.totalPnl:\n",
|
||
" print result.date, result.totalPnl"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 4,
|
||
"metadata": {
|
||
"scrolled": true
|
||
},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"[<matplotlib.lines.Line2D at 0x83b8a50>]"
|
||
]
|
||
},
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
},
|
||
{
|
||
"data": {
|
||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEDCAYAAAAhsS8XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl8nFW9x/HPmez7njZtku77TkNLC4W27IssggoooILAFQRR8VLBqwgigopwQRQQFJHlAmWRAkJLabHQlpbudN/TLWnS7Hvm3D9mMk3apNlmy+T7fr3y6rM/Z55Ofzk9zzm/Y6y1iIhI6HAEugAiIuJdCuwiIiFGgV1EJMQosIuIhBgFdhGREKPALiISYgIW2I0xzxpjCowx6ztw7CPGmNXuny3GmBJ/lFFEpCcygerHbow5HagAnrfWju3EeT8AJllrv+uzwomI9GABq7FbaxcDxc23GWOGGGPeN8asNMZ8YowZ2cqpVwEv+aWQIiI9UHigC3CMp4CbrbVbjTFTgT8Bs5t2GmMGAIOAjwJUPhGRoBc0gd0YEw9MB141xjRtjjrmsCuB16y1jf4sm4hITxI0gR1Xs1CJtXbiCY65ErjFT+UREemRgqa7o7W2DNhpjPkagHGZ0LTfGDMCSAE+C1ARRUR6hEB2d3wJV5AeYYzJN8ZcD3wTuN4YswbYAFzS7JSrgJet0lGKiJxQwLo7ioiIbwRNU4yIiH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zMY61xdEAAAAASUVORK5CYII=\n",
|
||
"text/plain": [
|
||
"<matplotlib.figure.Figure at 0x80a01d0>"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"output_type": "display_data"
|
||
}
|
||
],
|
||
"source": [
|
||
"l = [result.totalPnl for result in engine.resultList]\n",
|
||
"equity = np.cumsum(l)\n",
|
||
"plt.plot(equity)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 2",
|
||
"language": "python",
|
||
"name": "python2"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 2
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython2",
|
||
"version": "2.7.14"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 2
|
||
}
|