diff --git a/examples/TurtleStrategy/.ipynb_checkpoints/run-checkpoint.ipynb b/examples/TurtleStrategy/.ipynb_checkpoints/run-checkpoint.ipynb index 9247c6fb..57c7a353 100644 --- a/examples/TurtleStrategy/.ipynb_checkpoints/run-checkpoint.ipynb +++ b/examples/TurtleStrategy/.ipynb_checkpoints/run-checkpoint.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -18,686 +18,73 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": {}, + "execution_count": null, + "metadata": { + "scrolled": false + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "16:05:52.965000:\t投资组合的合约代码['IF99', 'I99', 'CU99', 'TA99']\n", - "16:05:52.966000:\t投资组合的初始价值10000000\n" + "投资组合的合约代码['IF99', 'I99', 'CU99', 'TA99']\n", + "投资组合的初始价值10000000\n", + "IF99数据加载完成,总数据量:1185\n", + "I99数据加载完成,总数据量:1185\n", + "CU99数据加载完成,总数据量:1185\n", + "TA99数据加载完成,总数据量:1185\n", + "全部数据加载完成\n", + "开始回放K线数据\n", + "K线数据回放结束\n", + "开始统计回测结果\n", + "------------------------------\n", + "首个交易日:\t2014-01-02 00:00:00\n", + "最后交易日:\t2018-11-09 00:00:00\n", + "总交易日:\t1185\n", + "盈利交易日\t523\n", + "亏损交易日:\t552\n", + "起始资金:\t10000000\n", + "结束资金:\t54,093,646.23\n", + "总收益率:\t440.94%\n", + "年化收益:\t37.23%\n", + "总盈亏:\t44,093,646.23\n", + "最大回撤: \t-7,822,360.7\n", + "百分比最大回撤: -18.09%\n", + "总手续费:\t607,834.31\n", + "总滑点:\t170,572.2\n", + "总成交笔数:\t571.0\n", + "日均盈亏:\t37,209.83\n", + "日均手续费:\t512.94\n", + "日均滑点:\t143.94\n", + "日均成交笔数:\t0.0\n", + "日均收益率:\t0.16%\n", + "收益标准差:\t1.6%\n", + "Sharpe Ratio:\t1.5\n" ] } ], "source": [ "engine = BacktestingEngine()\n", "engine.setPeriod(datetime(2014, 1, 1), datetime(2018, 12, 30))\n", - "engine.initPortfolio('test.csv', 10000000)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "scrolled": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "16:05:53.031000:\tIF99数据加载完成,总数据量:1185\n", - "16:05:53.064000:\tI99数据加载完成,总数据量:1185\n", - "16:05:53.096000:\tCU99数据加载完成,总数据量:1185\n", - "16:05:53.130000:\tTA99数据加载完成,总数据量:1185\n", - "16:05:53.131000:\t全部数据加载完成\n", - "16:05:53.131000:\t开始回放K线数据\n", - "16:05:53.383000:\tK线数据回放结束\n", - "16:05:53.383000:\t开始统计回测结果\n", - "16:05:53.392000:\t回测结果统计结束\n" - ] - } - ], - "source": [ + "engine.initPortfolio('setting.csv', 10000000)\n", + "\n", "engine.loadData()\n", "engine.runBacktesting()\n", - "engine.calculateResult()" + "engine.showResult()" ] }, { "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "44093646.23195201\n" - ] - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAEDCAYAAADDbTRuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl81NW9//HXyb5DgIQ97IssshhARLECKi7V1h2v1VZ7+dlq61Lbq12sta1ar/ttq6Vqq23daqtWsS4oomUVEJB9CQHCGgJZyD7J+f0xS2aSgUzCrMn7+XjkwXe+y8znZMhnzpzvWYy1FhERiU1xkQ5ARETaT0lcRCSGKYmLiMQwJXERkRimJC4iEsOUxEVEYljIkrgx5nljzCFjzPoAzn3cGLPG9bPVGFMaqrhERDoSE6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JXEQkhv1/vcSgaES5clcAAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "# 汇总每日盈亏,绘制简单资金曲线\n", - "l = [result.totalPnl for result in engine.resultList]\n", - "dateList = [result.date for result in engine.resultList]\n", - "equity = np.cumsum(l)\n", - "plt.plot(dateList, equity)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "scrolled": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2014-04-03 00:00:00 IF99 多 开仓 2175.2 8\n", - "2014-04-04 00:00:00 I99 多 开仓 803.5 52\n", - "2014-04-08 00:00:00 IF99 多 开仓 2195.8 8\n", - "2014-04-08 00:00:00 IF99 多 开仓 2216.2 8\n", - "2014-04-08 00:00:00 IF99 多 开仓 2236.8 8\n", - "2014-04-08 00:00:00 I99 多 开仓 813.5 52\n", - "2014-04-08 00:00:00 I99 多 开仓 823.0 52\n", - "2014-04-18 00:00:00 I99 空 平仓 784.5 156\n", - "2014-04-21 00:00:00 TA99 空 开仓 6272.0 240\n", - "2014-04-21 00:00:00 TA99 空 开仓 6230.0 240\n", - "2014-04-22 00:00:00 IF99 空 平仓 2165.2 32\n", - "2014-04-22 00:00:00 TA99 空 开仓 6190.0 240\n", - "2014-04-24 00:00:00 CU99 多 开仓 47260.0 30\n", - "2014-04-25 00:00:00 CU99 多 开仓 47590.0 30\n", - "2014-04-25 00:00:00 CU99 多 开仓 47930.0 30\n", - "2014-04-28 00:00:00 I99 空 开仓 758.0 58\n", - "2014-05-05 00:00:00 IF99 空 开仓 2130.0 9\n", - "2014-05-05 00:00:00 TA99 空 开仓 6148.0 240\n", - "2014-05-07 00:00:00 I99 空 开仓 749.5 58\n", - "2014-05-08 00:00:00 I99 空 开仓 740.5 58\n", - "2014-05-09 00:00:00 I99 空 开仓 732.0 58\n", - "2014-05-12 00:00:00 CU99 多 开仓 48260.0 30\n", - "2014-05-15 00:00:00 TA99 多 平仓 6240.0 960\n", - "2014-05-19 00:00:00 IF99 空 开仓 2111.8 9\n", - "2014-05-19 00:00:00 IF99 空 开仓 2093.4 9\n", - "2014-05-21 00:00:00 TA99 多 开仓 6324.0 252\n", - "2014-05-21 00:00:00 TA99 多 开仓 6364.0 252\n", - "2014-05-21 00:00:00 TA99 多 开仓 6402.0 252\n", - "2014-05-23 00:00:00 TA99 多 开仓 6442.0 252\n", - "2014-05-28 00:00:00 IF99 多 平仓 2166.8 27\n", - "2014-06-05 00:00:00 CU99 空 平仓 47860.0 120\n", - "2014-06-13 00:00:00 IF99 多 开仓 2176.2 11\n", - "2014-06-16 00:00:00 IF99 多 开仓 2191.6 11\n", - "2014-06-19 00:00:00 IF99 空 平仓 2129.6 22\n", - "2014-06-23 00:00:00 I99 多 平仓 693.0 232\n", - "2014-06-23 00:00:00 CU99 多 开仓 49310.0 38\n", - "2014-06-26 00:00:00 CU99 多 开仓 49570.0 38\n", - "2014-07-01 00:00:00 CU99 多 开仓 49830.0 38\n", - "2014-07-01 00:00:00 CU99 多 开仓 50090.0 38\n", - "2014-07-08 00:00:00 TA99 空 平仓 6986.0 1008\n", - "2014-07-21 00:00:00 I99 空 开仓 679.5 71\n", - "2014-07-22 00:00:00 IF99 多 开仓 2182.4 14\n", - "2014-07-22 00:00:00 IF99 多 开仓 2194.0 14\n", - "2014-07-23 00:00:00 IF99 多 开仓 2205.6 14\n", - "2014-07-23 00:00:00 I99 空 开仓 673.5 71\n", - "2014-07-24 00:00:00 IF99 多 开仓 2217.4 14\n", - "2014-07-24 00:00:00 I99 空 开仓 666.5 71\n", - "2014-08-05 00:00:00 I99 多 平仓 692.0 213\n", - "2014-08-12 00:00:00 I99 空 开仓 665.5 86\n", - "2014-08-14 00:00:00 I99 空 开仓 659.5 86\n", - "2014-08-14 00:00:00 I99 空 开仓 653.5 86\n", - "2014-08-14 00:00:00 CU99 空 平仓 49170.0 152\n", - "2014-08-14 00:00:00 TA99 空 开仓 7052.0 185\n", - "2014-08-15 00:00:00 TA99 空 开仓 6998.0 185\n", - "2014-08-18 00:00:00 TA99 空 开仓 6944.0 185\n", - "2014-08-18 00:00:00 TA99 空 开仓 6890.0 185\n", - "2014-08-20 00:00:00 I99 空 开仓 648.0 86\n", - "2014-08-26 00:00:00 IF99 空 平仓 2339.4 56\n", - "2014-09-03 00:00:00 IF99 多 开仓 2399.6 11\n", - "2014-09-03 00:00:00 IF99 多 开仓 2414.6 11\n", - "2014-09-04 00:00:00 IF99 多 开仓 2429.6 11\n", - "2014-09-04 00:00:00 IF99 多 开仓 2444.8 11\n", - "2014-09-10 00:00:00 CU99 空 开仓 48600.0 37\n", - "2014-09-11 00:00:00 CU99 空 开仓 48330.0 37\n", - "2014-09-17 00:00:00 CU99 多 平仓 49150.0 74\n", - "2014-09-22 00:00:00 IF99 空 平仓 2394.4 44\n", - "2014-09-22 00:00:00 CU99 空 开仓 47920.0 30\n", - "2014-09-22 00:00:00 CU99 空 开仓 47590.0 30\n", - "2014-09-25 00:00:00 IF99 多 开仓 2484.6 9\n", - "2014-10-14 00:00:00 I99 多 平仓 571.5 344\n", - "2014-10-17 00:00:00 IF99 空 平仓 2428.8 9\n", - "2014-10-17 00:00:00 CU99 空 开仓 46780.0 30\n", - "2014-10-24 00:00:00 TA99 多 平仓 5718.0 740\n", - "2014-10-27 00:00:00 IF99 空 开仓 2379.4 10\n", - "2014-10-29 00:00:00 IF99 多 平仓 2446.8 10\n", - "2014-10-30 00:00:00 CU99 多 平仓 47940.0 90\n", - "2014-10-31 00:00:00 IF99 多 开仓 2499.6 10\n", - "2014-10-31 00:00:00 IF99 多 开仓 2516.6 10\n", - "2014-11-05 00:00:00 CU99 空 开仓 46480.0 32\n", - "2014-11-07 00:00:00 IF99 多 开仓 2533.6 10\n", - "2014-11-07 00:00:00 IF99 多 开仓 2550.4 10\n", - "2014-11-13 00:00:00 TA99 多 开仓 5736.0 178\n", - "2014-11-19 00:00:00 TA99 多 开仓 5792.0 178\n", - "2014-11-24 00:00:00 CU99 多 平仓 47770.0 32\n", - "2014-11-27 00:00:00 CU99 空 开仓 46450.0 33\n", - "2014-11-28 00:00:00 CU99 空 开仓 46150.0 33\n", - "2014-11-28 00:00:00 CU99 空 开仓 45850.0 33\n", - "2014-11-28 00:00:00 TA99 空 平仓 5436.0 356\n", - "2014-12-01 00:00:00 CU99 空 开仓 45540.0 33\n", - "2014-12-01 00:00:00 TA99 空 开仓 5304.0 161\n", - "2014-12-01 00:00:00 TA99 空 开仓 5248.0 161\n", - "2014-12-08 00:00:00 TA99 空 开仓 5186.0 161\n", - "2014-12-09 00:00:00 TA99 空 开仓 5046.0 161\n", - "2015-01-19 00:00:00 IF99 空 平仓 3509.0 40\n", - "2015-01-21 00:00:00 TA99 多 平仓 4740.0 644\n", - "2015-01-26 00:00:00 I99 空 开仓 470.5 83\n", - "2015-01-26 00:00:00 I99 空 开仓 464.5 83\n", - "2015-02-13 00:00:00 I99 多 平仓 483.0 166\n", - "2015-02-13 00:00:00 CU99 多 平仓 41940.0 132\n", - "2015-03-05 00:00:00 I99 空 开仓 466.0 101\n", - "2015-03-05 00:00:00 I99 空 开仓 461.5 101\n", - "2015-03-06 00:00:00 I99 空 开仓 456.5 101\n", - "2015-03-06 00:00:00 I99 空 开仓 451.5 101\n", - "2015-03-13 00:00:00 IF99 多 开仓 3659.2 3\n", - "2015-03-16 00:00:00 IF99 多 开仓 3707.0 3\n", - "2015-03-16 00:00:00 TA99 空 开仓 4704.0 194\n", - "2015-03-16 00:00:00 TA99 空 开仓 4652.0 194\n", - "2015-03-17 00:00:00 IF99 多 开仓 3761.4 3\n", - "2015-03-18 00:00:00 IF99 多 开仓 3806.2 3\n", - "2015-03-23 00:00:00 CU99 多 开仓 43260.0 28\n", - "2015-03-23 00:00:00 CU99 多 开仓 43620.0 28\n", - "2015-03-23 00:00:00 CU99 多 开仓 43990.0 28\n", - "2015-03-24 00:00:00 CU99 多 开仓 44350.0 28\n", - "2015-03-24 00:00:00 TA99 多 平仓 4858.0 388\n", - "2015-03-30 00:00:00 TA99 空 开仓 4630.0 181\n", - "2015-04-02 00:00:00 TA99 空 开仓 4576.0 181\n", - "2015-04-07 00:00:00 TA99 多 平仓 4822.0 362\n", - "2015-04-08 00:00:00 TA99 多 开仓 4922.0 183\n", - "2015-04-08 00:00:00 TA99 多 开仓 4978.0 183\n", - "2015-04-09 00:00:00 CU99 空 平仓 43060.0 112\n", - "2015-04-14 00:00:00 TA99 多 开仓 5086.0 183\n", - "2015-04-17 00:00:00 I99 多 平仓 401.0 404\n", - "2015-04-28 00:00:00 CU99 多 开仓 44090.0 30\n", - "2015-05-04 00:00:00 CU99 多 开仓 45320.0 30\n", - "2015-05-04 00:00:00 CU99 多 开仓 45320.0 30\n", - "2015-05-06 00:00:00 IF99 空 平仓 4531.2 12\n", - "2015-05-06 00:00:00 I99 多 开仓 437.0 77\n", - "2015-05-06 00:00:00 I99 多 开仓 443.5 77\n", - "2015-05-15 00:00:00 I99 空 平仓 417.5 154\n", - "2015-05-18 00:00:00 TA99 空 平仓 5256.0 549\n", - "2015-05-20 00:00:00 CU99 空 平仓 45310.0 90\n", - "2015-06-08 00:00:00 IF99 多 开仓 5370.6 2\n", - "2015-06-10 00:00:00 I99 多 开仓 444.0 91\n", - "2015-06-11 00:00:00 I99 多 开仓 449.5 91\n", - "2015-06-12 00:00:00 CU99 空 开仓 42550.0 36\n", - "2015-06-15 00:00:00 CU99 空 开仓 42280.0 36\n", - "2015-06-16 00:00:00 CU99 空 开仓 42000.0 36\n", - "2015-06-17 00:00:00 IF99 空 平仓 4994.8 2\n", - "2015-06-17 00:00:00 I99 空 平仓 429.5 182\n", - "2015-06-17 00:00:00 CU99 空 开仓 41730.0 36\n", - "2015-06-19 00:00:00 IF99 空 开仓 4711.2 2\n", - "2015-06-19 00:00:00 IF99 空 开仓 4617.0 2\n", - "2015-06-23 00:00:00 IF99 空 开仓 4522.8 2\n", - "2015-06-25 00:00:00 IF99 多 平仓 4899.8 6\n", - "2015-06-26 00:00:00 IF99 空 开仓 4464.6 2\n", - "2015-06-26 00:00:00 IF99 空 开仓 4358.6 2\n", - "2015-06-26 00:00:00 IF99 空 开仓 4252.6 2\n", - "2015-06-29 00:00:00 IF99 空 开仓 4146.6 2\n", - "2015-06-30 00:00:00 I99 空 开仓 419.5 94\n", - "2015-06-30 00:00:00 I99 空 开仓 414.5 94\n", - "2015-07-29 00:00:00 I99 多 平仓 378.5 188\n", - "2015-08-10 00:00:00 IF99 多 平仓 3991.2 8\n", - "2015-08-24 00:00:00 IF99 空 开仓 3272.8 1\n", - "2015-08-24 00:00:00 IF99 空 开仓 3160.8 1\n", - "2015-08-25 00:00:00 IF99 空 开仓 3034.0 1\n", - "2015-08-25 00:00:00 IF99 空 开仓 2936.4 1\n", - "2015-08-25 00:00:00 I99 空 开仓 358.5 91\n", - "2015-08-25 00:00:00 TA99 空 开仓 4310.0 195\n", - "2015-08-28 00:00:00 I99 多 平仓 380.0 91\n", - "2015-08-28 00:00:00 TA99 多 平仓 4472.0 195\n", - "2015-09-09 00:00:00 I99 多 开仓 394.5 89\n", - "2015-09-09 00:00:00 CU99 多 平仓 39960.0 144\n", - "2015-09-10 00:00:00 I99 多 开仓 400.0 89\n", - "2015-09-10 00:00:00 I99 多 开仓 405.5 89\n", - "2015-09-11 00:00:00 I99 多 开仓 411.0 89\n", - "2015-09-15 00:00:00 I99 空 平仓 389.0 356\n", - "2015-09-29 00:00:00 I99 空 开仓 358.0 89\n", - "2015-09-29 00:00:00 I99 空 开仓 354.0 89\n", - "2015-09-29 00:00:00 CU99 空 开仓 37780.0 26\n", - "2015-09-29 00:00:00 CU99 空 开仓 37780.0 26\n", - "2015-10-08 00:00:00 CU99 多 平仓 39370.0 52\n", - "2015-10-08 00:00:00 TA99 多 开仓 4726.0 202\n", - "2015-10-09 00:00:00 I99 多 平仓 376.5 178\n", - "2015-10-09 00:00:00 TA99 多 开仓 4776.0 202\n", - "2015-10-12 00:00:00 IF99 多 平仓 3341.0 4\n", - "2015-10-22 00:00:00 TA99 空 平仓 4604.0 404\n", - "2015-10-27 00:00:00 I99 空 开仓 353.0 107\n", - "2015-10-28 00:00:00 I99 空 开仓 348.5 107\n", - "2015-11-03 00:00:00 I99 空 开仓 343.5 107\n", - "2015-11-03 00:00:00 I99 空 开仓 339.0 107\n", - "2015-11-05 00:00:00 CU99 空 开仓 38240.0 31\n", - "2015-11-06 00:00:00 CU99 空 开仓 37920.0 31\n", - "2015-11-09 00:00:00 CU99 空 开仓 37600.0 31\n", - "2015-11-10 00:00:00 CU99 空 开仓 37280.0 31\n", - "2015-11-16 00:00:00 TA99 空 开仓 4548.0 231\n", - "2015-11-16 00:00:00 TA99 空 开仓 4506.0 231\n", - "2015-11-26 00:00:00 TA99 多 平仓 4632.0 462\n", - "2015-12-08 00:00:00 TA99 空 开仓 4426.0 231\n", - "2015-12-08 00:00:00 TA99 空 开仓 4382.0 231\n", - "2015-12-11 00:00:00 CU99 多 平仓 35630.0 124\n", - "2015-12-18 00:00:00 I99 多 平仓 298.5 428\n", - "2015-12-21 00:00:00 IF99 多 开仓 3786.6 4\n", - "2015-12-23 00:00:00 IF99 多 开仓 3831.8 4\n", - "2015-12-28 00:00:00 IF99 空 平仓 3650.4 8\n", - "2015-12-30 00:00:00 TA99 多 平仓 4444.0 462\n", - "2016-01-04 00:00:00 IF99 空 开仓 3504.4 4\n", - "2016-01-04 00:00:00 IF99 空 开仓 3460.4 4\n", - "2016-01-04 00:00:00 IF99 空 开仓 3416.4 4\n", - "2016-01-05 00:00:00 IF99 空 开仓 3372.6 4\n", - "2016-01-11 00:00:00 CU99 空 开仓 34850.0 30\n", - "2016-01-12 00:00:00 TA99 空 开仓 4252.0 286\n", - "2016-01-14 00:00:00 CU99 空 开仓 34520.0 30\n", - "2016-01-18 00:00:00 TA99 空 开仓 4206.0 286\n", - "2016-01-19 00:00:00 TA99 多 平仓 4346.0 572\n", - "2016-01-27 00:00:00 CU99 多 平仓 35560.0 60\n", - "2016-02-01 00:00:00 I99 多 开仓 326.5 128\n", - "2016-02-04 00:00:00 I99 多 开仓 330.0 128\n", - "2016-02-04 00:00:00 I99 多 开仓 334.0 128\n", - "2016-02-04 00:00:00 CU99 多 开仓 36540.0 34\n", - "2016-02-15 00:00:00 TA99 多 开仓 4440.0 307\n", - "2016-02-17 00:00:00 IF99 多 平仓 2969.2 16\n", - "2016-02-18 00:00:00 I99 多 开仓 338.0 128\n", - "2016-02-19 00:00:00 TA99 多 开仓 4472.0 307\n", - "2016-02-26 00:00:00 TA99 空 平仓 4384.0 614\n", - "2016-03-01 00:00:00 TA99 多 开仓 4500.0 331\n", - "2016-03-01 00:00:00 TA99 多 开仓 4530.0 331\n", - "2016-03-01 00:00:00 TA99 多 开仓 4560.0 331\n", - "2016-03-02 00:00:00 CU99 多 开仓 36840.0 34\n", - "2016-03-02 00:00:00 TA99 多 开仓 4592.0 331\n", - "2016-03-28 00:00:00 I99 空 平仓 389.0 512\n", - "2016-03-30 00:00:00 CU99 空 平仓 37130.0 68\n", - "2016-04-13 00:00:00 IF99 多 开仓 3245.2 4\n", - "2016-04-20 00:00:00 IF99 空 平仓 3093.8 4\n", - "2016-04-20 00:00:00 I99 多 开仓 436.5 66\n", - "2016-04-20 00:00:00 I99 多 开仓 444.0 66\n", - "2016-04-20 00:00:00 I99 多 开仓 451.5 66\n", - "2016-04-21 00:00:00 I99 多 开仓 459.5 66\n", - "2016-04-22 00:00:00 CU99 多 开仓 38380.0 33\n", - "2016-04-22 00:00:00 CU99 多 开仓 38550.0 33\n", - "2016-04-26 00:00:00 CU99 空 平仓 37630.0 66\n", - "2016-04-27 00:00:00 I99 空 平仓 429.0 264\n", - "2016-05-06 00:00:00 TA99 空 平仓 4802.0 1324\n", - "2016-05-10 00:00:00 I99 空 开仓 378.0 49\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2016-05-13 00:00:00 I99 空 开仓 368.0 49\n", - "2016-05-13 00:00:00 I99 空 开仓 358.0 49\n", - "2016-05-13 00:00:00 CU99 空 开仓 35690.0 31\n", - "2016-05-13 00:00:00 CU99 空 开仓 35360.0 31\n", - "2016-05-20 00:00:00 CU99 空 开仓 35040.0 31\n", - "2016-05-23 00:00:00 I99 空 开仓 348.0 49\n", - "2016-05-23 00:00:00 TA99 空 开仓 4552.0 187\n", - "2016-05-31 00:00:00 IF99 空 开仓 2905.2 6\n", - "2016-05-31 00:00:00 IF99 空 开仓 2878.0 6\n", - "2016-06-01 00:00:00 IF99 多 平仓 3137.8 12\n", - "2016-06-03 00:00:00 IF99 多 开仓 3165.6 5\n", - "2016-06-06 00:00:00 CU99 多 平仓 36210.0 93\n", - "2016-06-07 00:00:00 I99 多 平仓 359.5 196\n", - "2016-06-13 00:00:00 IF99 空 平仓 3033.8 5\n", - "2016-06-14 00:00:00 TA99 多 平仓 4758.0 187\n", - "2016-06-20 00:00:00 TA99 多 开仓 4806.0 212\n", - "2016-06-23 00:00:00 CU99 多 开仓 36300.0 35\n", - "2016-06-24 00:00:00 CU99 多 开仓 36580.0 35\n", - "2016-06-28 00:00:00 CU99 多 开仓 36860.0 35\n", - "2016-06-28 00:00:00 CU99 多 开仓 37140.0 35\n", - "2016-06-29 00:00:00 TA99 多 开仓 4854.0 212\n", - "2016-07-04 00:00:00 TA99 多 开仓 4900.0 212\n", - "2016-07-06 00:00:00 TA99 空 平仓 4712.0 636\n", - "2016-07-07 00:00:00 IF99 多 开仓 3166.6 6\n", - "2016-07-11 00:00:00 IF99 多 开仓 3194.4 6\n", - "2016-07-12 00:00:00 IF99 多 开仓 3222.4 6\n", - "2016-07-13 00:00:00 IF99 多 开仓 3250.4 6\n", - "2016-07-19 00:00:00 TA99 空 开仓 4672.0 204\n", - "2016-07-27 00:00:00 IF99 空 平仓 3173.6 24\n", - "2016-07-28 00:00:00 I99 多 开仓 451.5 59\n", - "2016-07-28 00:00:00 CU99 空 平仓 37640.0 140\n", - "2016-07-29 00:00:00 TA99 空 开仓 4622.0 204\n", - "2016-07-29 00:00:00 TA99 空 开仓 4574.0 204\n", - "2016-08-01 00:00:00 I99 多 开仓 460.0 59\n", - "2016-08-05 00:00:00 I99 多 开仓 468.5 59\n", - "2016-08-08 00:00:00 I99 多 开仓 477.5 59\n", - "2016-08-09 00:00:00 TA99 多 平仓 4758.0 612\n", - "2016-08-11 00:00:00 IF99 多 开仓 3245.6 7\n", - "2016-08-11 00:00:00 I99 空 平仓 443.0 236\n", - "2016-08-12 00:00:00 IF99 多 开仓 3268.6 7\n", - "2016-08-12 00:00:00 TA99 多 开仓 4806.0 245\n", - "2016-08-15 00:00:00 IF99 多 开仓 3291.4 7\n", - "2016-08-15 00:00:00 IF99 多 开仓 3314.4 7\n", - "2016-08-17 00:00:00 TA99 多 开仓 4846.0 245\n", - "2016-08-17 00:00:00 TA99 多 开仓 4886.0 245\n", - "2016-08-25 00:00:00 TA99 空 平仓 4732.0 735\n", - "2016-08-29 00:00:00 I99 空 开仓 424.0 60\n", - "2016-08-29 00:00:00 I99 空 开仓 416.0 60\n", - "2016-08-31 00:00:00 I99 空 开仓 407.5 60\n", - "2016-09-08 00:00:00 I99 空 开仓 399.5 60\n", - "2016-09-12 00:00:00 IF99 空 平仓 3227.8 28\n", - "2016-09-14 00:00:00 IF99 空 开仓 3189.8 8\n", - "2016-09-21 00:00:00 CU99 多 开仓 37410.0 47\n", - "2016-09-22 00:00:00 CU99 多 开仓 37620.0 47\n", - "2016-09-23 00:00:00 CU99 多 开仓 37840.0 47\n", - "2016-09-28 00:00:00 TA99 空 开仓 4702.0 312\n", - "2016-09-29 00:00:00 I99 多 平仓 414.5 240\n", - "2016-10-10 00:00:00 IF99 多 平仓 3260.4 8\n", - "2016-10-11 00:00:00 CU99 多 开仓 38050.0 47\n", - "2016-10-11 00:00:00 TA99 多 平仓 4816.0 312\n", - "2016-10-14 00:00:00 I99 多 开仓 422.0 78\n", - "2016-10-14 00:00:00 I99 多 开仓 428.5 78\n", - "2016-10-14 00:00:00 I99 多 开仓 435.0 78\n", - "2016-10-14 00:00:00 CU99 空 平仓 37230.0 188\n", - "2016-10-19 00:00:00 IF99 多 开仓 3294.2 9\n", - "2016-10-19 00:00:00 I99 多 开仓 441.0 78\n", - "2016-10-20 00:00:00 TA99 多 开仓 4852.0 315\n", - "2016-10-20 00:00:00 TA99 多 开仓 4882.0 315\n", - "2016-10-20 00:00:00 TA99 多 开仓 4914.0 315\n", - "2016-10-20 00:00:00 TA99 多 开仓 4946.0 315\n", - "2016-10-24 00:00:00 IF99 多 开仓 3312.8 9\n", - "2016-11-03 00:00:00 TA99 空 平仓 4834.0 1260\n", - "2016-11-10 00:00:00 TA99 多 开仓 5010.0 277\n", - "2016-11-10 00:00:00 TA99 多 开仓 5046.0 277\n", - "2016-11-11 00:00:00 TA99 多 开仓 5082.0 277\n", - "2016-11-11 00:00:00 TA99 多 开仓 5118.0 277\n", - "2016-11-14 00:00:00 TA99 空 平仓 4974.0 1108\n", - "2016-12-07 00:00:00 IF99 空 平仓 3433.0 18\n", - "2016-12-09 00:00:00 TA99 多 开仓 5402.0 215\n", - "2016-12-09 00:00:00 TA99 多 开仓 5448.0 215\n", - "2016-12-12 00:00:00 TA99 多 开仓 5496.0 215\n", - "2016-12-12 00:00:00 TA99 多 开仓 5542.0 215\n", - "2016-12-19 00:00:00 I99 空 平仓 568.0 312\n", - "2016-12-20 00:00:00 TA99 空 平仓 5356.0 860\n", - "2017-01-13 00:00:00 CU99 多 开仓 47310.0 19\n", - "2017-01-13 00:00:00 CU99 多 开仓 47840.0 19\n", - "2017-01-16 00:00:00 IF99 空 开仓 3220.6 9\n", - "2017-01-16 00:00:00 IF99 空 开仓 3202.0 9\n", - "2017-01-16 00:00:00 I99 多 开仓 612.5 37\n", - "2017-01-16 00:00:00 I99 多 开仓 626.0 37\n", - "2017-01-16 00:00:00 I99 多 开仓 639.5 37\n", - "2017-01-16 00:00:00 CU99 多 开仓 48370.0 19\n", - "2017-01-17 00:00:00 IF99 多 平仓 3277.0 18\n", - "2017-01-17 00:00:00 I99 多 开仓 653.5 37\n", - "2017-01-18 00:00:00 CU99 空 平仓 46240.0 57\n", - "2017-01-20 00:00:00 IF99 多 开仓 3352.0 8\n", - "2017-01-23 00:00:00 IF99 多 开仓 3372.2 8\n", - "2017-01-23 00:00:00 I99 空 平仓 598.5 148\n", - "2017-01-23 00:00:00 TA99 多 开仓 5540.0 205\n", - "2017-01-24 00:00:00 TA99 多 开仓 5588.0 205\n", - "2017-01-25 00:00:00 TA99 多 开仓 5636.0 205\n", - "2017-01-25 00:00:00 TA99 多 开仓 5686.0 205\n", - "2017-02-10 00:00:00 IF99 多 开仓 3392.2 8\n", - "2017-02-10 00:00:00 I99 多 开仓 658.0 34\n", - "2017-02-10 00:00:00 I99 多 开仓 673.0 34\n", - "2017-02-13 00:00:00 I99 多 开仓 687.5 34\n", - "2017-02-20 00:00:00 TA99 空 平仓 5662.0 820\n", - "2017-03-03 00:00:00 IF99 空 平仓 3383.4 24\n", - "2017-03-03 00:00:00 I99 空 平仓 659.5 102\n", - "2017-03-09 00:00:00 I99 空 开仓 625.0 36\n", - "2017-03-09 00:00:00 CU99 空 开仓 47120.0 22\n", - "2017-03-09 00:00:00 CU99 空 开仓 46670.0 22\n", - "2017-03-09 00:00:00 TA99 空 开仓 5244.0 206\n", - "2017-03-10 00:00:00 CU99 空 开仓 46210.0 22\n", - "2017-03-10 00:00:00 TA99 空 开仓 5190.0 206\n", - "2017-03-10 00:00:00 TA99 空 开仓 5146.0 206\n", - "2017-03-13 00:00:00 TA99 空 开仓 5098.0 206\n", - "2017-03-15 00:00:00 I99 多 平仓 680.5 36\n", - "2017-03-16 00:00:00 CU99 多 平仓 48040.0 66\n", - "2017-03-22 00:00:00 I99 空 开仓 612.0 36\n", - "2017-03-24 00:00:00 IF99 多 开仓 3456.6 10\n", - "2017-03-24 00:00:00 IF99 多 开仓 3473.2 10\n", - "2017-03-24 00:00:00 I99 空 开仓 594.5 36\n", - "2017-03-27 00:00:00 I99 空 开仓 584.5 36\n", - "2017-03-27 00:00:00 I99 空 开仓 570.5 36\n", - "2017-03-28 00:00:00 CU99 空 开仓 46180.0 23\n", - "2017-03-30 00:00:00 IF99 空 平仓 3407.0 20\n", - "2017-03-30 00:00:00 CU99 多 平仓 47920.0 23\n", - "2017-04-05 00:00:00 IF99 多 开仓 3474.4 10\n", - "2017-04-05 00:00:00 IF99 多 开仓 3491.0 10\n", - "2017-04-11 00:00:00 IF99 多 开仓 3509.2 10\n", - "2017-04-13 00:00:00 CU99 空 开仓 45750.0 23\n", - "2017-04-17 00:00:00 IF99 空 平仓 3442.2 30\n", - "2017-04-17 00:00:00 CU99 多 平仓 47520.0 23\n", - "2017-04-19 00:00:00 CU99 空 开仓 45640.0 21\n", - "2017-04-20 00:00:00 CU99 空 开仓 45170.0 21\n", - "2017-04-28 00:00:00 I99 多 平仓 515.5 144\n", - "2017-05-02 00:00:00 CU99 多 平仓 47060.0 42\n", - "2017-05-04 00:00:00 IF99 空 开仓 3371.6 10\n", - "2017-05-05 00:00:00 IF99 空 开仓 3355.4 10\n", - "2017-05-05 00:00:00 IF99 空 开仓 3339.0 10\n", - "2017-05-05 00:00:00 CU99 空 开仓 44900.0 23\n", - "2017-05-16 00:00:00 IF99 多 平仓 3404.4 30\n", - "2017-05-22 00:00:00 CU99 多 平仓 45730.0 23\n", - "2017-05-23 00:00:00 TA99 多 平仓 5034.0 824\n", - "2017-05-25 00:00:00 IF99 多 开仓 3433.6 10\n", - "2017-05-25 00:00:00 IF99 多 开仓 3449.8 10\n", - "2017-05-25 00:00:00 IF99 多 开仓 3466.0 10\n", - "2017-05-26 00:00:00 IF99 多 开仓 3482.2 10\n", - "2017-05-31 00:00:00 I99 空 开仓 439.0 46\n", - "2017-05-31 00:00:00 I99 空 开仓 428.5 46\n", - "2017-06-01 00:00:00 I99 空 开仓 417.5 46\n", - "2017-06-01 00:00:00 TA99 空 开仓 4774.0 249\n", - "2017-06-12 00:00:00 CU99 多 开仓 46440.0 31\n", - "2017-06-13 00:00:00 TA99 多 平仓 4934.0 249\n", - "2017-06-23 00:00:00 CU99 多 开仓 46760.0 31\n", - "2017-06-27 00:00:00 I99 多 平仓 437.5 138\n", - "2017-06-28 00:00:00 I99 多 开仓 455.5 60\n", - "2017-06-28 00:00:00 CU99 多 开仓 47080.0 31\n", - "2017-06-29 00:00:00 I99 多 开仓 464.0 60\n", - "2017-06-29 00:00:00 I99 多 开仓 472.0 60\n", - "2017-08-11 00:00:00 IF99 空 平仓 3657.0 40\n", - "2017-08-15 00:00:00 I99 空 平仓 526.5 180\n", - "2017-09-04 00:00:00 TA99 多 开仓 5410.0 258\n", - "2017-09-08 00:00:00 CU99 空 平仓 52050.0 93\n", - "2017-09-11 00:00:00 I99 空 开仓 520.0 41\n", - "2017-09-11 00:00:00 TA99 空 平仓 5254.0 258\n", - "2017-09-14 00:00:00 I99 空 开仓 508.0 41\n", - "2017-09-18 00:00:00 I99 空 开仓 496.0 41\n", - "2017-09-21 00:00:00 I99 空 开仓 484.0 41\n", - "2017-09-28 00:00:00 TA99 空 开仓 5194.0 266\n", - "2017-09-28 00:00:00 TA99 空 开仓 5156.0 266\n", - "2017-09-28 00:00:00 TA99 空 开仓 5118.0 266\n", - "2017-10-09 00:00:00 TA99 空 开仓 5082.0 266\n", - "2017-10-13 00:00:00 CU99 多 开仓 53520.0 26\n", - "2017-10-16 00:00:00 CU99 多 开仓 53900.0 26\n", - "2017-10-16 00:00:00 CU99 多 开仓 54290.0 26\n", - "2017-10-16 00:00:00 CU99 多 开仓 54680.0 26\n", - "2017-10-20 00:00:00 I99 多 平仓 468.0 164\n", - "2017-10-30 00:00:00 TA99 多 平仓 5230.0 1064\n", - "2017-11-06 00:00:00 TA99 多 开仓 5244.0 320\n", - "2017-11-06 00:00:00 TA99 多 开仓 5274.0 320\n", - "2017-11-06 00:00:00 TA99 多 开仓 5306.0 320\n", - "2017-11-07 00:00:00 TA99 多 开仓 5338.0 320\n", - "2017-11-09 00:00:00 CU99 空 平仓 53470.0 104\n", - "2017-11-15 00:00:00 CU99 空 开仓 53280.0 22\n", - "2017-11-28 00:00:00 TA99 空 平仓 5388.0 1280\n", - "2017-11-30 00:00:00 CU99 空 开仓 52820.0 22\n", - "2017-12-04 00:00:00 I99 多 开仓 551.0 62\n", - "2017-12-04 00:00:00 TA99 多 开仓 5568.0 249\n", - "2017-12-06 00:00:00 CU99 空 开仓 52360.0 22\n", - "2017-12-06 00:00:00 CU99 空 开仓 51910.0 22\n", - "2017-12-07 00:00:00 I99 空 平仓 518.5 62\n", - "2017-12-07 00:00:00 TA99 空 平仓 5408.0 249\n", - "2017-12-14 00:00:00 TA99 空 开仓 5340.0 248\n", - "2017-12-18 00:00:00 CU99 多 平仓 53730.0 88\n", - "2017-12-25 00:00:00 IF99 多 开仓 4103.6 6\n", - "2017-12-25 00:00:00 CU99 多 开仓 55000.0 25\n", - "2017-12-25 00:00:00 CU99 多 开仓 55400.0 25\n", - "2017-12-26 00:00:00 TA99 多 平仓 5444.0 248\n", - "2017-12-27 00:00:00 IF99 空 平仓 3996.6 6\n", - "2017-12-28 00:00:00 CU99 多 开仓 55790.0 25\n", - "2018-01-02 00:00:00 IF99 多 开仓 4105.4 6\n", - "2018-01-03 00:00:00 IF99 多 开仓 4132.2 6\n", - "2018-01-03 00:00:00 TA99 多 开仓 5584.0 295\n", - "2018-01-04 00:00:00 TA99 多 开仓 5618.0 295\n", - "2018-01-04 00:00:00 TA99 多 开仓 5652.0 295\n", - "2018-01-08 00:00:00 IF99 多 开仓 4159.0 6\n", - "2018-01-08 00:00:00 I99 多 开仓 553.0 57\n", - "2018-01-12 00:00:00 CU99 空 平仓 54580.0 75\n", - "2018-01-22 00:00:00 CU99 空 开仓 53650.0 29\n", - "2018-01-23 00:00:00 I99 空 平仓 526.5 57\n", - "2018-01-24 00:00:00 CU99 空 开仓 53190.0 29\n", - "2018-01-24 00:00:00 CU99 空 开仓 52960.0 29\n", - "2018-01-25 00:00:00 CU99 多 平仓 54340.0 87\n", - "2018-01-29 00:00:00 I99 空 开仓 517.0 65\n", - "2018-01-31 00:00:00 I99 空 开仓 509.0 65\n", - "2018-02-01 00:00:00 IF99 空 平仓 4253.2 18\n", - "2018-02-06 00:00:00 TA99 空 平仓 5630.0 885\n", - "2018-02-08 00:00:00 CU99 空 开仓 52780.0 27\n", - "2018-02-08 00:00:00 CU99 空 开仓 52410.0 27\n", - "2018-02-08 00:00:00 CU99 空 开仓 52050.0 27\n", - "2018-02-09 00:00:00 IF99 空 开仓 3937.4 5\n", - "2018-02-09 00:00:00 IF99 空 开仓 3902.4 5\n", - "2018-02-09 00:00:00 IF99 空 开仓 3867.4 5\n", - "2018-02-09 00:00:00 IF99 空 开仓 3832.4 5\n", - "2018-02-09 00:00:00 I99 多 平仓 533.0 130\n", - "2018-02-09 00:00:00 CU99 空 开仓 51680.0 27\n", - "2018-02-22 00:00:00 IF99 多 平仓 4010.2 20\n", - "2018-02-22 00:00:00 CU99 多 平仓 53270.0 108\n", - "2018-02-23 00:00:00 I99 多 开仓 549.0 75\n", - "2018-02-26 00:00:00 I99 多 开仓 556.0 75\n", - "2018-02-26 00:00:00 TA99 多 开仓 5788.0 291\n", - "2018-02-27 00:00:00 TA99 多 开仓 5822.0 291\n", - "2018-03-05 00:00:00 I99 空 平仓 529.0 150\n", - "2018-03-07 00:00:00 TA99 空 平仓 5684.0 582\n", - "2018-03-08 00:00:00 I99 空 开仓 506.5 79\n", - "2018-03-09 00:00:00 I99 空 开仓 500.0 79\n", - "2018-03-09 00:00:00 I99 空 开仓 493.5 79\n", - "2018-03-09 00:00:00 I99 空 开仓 487.5 79\n", - "2018-03-09 00:00:00 TA99 空 开仓 5570.0 290\n", - "2018-03-09 00:00:00 TA99 空 开仓 5536.0 290\n", - "2018-03-16 00:00:00 TA99 空 开仓 5502.0 290\n", - "2018-03-20 00:00:00 TA99 空 开仓 5468.0 290\n", - "2018-03-21 00:00:00 CU99 空 开仓 51250.0 27\n", - "2018-03-21 00:00:00 CU99 空 开仓 50890.0 27\n", - "2018-04-10 00:00:00 CU99 多 平仓 51280.0 54\n", - "2018-04-17 00:00:00 IF99 空 开仓 3740.8 5\n", - "2018-04-17 00:00:00 TA99 多 平仓 5500.0 1160\n", - "2018-04-18 00:00:00 IF99 空 开仓 3704.4 5\n", - "2018-04-19 00:00:00 I99 多 平仓 461.0 316\n", - "2018-04-19 00:00:00 CU99 多 开仓 52020.0 27\n", - "2018-04-19 00:00:00 CU99 多 开仓 52260.0 27\n", - "2018-05-08 00:00:00 IF99 多 平仓 3832.8 10\n", - "2018-05-09 00:00:00 CU99 空 平仓 51040.0 54\n", - "2018-05-15 00:00:00 TA99 多 开仓 5836.0 302\n", - "2018-05-16 00:00:00 TA99 多 开仓 5870.0 302\n", - "2018-05-16 00:00:00 TA99 多 开仓 5902.0 302\n", - "2018-05-21 00:00:00 IF99 多 开仓 3922.2 6\n", - "2018-05-22 00:00:00 TA99 空 平仓 5770.0 906\n", - "2018-05-23 00:00:00 I99 空 开仓 451.0 75\n", - "2018-05-23 00:00:00 CU99 多 开仓 52370.0 34\n", - "2018-05-24 00:00:00 IF99 空 平仓 3822.0 6\n", - "2018-05-30 00:00:00 IF99 空 开仓 3714.2 6\n", - "2018-05-30 00:00:00 CU99 空 平仓 51190.0 34\n", - "2018-06-04 00:00:00 CU99 多 开仓 52470.0 33\n", - "2018-06-05 00:00:00 CU99 多 开仓 52780.0 33\n", - "2018-06-06 00:00:00 I99 多 平仓 469.5 75\n", - "2018-06-06 00:00:00 CU99 多 开仓 53080.0 33\n", - "2018-06-06 00:00:00 CU99 多 开仓 53380.0 33\n", - "2018-06-07 00:00:00 IF99 多 平仓 3827.6 6\n", - "2018-06-19 00:00:00 IF99 空 开仓 3667.4 6\n", - "2018-06-19 00:00:00 IF99 空 开仓 3659.2 6\n", - "2018-06-19 00:00:00 IF99 空 开仓 3631.0 6\n", - "2018-06-19 00:00:00 IF99 空 开仓 3602.8 6\n", - "2018-06-19 00:00:00 I99 空 开仓 446.5 87\n", - "2018-06-19 00:00:00 CU99 空 平仓 52170.0 132\n", - "2018-06-25 00:00:00 I99 多 平仓 469.5 87\n", - "2018-06-28 00:00:00 TA99 多 开仓 5822.0 296\n", - "2018-07-02 00:00:00 CU99 空 开仓 51370.0 32\n", - "2018-07-03 00:00:00 TA99 多 开仓 5854.0 296\n", - "2018-07-04 00:00:00 CU99 空 开仓 51050.0 32\n", - "2018-07-04 00:00:00 CU99 空 开仓 50740.0 32\n", - "2018-07-04 00:00:00 CU99 空 开仓 50430.0 32\n", - "2018-07-09 00:00:00 TA99 多 开仓 5888.0 296\n", - "2018-07-12 00:00:00 IF99 多 平仓 3476.2 24\n", - "2018-07-19 00:00:00 TA99 多 开仓 5922.0 296\n", - "2018-07-23 00:00:00 I99 多 开仓 476.0 110\n", - "2018-07-25 00:00:00 CU99 多 平仓 49840.0 128\n", - "2018-07-27 00:00:00 I99 多 开仓 480.5 110\n", - "2018-07-27 00:00:00 I99 多 开仓 485.0 110\n", - "2018-07-27 00:00:00 I99 多 开仓 489.5 110\n", - "2018-08-02 00:00:00 I99 空 平仓 471.5 440\n", - "2018-08-06 00:00:00 IF99 空 开仓 3272.8 4\n", - "2018-08-06 00:00:00 IF99 空 开仓 3234.4 4\n", - "2018-08-06 00:00:00 I99 多 开仓 493.5 110\n", - "2018-08-06 00:00:00 I99 多 开仓 498.0 110\n", - "2018-08-06 00:00:00 I99 多 开仓 502.5 110\n", - "2018-08-06 00:00:00 I99 多 开仓 507.5 110\n", - "2018-08-09 00:00:00 IF99 多 平仓 3387.8 8\n", - "2018-08-16 00:00:00 IF99 空 开仓 3224.6 4\n", - "2018-08-16 00:00:00 I99 空 平仓 489.0 440\n", - "2018-08-17 00:00:00 IF99 空 开仓 3189.8 4\n", - "2018-08-27 00:00:00 IF99 多 平仓 3346.8 8\n", - "2018-09-05 00:00:00 CU99 空 开仓 47260.0 30\n", - "2018-09-11 00:00:00 TA99 空 平仓 7666.0 1184\n", - "2018-09-12 00:00:00 IF99 空 开仓 3188.4 5\n", - "2018-09-13 00:00:00 CU99 多 平仓 48580.0 30\n", - "2018-09-19 00:00:00 I99 多 开仓 508.0 92\n", - "2018-09-19 00:00:00 I99 多 开仓 513.5 92\n", - "2018-09-19 00:00:00 CU99 多 开仓 49160.0 30\n", - "2018-09-19 00:00:00 CU99 多 开仓 49460.0 30\n", - "2018-09-21 00:00:00 IF99 多 平仓 3325.4 5\n", - "2018-09-21 00:00:00 CU99 多 开仓 49790.0 30\n", - "2018-09-25 00:00:00 CU99 多 开仓 50300.0 30\n", - "2018-09-26 00:00:00 IF99 多 开仓 3425.0 5\n", - "2018-09-26 00:00:00 IF99 多 开仓 3457.6 5\n", - "2018-09-28 00:00:00 I99 空 平仓 492.5 184\n", - "2018-10-08 00:00:00 IF99 空 平仓 3326.8 10\n", - "2018-10-10 00:00:00 I99 多 开仓 513.5 97\n", - "2018-10-11 00:00:00 IF99 空 开仓 3183.6 5\n", - "2018-10-11 00:00:00 IF99 空 开仓 3150.8 5\n", - "2018-10-11 00:00:00 IF99 空 开仓 3118.0 5\n", - "2018-10-17 00:00:00 IF99 空 开仓 3085.2 5\n", - "2018-10-17 00:00:00 I99 多 开仓 519.0 97\n", - "2018-10-18 00:00:00 I99 多 开仓 524.0 97\n", - "2018-10-18 00:00:00 I99 多 开仓 529.0 97\n", - "2018-10-18 00:00:00 TA99 空 开仓 7084.0 118\n", - "2018-10-18 00:00:00 TA99 空 开仓 6998.0 118\n", - "2018-10-22 00:00:00 IF99 多 平仓 3216.6 20\n", - "2018-10-22 00:00:00 TA99 空 开仓 6914.0 118\n", - "2018-10-25 00:00:00 CU99 空 平仓 49610.0 120\n", - "2018-10-25 00:00:00 TA99 空 开仓 6830.0 118\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2018-10-31 00:00:00 CU99 空 开仓 49400.0 31\n", - "2018-10-31 00:00:00 CU99 空 开仓 49080.0 31\n", - "2018-11-01 00:00:00 CU99 空 开仓 48760.0 31\n", - "2018-11-02 00:00:00 I99 空 平仓 509.5 388\n", - "2018-11-05 00:00:00 CU99 多 平仓 50050.0 93\n" - ] - } - ], + "outputs": [], "source": [ - "# 查看逐笔的交易记录\n", - "for dt, l in engine.tradeDict.items():\n", - " for trade in l:\n", - " print dt, trade.vtSymbol, trade.direction, trade.offset, trade.price, trade.volume" + "tradeList = engine.getTradeData('000300')\n", + "for trade in tradeList:\n", + " print '%s %s %s %s@%s' %(trade.vtSymbol, trade.direction, trade.offset,\n", + " trade.volume, trade.price)" ] } ], diff --git a/examples/TurtleStrategy/run.ipynb b/examples/TurtleStrategy/run.ipynb index 2d97467d..57c7a353 100644 --- a/examples/TurtleStrategy/run.ipynb +++ b/examples/TurtleStrategy/run.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -18,27 +18,7 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "16:07:40.112000:\t投资组合的合约代码['000300', '000905']\n", - "16:07:40.112000:\t投资组合的初始价值10000000\n" - ] - } - ], - "source": [ - "engine = BacktestingEngine()\n", - "engine.setPeriod(datetime(2014, 1, 1), datetime(2018, 12, 30))\n", - "engine.initPortfolio('test.csv', 10000000)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "scrolled": false }, @@ -47,54 +27,50 @@ "name": "stdout", "output_type": "stream", "text": [ - "16:07:40.182000:\t000300数据加载完成,总数据量:1185\n", - "16:07:40.221000:\t000905数据加载完成,总数据量:1185\n", - "16:07:40.221000:\t全部数据加载完成\n", - "16:07:40.221000:\t开始回放K线数据\n", - "16:07:40.355000:\tK线数据回放结束\n", - "16:07:40.355000:\t开始统计回测结果\n", - "16:07:40.362000:\t回测结果统计结束\n" + "投资组合的合约代码['IF99', 'I99', 'CU99', 'TA99']\n", + "投资组合的初始价值10000000\n", + "IF99数据加载完成,总数据量:1185\n", + "I99数据加载完成,总数据量:1185\n", + "CU99数据加载完成,总数据量:1185\n", + "TA99数据加载完成,总数据量:1185\n", + "全部数据加载完成\n", + "开始回放K线数据\n", + "K线数据回放结束\n", + "开始统计回测结果\n", + "------------------------------\n", + "首个交易日:\t2014-01-02 00:00:00\n", + "最后交易日:\t2018-11-09 00:00:00\n", + "总交易日:\t1185\n", + "盈利交易日\t523\n", + "亏损交易日:\t552\n", + "起始资金:\t10000000\n", + "结束资金:\t54,093,646.23\n", + "总收益率:\t440.94%\n", + "年化收益:\t37.23%\n", + "总盈亏:\t44,093,646.23\n", + "最大回撤: \t-7,822,360.7\n", + "百分比最大回撤: -18.09%\n", + "总手续费:\t607,834.31\n", + "总滑点:\t170,572.2\n", + "总成交笔数:\t571.0\n", + "日均盈亏:\t37,209.83\n", + "日均手续费:\t512.94\n", + "日均滑点:\t143.94\n", + "日均成交笔数:\t0.0\n", + "日均收益率:\t0.16%\n", + "收益标准差:\t1.6%\n", + "Sharpe Ratio:\t1.5\n" ] } ], "source": [ + "engine = BacktestingEngine()\n", + "engine.setPeriod(datetime(2014, 1, 1), datetime(2018, 12, 30))\n", + "engine.initPortfolio('setting.csv', 10000000)\n", + "\n", "engine.loadData()\n", "engine.runBacktesting()\n", - "engine.calculateResult()" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[]" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEDCAYAAAA7jc+ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl8VNX5+PHPk8m+EchC2COrIJRVBKyIiLuVqrVKrdW2Fq177fLV2trW1mr3/upat7or7lIFLSrugoR9R3YCAULIvs5yfn/MZDJ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uxVUC5Z7tzFbHnEVk9Lqx5Nxxt1Ov9dw2AneE+tx68n0HJgCFnmO9AfQO9fn14LmnAqVAr1CfVw+f9++ALbgrNM8ASaE+vx48909wV2bWAqd39No6BYJSSkW5sGi6UUopFTya6JVSKsppoldKqSiniV4ppaKcJnqllIpymuiVUirKaaJXSqko9/8BV7SdCecSoxkAAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "# 汇总每日盈亏,绘制简单资金曲线\n", - "l = [result.totalPnl for result in engine.resultList]\n", - "dateList = [result.date for result in engine.resultList]\n", - "equity = np.cumsum(l)\n", - "plt.plot(dateList, equity)" + "engine.showResult()" ] }, { @@ -105,10 +81,10 @@ }, "outputs": [], "source": [ - "# 查看逐笔的交易记录\n", - "for dt, l in engine.tradeDict.items():\n", - " for trade in l:\n", - " print dt, trade.vtSymbol, trade.direction, trade.offset, trade.price, trade.volume" + "tradeList = engine.getTradeData('000300')\n", + "for trade in tradeList:\n", + " print '%s %s %s %s@%s' %(trade.vtSymbol, trade.direction, trade.offset,\n", + " trade.volume, trade.price)" ] } ], diff --git a/examples/TurtleStrategy/turtleEngine.py b/examples/TurtleStrategy/turtleEngine.py index 7ce17dc1..5c3b09e9 100644 --- a/examples/TurtleStrategy/turtleEngine.py +++ b/examples/TurtleStrategy/turtleEngine.py @@ -2,10 +2,12 @@ from csv import DictReader from datetime import datetime - -from pymongo import MongoClient from collections import OrderedDict, defaultdict +import numpy as np +import matplotlib.pyplot as plt +from pymongo import MongoClient + from vnpy.trader.vtObject import VtBarData from vnpy.trader.vtConstant import DIRECTION_LONG, DIRECTION_SHORT @@ -25,7 +27,7 @@ SLIPPAGE_DICT = {} ######################################################################## class BacktestingEngine(object): - """""" + """组合类CTA策略回测引擎""" #---------------------------------------------------------------------- def __init__(self): @@ -40,6 +42,7 @@ class BacktestingEngine(object): self.fixedCommissionDict = {} # 固定手续费字典 self.slippageDict = {} # 滑点成本字典 + self.portfolioValue = 0 self.startDt = None self.endDt = None self.currentDt = None @@ -52,13 +55,15 @@ class BacktestingEngine(object): #---------------------------------------------------------------------- def setPeriod(self, startDt, endDt): - """""" + """设置回测周期""" self.startDt = startDt self.endDt = endDt #---------------------------------------------------------------------- def initPortfolio(self, filename, portfolioValue=10000000): - """""" + """初始化投资组合""" + self.portfolioValue = portfolioValue + with open(filename) as f: r = DictReader(f) for d in r: @@ -73,12 +78,12 @@ class BacktestingEngine(object): self.portfolio = TurtlePortfolio(self) self.portfolio.init(portfolioValue, self.vtSymbolList, SIZE_DICT) - self.writeLog(u'投资组合的合约代码%s' %(self.vtSymbolList)) - self.writeLog(u'投资组合的初始价值%s' %(portfolioValue)) + self.output(u'投资组合的合约代码%s' %(self.vtSymbolList)) + self.output(u'投资组合的初始价值%s' %(portfolioValue)) #---------------------------------------------------------------------- def loadData(self): - """""" + """加载数据""" mc = MongoClient() db = mc[DAILY_DB_NAME] @@ -96,14 +101,14 @@ class BacktestingEngine(object): barDict = self.dataDict.setdefault(bar.datetime, OrderedDict()) barDict[bar.vtSymbol] = bar - self.writeLog(u'%s数据加载完成,总数据量:%s' %(vtSymbol, cursor.count())) + self.output(u'%s数据加载完成,总数据量:%s' %(vtSymbol, cursor.count())) - self.writeLog(u'全部数据加载完成') + self.output(u'全部数据加载完成') #---------------------------------------------------------------------- def runBacktesting(self): - """""" - self.writeLog(u'开始回放K线数据') + """运行回测""" + self.output(u'开始回放K线数据') for dt, barDict in self.dataDict.items(): self.currentDt = dt @@ -121,21 +126,172 @@ class BacktestingEngine(object): self.portfolio.onBar(bar) self.result.updateBar(bar) - self.writeLog(u'K线数据回放结束') + self.output(u'K线数据回放结束') #---------------------------------------------------------------------- - def calculateResult(self): - """""" - self.writeLog(u'开始统计回测结果') + def calculateResult(self, annualDays=240): + """计算结果""" + self.output(u'开始统计回测结果') for result in self.resultList: result.calculatePnl() - self.writeLog(u'回测结果统计结束') + resultList = self.resultList + dateList = [result.date for result in resultList] + + startDate = dateList[0] + endDate = dateList[-1] + totalDays = len(dateList) + + profitDays = 0 + lossDays = 0 + endBalance = self.portfolioValue + highlevel = self.portfolioValue + totalNetPnl = 0 + totalCommission = 0 + totalSlippage = 0 + totalTradeCount = 0 + + netPnlList = [] + balanceList = [] + highlevelList = [] + drawdownList = [] + ddPercentList = [] + returnList = [] + + for result in resultList: + if result.netPnl > 0: + profitDays += 1 + elif result.netPnl < 0: + lossDays += 1 + netPnlList.append(result.netPnl) + + prevBalance = endBalance + endBalance += result.netPnl + balanceList.append(endBalance) + returnList.append(endBalance/prevBalance - 1) + + highlevel = max(highlevel, endBalance) + highlevelList.append(highlevel) + + drawdown = endBalance - highlevel + drawdownList.append(drawdown) + ddPercentList.append(drawdown/highlevel*100) + + totalCommission += result.commission + totalSlippage += result.slippage + totalTradeCount += result.tradeCount + totalNetPnl += result.netPnl + + maxDrawdown = min(drawdownList) + maxDdPercent = min(ddPercentList) + totalReturn = (endBalance / self.portfolioValue - 1) * 100 + dailyReturn = np.mean(returnList) * 100 + annualizedReturn = dailyReturn * annualDays + returnStd = np.std(returnList) * 100 + + if returnStd: + sharpeRatio = dailyReturn / returnStd * np.sqrt(annualDays) + else: + sharpeRatio = 0 + + # 返回结果 + result = { + 'startDate': startDate, + 'endDate': endDate, + 'totalDays': totalDays, + 'profitDays': profitDays, + 'lossDays': lossDays, + 'endBalance': endBalance, + 'maxDrawdown': maxDrawdown, + 'maxDdPercent': maxDdPercent, + 'totalNetPnl': totalNetPnl, + 'dailyNetPnl': totalNetPnl/totalDays, + 'totalCommission': totalCommission, + 'dailyCommission': totalCommission/totalDays, + 'totalSlippage': totalSlippage, + 'dailySlippage': totalSlippage/totalDays, + 'totalTradeCount': totalTradeCount, + 'dailyTradeCount': totalTradeCount/totalDays, + 'totalReturn': totalReturn, + 'annualizedReturn': annualizedReturn, + 'dailyReturn': dailyReturn, + 'returnStd': returnStd, + 'sharpeRatio': sharpeRatio + } + + timeseries = { + 'balance': balanceList, + 'return': returnList, + 'highLevel': highlevel, + 'drawdown': drawdownList, + 'ddPercent': ddPercentList, + 'date': dateList, + 'netPnl': netPnlList + } + + return timeseries, result + + #---------------------------------------------------------------------- + def showResult(self): + """显示回测结果""" + timeseries, result = self.calculateResult() + + # 输出统计结果 + self.output('-' * 30) + self.output(u'首个交易日:\t%s' % result['startDate']) + self.output(u'最后交易日:\t%s' % result['endDate']) + + self.output(u'总交易日:\t%s' % result['totalDays']) + self.output(u'盈利交易日\t%s' % result['profitDays']) + self.output(u'亏损交易日:\t%s' % result['lossDays']) + + self.output(u'起始资金:\t%s' % self.portfolioValue) + self.output(u'结束资金:\t%s' % formatNumber(result['endBalance'])) + + self.output(u'总收益率:\t%s%%' % formatNumber(result['totalReturn'])) + self.output(u'年化收益:\t%s%%' % formatNumber(result['annualizedReturn'])) + self.output(u'总盈亏:\t%s' % formatNumber(result['totalNetPnl'])) + self.output(u'最大回撤: \t%s' % formatNumber(result['maxDrawdown'])) + self.output(u'百分比最大回撤: %s%%' % formatNumber(result['maxDdPercent'])) + + self.output(u'总手续费:\t%s' % formatNumber(result['totalCommission'])) + self.output(u'总滑点:\t%s' % formatNumber(result['totalSlippage'])) + self.output(u'总成交笔数:\t%s' % formatNumber(result['totalTradeCount'])) + + self.output(u'日均盈亏:\t%s' % formatNumber(result['dailyNetPnl'])) + self.output(u'日均手续费:\t%s' % formatNumber(result['dailyCommission'])) + self.output(u'日均滑点:\t%s' % formatNumber(result['dailySlippage'])) + self.output(u'日均成交笔数:\t%s' % formatNumber(result['dailyTradeCount'])) + + self.output(u'日均收益率:\t%s%%' % formatNumber(result['dailyReturn'])) + self.output(u'收益标准差:\t%s%%' % formatNumber(result['returnStd'])) + self.output(u'Sharpe Ratio:\t%s' % formatNumber(result['sharpeRatio'])) + + # 绘图 + fig = plt.figure(figsize=(10, 16)) + + pBalance = plt.subplot(4, 1, 1) + pBalance.set_title('Balance') + plt.plot(timeseries['date'], timeseries['balance']) + + pDrawdown = plt.subplot(4, 1, 2) + pDrawdown.set_title('Drawdown') + pDrawdown.fill_between(range(len(timeseries['drawdown'])), timeseries['drawdown']) + + pPnl = plt.subplot(4, 1, 3) + pPnl.set_title('Daily Pnl') + plt.bar(range(len(timeseries['drawdown'])), timeseries['netPnl']) + + pKDE = plt.subplot(4, 1, 4) + pKDE.set_title('Daily Pnl Distribution') + plt.hist(timeseries['netPnl'], bins=50) + + plt.show() #---------------------------------------------------------------------- def sendOrder(self, vtSymbol, direction, offset, price, volume): - """""" + """记录交易数据(由portfolio调用)""" # 对价格四舍五入 priceTick = PRICETICK_DICT[vtSymbol] price = int(round(price/priceTick, 0)) * priceTick @@ -148,10 +304,24 @@ class BacktestingEngine(object): self.result.updateTrade(trade) #---------------------------------------------------------------------- - def writeLog(self, content): - """""" - print '%s:\t%s' %(datetime.now().strftime('%H:%M:%S.%f'), content) + def output(self, content): + """输出信息""" + print content + #---------------------------------------------------------------------- + def getTradeData(self, vtSymbol=''): + """获取交易数据""" + tradeList = [] + + for l in self.tradeDict.values(): + for trade in l: + if not vtSymbol: + tradeList.append(trade) + elif trade.vtSymbol == vtSymbol: + tradeList.append(trade) + + return tradeList + ######################################################################## class TradeData(object): @@ -182,15 +352,20 @@ class DailyResult(object): self.tradeDict = defaultdict(list) # 成交字典 self.posDict = {} # 持仓字典(开盘时) - self.tradingPnl = 0 - self.holdingPnl = 0 - self.totalPnl = 0 + self.tradingPnl = 0 # 交易盈亏 + self.holdingPnl = 0 # 持仓盈亏 + self.totalPnl = 0 # 总盈亏 + self.commission = 0 # 佣金 + self.slippage = 0 # 滑点 + self.netPnl = 0 # 净盈亏 + self.tradeCount = 0 # 成交笔数 #---------------------------------------------------------------------- def updateTrade(self, trade): """更新交易""" l = self.tradeDict[trade.vtSymbol] l.append(trade) + self.tradeCount += 1 #---------------------------------------------------------------------- def updatePos(self, d): @@ -227,9 +402,10 @@ class DailyResult(object): commissionCost = (trade.volume * fixedCommission + trade.volume * trade.price * variableCommission) slippageCost = trade.volume * slippage - pnl = (close - trade.price) * trade.volume * side * size - pnl -= (commissionCost + slippageCost) + + self.commission += commissionCost + self.slippage += slippageCost self.tradingPnl += pnl #---------------------------------------------------------------------- @@ -249,4 +425,11 @@ class DailyResult(object): self.calculateHoldingPnl() self.calculateTradingPnl() self.totalPnl = self.holdingPnl + self.tradingPnl - \ No newline at end of file + self.netPnl = self.totalPnl - self.commission - self.slippage + + +#---------------------------------------------------------------------- +def formatNumber(n): + """格式化数字到字符串""" + rn = round(n, 2) # 保留两位小数 + return format(rn, ',') # 加上千分符 \ No newline at end of file diff --git a/examples/TurtleStrategy/turtleStrategy.py b/examples/TurtleStrategy/turtleStrategy.py index 04d6e0f4..895ccc9d 100644 --- a/examples/TurtleStrategy/turtleStrategy.py +++ b/examples/TurtleStrategy/turtleStrategy.py @@ -394,6 +394,5 @@ class TurtlePortfolio(object): self.totalShort += unit # 向回测引擎中发单记录 - #self.engine.sendOrder(vtSymbol, direction, offset, price, volume) self.engine.sendOrder(vtSymbol, direction, offset, price, volume*multiplier) \ No newline at end of file diff --git a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py index ad570f72..b530e0f5 100644 --- a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py +++ b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py @@ -1347,6 +1347,7 @@ class HistoryDataServer(RpcServer): self.historyDict[(dbName, symbol, start, end)] = history print(u'从数据库加载:%s %s %s %s' %(dbName, symbol, start, end)) return history + #---------------------------------------------------------------------- def runHistoryDataServer(): @@ -1361,6 +1362,7 @@ def runHistoryDataServer(): hds.stop() raw_input() + #---------------------------------------------------------------------- def formatNumber(n): """格式化数字到字符串"""