掘金社区

终端给出的结果中"累计盈亏"是什么意思Pinned highlighted

夏沧海 发表在掘金2 2015-10-10 03:42:59

掘金2
1224
9
0

下面是我的一个策略的终端输出结果,问题是这个策略明明净收益为正77k,为什么累计盈亏为负 -21K, 而且下面的收益曲线也的确显示了亏损

净值1,100,514.20 元
净收益100,514.20 元
收益率10.05%
夏普比率-0.31
风险比率28.96%
开仓次数20
平仓次数20
盈利次数9
亏损次数11
胜率45.00%
最大收益262,524.46 元
最小收益-191,994.18 元
最大单次交易收益124,200.00 元
最小单次交易收益-162,785.71 元
最大持仓市值729,152.96 元
最小持仓市值0.00 元
最大回撤28.54%
年化收益率139.60%
累计出入金总额1,000,000.00 元
累计交易额227,905,725.00 元
累计赢亏-1,321.97 元
累计交易费5,697.64 元

评论: 9
  • 可否将回测数据全部导出发一份给我?

    2015-10-10 06:31:09
  • 修正一下,前面的回复有误:
    累计盈亏:实际每次交易产生的盈亏的累计值(也就是不包括浮盈,手续费);净收益中包含了浮动盈亏,且扣除了手续费。

    2015-10-10 06:32:16
  • 序号,时间,交易所,代码,方向,委托类型,价格,数量,状态,拒绝原因
    0,2015-08-20 09:25:00.000,大商所,l1512,卖/开,限价单,"8,530.00",125,全成,
    1,2015-08-20 09:25:00.000,大商所,l1512,买/平,限价单,"8,530.00",125,全成,
    2,2015-08-20 10:32:00.000,大商所,l1512,卖/开,限价单,"8,465.00",157,全成,
    3,2015-08-20 10:32:00.000,大商所,l1512,买/平,限价单,"8,465.00",157,全成,
    4,2015-08-24 14:28:00.000,大商所,l1512,卖/开,限价单,"8,320.00",120,全成,
    5,2015-08-24 14:28:00.000,大商所,l1512,买/平,限价单,"8,320.00",120,全成,
    6,2015-08-25 09:56:00.000,大商所,l1512,买/开,限价单,"8,415.00",159,全成,
    7,2015-08-25 14:59:00.000,大商所,l1512,卖/平,限价单,"8,415.00",159,全成,
    8,2015-08-27 13:36:00.000,大商所,l1512,买/开,限价单,"8,565.00",132,全成,
    9,2015-08-27 14:59:00.000,大商所,l1512,卖/平,限价单,"8,585.00",132,全成,
    10,2015-08-31 09:18:00.000,大商所,l1512,买/开,限价单,"8,590.00",207,全成,
    11,2015-08-31 10:30:00.000,大商所,l1512,卖/平,限价单,"8,710.00",207,全成,
    12,2015-09-02 09:06:00.000,大商所,l1512,卖/开,限价单,"8,585.00",196,全成,
    13,2015-09-02 09:06:00.000,大商所,l1512,买/平,限价单,"8,585.00",196,全成,
    14,2015-09-02 11:18:00.000,大商所,l1512,买/开,限价单,"8,695.00",209,全成,
    15,2015-09-02 14:31:00.000,大商所,l1512,卖/平,限价单,"8,680.00",209,全成,
    16,2015-09-07 09:25:00.000,大商所,l1512,买/开,限价单,"8,785.00",194,全成,
    17,2015-09-07 14:59:00.000,大商所,l1512,卖/平,限价单,"8,785.00",194,全成,
    18,2015-09-08 09:14:00.000,大商所,l1512,卖/开,限价单,"8,485.00",74,全成,
    19,2015-09-08 09:14:00.000,大商所,l1512,买/平,限价单,"8,485.00",74,全成,
    20,2015-09-08 13:32:00.000,大商所,l1512,卖/开,限价单,"8,475.00",219,全成,
    21,2015-09-08 13:32:00.000,大商所,l1512,买/平,限价单,"8,475.00",219,全成,
    22,2015-09-08 13:33:00.000,大商所,l1512,买/开,限价单,"8,675.00",76,全成,
    23,2015-09-08 14:51:00.000,大商所,l1512,卖/平,限价单,"8,605.00",76,全成,
    24,2015-09-09 10:11:00.000,大商所,l1512,买/开,限价单,"8,795.00",90,全成,
    25,2015-09-09 10:35:00.000,大商所,l1512,卖/平,限价单,"8,640.00",90,全成,
    26,2015-09-09 10:37:00.000,大商所,l1512,买/开,限价单,"8,805.00",22,全成,
    27,2015-09-09 10:43:00.000,大商所,l1512,卖/平,限价单,"8,770.00",22,全成,
    28,2015-09-09 11:03:00.000,大商所,l1512,买/开,限价单,"8,835.00",106,全成,
    29,2015-09-09 14:02:00.000,大商所,l1512,卖/平,限价单,"8,800.00",106,全成,
    30,2015-09-14 10:02:00.000,大商所,l1512,卖/开,限价单,"8,700.00",147,全成,
    31,2015-09-14 10:02:00.000,大商所,l1512,买/平,限价单,"8,700.00",147,全成,
    32,2015-09-16 10:01:00.000,大商所,l1512,买/开,限价单,"8,715.00",140,全成,
    33,2015-09-16 14:59:00.000,大商所,l1512,卖/平,限价单,"8,765.00",140,全成,
    34,2015-09-24 14:50:58.748,大商所,l1512,卖/开,限价单,"8,645.00",152,全成,
    35,2015-09-24 14:50:58.748,大商所,l1512,买/平,限价单,"8,645.00",152,全成,
    36,2015-09-25 09:41:18.725,大商所,l1512,卖/开,限价单,"8,600.00",123,全成,
    37,2015-09-25 09:41:18.725,大商所,l1512,买/平,限价单,"8,600.00",123,全成,
    38,2015-09-25 14:05:29.064,大商所,l1512,卖/开,限价单,"8,430.00",64,全成,
    39,2015-09-25 14:05:29.064,大商所,l1512,买/平,限价单,"8,430.00",64,全成,
    
    {"id":"40e17398-6f1f-11e5-972e-00163e002209","utc":1444461572785.5251,"args":{"strategy_id":"c6c64e3f-6f15-11e5-9407-020458353035","symbols":"DCE.l1512.bar.60, DCE.l1512.tick","start_time":"2015-08-17 09:00:00","end_time":"2015-09-25 16:00:00","initial_cash":1000000,"transaction_ratio":1,"commission_ratio":0.000025,"slippage_ratio":0},"orders":[{"cl_ord_id":"0","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8530,"stop_price":0,"volume":125,"filled_volume":125,"filled_vwap":8530,"sending_time":1440033900000},{"cl_ord_id":"1","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8530,"stop_price":0,"volume":125,"filled_volume":125,"filled_vwap":8530,"sending_time":1440033900000},{"cl_ord_id":"2","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8465,"stop_price":0,"volume":157,"filled_volume":157,"filled_vwap":8465,"sending_time":1440037920000},{"cl_ord_id":"3","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8465,"stop_price":0,"volume":157,"filled_volume":157,"filled_vwap":8465,"sending_time":1440037920000},{"cl_ord_id":"4","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8320,"stop_price":0,"volume":120,"filled_volume":120,"filled_vwap":8320,"sending_time":1440397680000},{"cl_ord_id":"5","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8320,"stop_price":0,"volume":120,"filled_volume":120,"filled_vwap":8320,"sending_time":1440397680000},{"cl_ord_id":"6","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8415,"stop_price":0,"volume":159,"filled_volume":159,"filled_vwap":8415,"sending_time":1440467760000},{"cl_ord_id":"7","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8415,"stop_price":0,"volume":159,"filled_volume":159,"filled_vwap":8415,"sending_time":1440485940000},{"cl_ord_id":"8","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8565,"stop_price":0,"volume":132,"filled_volume":132,"filled_vwap":8565,"sending_time":1440653760000},{"cl_ord_id":"9","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8585,"stop_price":0,"volume":132,"filled_volume":132,"filled_vwap":8585,"sending_time":1440658740000},{"cl_ord_id":"10","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8590,"stop_price":0,"volume":207,"filled_volume":207,"filled_vwap":8590,"sending_time":1440983880000},{"cl_ord_id":"11","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8710,"stop_price":0,"volume":207,"filled_volume":207,"filled_vwap":8710,"sending_time":1440988200000},{"cl_ord_id":"12","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8585,"stop_price":0,"volume":196,"filled_volume":196,"filled_vwap":8585,"sending_time":1441155960000},{"cl_ord_id":"13","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8585,"stop_price":0,"volume":196,"filled_volume":196,"filled_vwap":8585,"sending_time":1441155960000},{"cl_ord_id":"14","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8695,"stop_price":0,"volume":209,"filled_volume":209,"filled_vwap":8695,"sending_time":1441163880000},{"cl_ord_id":"15","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8680,"stop_price":0,"volume":209,"filled_volume":209,"filled_vwap":8680,"sending_time":1441175460000},{"cl_ord_id":"16","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8785,"stop_price":0,"volume":194,"filled_volume":194,"filled_vwap":8785,"sending_time":1441589100000},{"cl_ord_id":"17","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8785,"stop_price":0,"volume":194,"filled_volume":194,"filled_vwap":8785,"sending_time":1441609140000},{"cl_ord_id":"18","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8485,"stop_price":0,"volume":74,"filled_volume":74,"filled_vwap":8485,"sending_time":1441674840000},{"cl_ord_id":"19","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8485,"stop_price":0,"volume":74,"filled_volume":74,"filled_vwap":8485,"sending_time":1441674840000},{"cl_ord_id":"20","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8475,"stop_price":0,"volume":219,"filled_volume":219,"filled_vwap":8475,"sending_time":1441690320000},{"cl_ord_id":"21","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8475,"stop_price":0,"volume":219,"filled_volume":219,"filled_vwap":8475,"sending_time":1441690320000},{"cl_ord_id":"22","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8675,"stop_price":0,"volume":76,"filled_volume":76,"filled_vwap":8675,"sending_time":1441690380000},{"cl_ord_id":"23","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8605,"stop_price":0,"volume":76,"filled_volume":76,"filled_vwap":8605,"sending_time":1441695060000},{"cl_ord_id":"24","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8795,"stop_price":0,"volume":90,"filled_volume":90,"filled_vwap":8795,"sending_time":1441764660000},{"cl_ord_id":"25","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8640,"stop_price":0,"volume":90,"filled_volume":90,"filled_vwap":8640,"sending_time":1441766100000},{"cl_ord_id":"26","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8805,"stop_price":0,"volume":22,"filled_volume":22,"filled_vwap":8805,"sending_time":1441766220000},{"cl_ord_id":"27","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8770,"stop_price":0,"volume":22,"filled_volume":22,"filled_vwap":8770,"sending_time":1441766580000},{"cl_ord_id":"28","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8835,"stop_price":0,"volume":106,"filled_volume":106,"filled_vwap":8835,"sending_time":1441767780000},{"cl_ord_id":"29","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8800,"stop_price":0,"volume":106,"filled_volume":106,"filled_vwap":8800,"sending_time":1441778520000},{"cl_ord_id":"30","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8700,"stop_price":0,"volume":147,"filled_volume":147,"filled_vwap":8700,"sending_time":1442196120000},{"cl_ord_id":"31","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8700,"stop_price":0,"volume":147,"filled_volume":147,"filled_vwap":8700,"sending_time":1442196120000},{"cl_ord_id":"32","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":1,"order_type":0,"status":3,"price":8715,"stop_price":0,"volume":140,"filled_volume":140,"filled_vwap":8715,"sending_time":1442368860000},{"cl_ord_id":"33","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":1,"order_type":0,"status":3,"price":8765,"stop_price":0,"volume":140,"filled_volume":140,"filled_vwap":8765,"sending_time":1442386740000},{"cl_ord_id":"34","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8645,"stop_price":0,"volume":152,"filled_volume":152,"filled_vwap":8645,"sending_time":1443077458748},{"cl_ord_id":"35","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8645,"stop_price":0,"volume":152,"filled_volume":152,"filled_vwap":8645,"sending_time":1443077458748},{"cl_ord_id":"36","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8600,"stop_price":0,"volume":123,"filled_volume":123,"filled_vwap":8600,"sending_time":1443145278725},{"cl_ord_id":"37","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8600,"stop_price":0,"volume":123,"filled_volume":123,"filled_vwap":8600,"sending_time":1443145278725},{"cl_ord_id":"38","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":1,"side":2,"order_type":0,"status":3,"price":8430,"stop_price":0,"volume":64,"filled_volume":64,"filled_vwap":8430,"sending_time":1443161129064},{"cl_ord_id":"39","symbol":"DCE.l1512","exchange":"DCE","sec_id":"l1512","position_effect":2,"side":2,"order_type":0,"status":3,"price":8430,"stop_price":0,"volume":64,"filled_volume":64,"filled_vwap":8430,"sending_time":1443161129064}],"res_merged":[{"utc":1439827200000,"nav":1000000,"frozen":0},{"utc":1440000000000,"nav":1000000,"frozen":0},{"utc":1440033900000,"nav":1000000,"frozen":0},{"utc":1440037920000,"nav":999700.593125,"frozen":598813.75},{"utc":1440345600000,"nav":1130784.4674999993,"frozen":265431.62677304965},{"utc":1440397680000,"nav":1126314.3660815596,"frozen":10617.265070921987},{"utc":1440432000000,"nav":1071159.8674999995,"frozen":260217.26507092203},{"utc":1440467760000,"nav":1126022.3179565596,"frozen":594713.515070922},{"utc":1440485940000,"nav":1125855.0698315597,"frozen":260217.26507092203},{"utc":1440518400000,"nav":1064575.3712499996,"frozen":260217.26507092203},{"utc":1440604800000,"nav":964575.3712499995,"frozen":260217.26507092203},{"utc":1440653760000,"nav":1125713.7473315597,"frozen":542862.265070922},{"utc":1440658740000,"nav":1138772.0948315596,"frozen":260217.26507092203},{"utc":1440950400000,"nav":905617.3962499995,"frozen":260217.26507092203},{"utc":1440983880000,"nav":1138549.8285815595,"frozen":704749.765070922},{"utc":1440988200000,"nav":1262524.4573315596,"frozen":260217.26507092203},{"utc":1441123200000,"nav":1041869.7587499996,"frozen":260217.26507092203},{"utc":1441155960000,"nav":1262314.1248315596,"frozen":680882.265070922},{"utc":1441163880000,"nav":1163400.5578179744,"frozen":719454.8189528512},{"utc":1441175460000,"nav":1147498.7928179745,"frozen":265141.06895285123},{"utc":1441555200000,"nav":959695.1718749993,"frozen":265141.06895285123},{"utc":1441589100000,"nav":1147285.7565679746,"frozen":691213.5689528512},{"utc":1441609140000,"nav":1147072.7203179745,"frozen":265141.06895285123},{"utc":1441641600000,"nav":1071769.0993749993,"frozen":265141.06895285123},{"utc":1441674840000,"nav":1146994.2340679744,"frozen":422113.56895285123},{"utc":1441690320000,"nav":1146570.8404227223,"frozen":729152.9641663638},{"utc":1441690380000,"nav":1150113.933660145,"frozen":429778.8387232427},{"utc":1441695060000,"nav":1123432.186160145,"frozen":264953.8387232427},{"utc":1441728000000,"nav":935008.9606249981,"frozen":264953.8387232427},{"utc":1441764660000,"nav":1123333.242410145,"frozen":462841.3387232427},{"utc":1441766100000,"nav":1053486.042410145,"frozen":264953.8387232427},{"utc":1441766220000,"nav":1053461.828660145,"frozen":313381.3387232427},{"utc":1441766580000,"nav":1049587.711160145,"frozen":264953.8387232427},{"utc":1441767780000,"nav":1049470.647410145,"frozen":499081.3387232427},{"utc":1441778520000,"nav":1030804.0474101449,"frozen":264953.8387232427},{"utc":1441814400000,"nav":836130.821874998,"frozen":264953.8387232427},{"utc":1441900800000,"nav":808005.821874998,"frozen":264953.8387232427},{"utc":1442160000000,"nav":942380.821874998,"frozen":264953.8387232427},{"utc":1442196120000,"nav":867858.4716808122,"frozen":0},{"utc":1442332800000,"nav":819923.6091808123,"frozen":319725},{"utc":1442368860000,"nav":867546.0966808122,"frozen":624750},{"utc":1442386740000,"nav":902392.7091808122,"frozen":319725},{"utc":1442419200000,"nav":843592.7091808122,"frozen":319725},{"utc":1443024000000,"nav":942817.7091808122,"frozen":319725},{"utc":1443077458748,"nav":902228.4541808122,"frozen":648235},{"utc":1443110400000,"nav":1100514.1991808126,"frozen":318697.47491638805},{"utc":1443145278725,"nav":922482.4758530533,"frozen":583147.4749163882},{"utc":1443161129064,"nav":946404.248980144,"frozen":452371.4030100335}],"indicator":{"strategy_id":"c6c64e3f-6f15-11e5-9407-020458353035","nav":1100514.1991808126,"pnl":100514.19918081257,"profit_ratio":0.10051419918081257,"sharp_ratio":-0.3138837556818602,"risk_ratio":0.2895896074340669,"open_count":20,"trade_count":20,"win_count":9,"lose_count":11,"win_ratio":0.45,"max_profit":262524.4573315596,"min_profit":-191994.17812500196,"max_single_trade_profit":124200,"min_single_trade_profit":-162785.71322933276,"max_position_value":729152.9641663638,"min_position_value":0,"max_drawdown":0.2854466566370673,"annual_return":1.3960305441779524,"cum_inout":1000000,"cum_trade":227905725,"cum_pnl":-1321.9656538946801,"cum_commission":5697.6431250000005},"is_detailed":true}
    
    2015-10-10 07:27:18
  • 实际结果是亏损,从图上看,是25日两个点漏统计了(PNL, NAV两个字段),应该是时间戳导致的bug。我们修复一下。

    2015-10-10 08:00:24
  • 回测时间统计的bug修复了,请重跑一下您的策略,看结果是否正确,希望能看到您的反馈。谢谢

    2015-10-12 06:42:23
  • 您好,您的修改是正确的了,谢谢。

    2015-10-12 06:46:58
  • 😀

    2015-10-12 07:05:24
  • 另外,终端中的年化收益率的计算也很有意思,似乎只是简单的乘以交易日的天数就估算出来了,不过这个难道不是复合收益率吗? 如果1个月亏损10%, 那么12个月的亏损并不是10%*12,而是 [1-(1-10%)^12] 不是吗, 所以怎么可能出现年化收益率-200%之类的结果呢?

    2015-10-16 15:13:04
  • 这是一个行内的估算约定,没有必要刻意地用复利的思路去理解,不管策略是赚还是亏,通常都不会是坚持满仓在操作的,也不见得会是每天,每个月都是恒定的,交易者会不会再增资进去也是未知的。

    所以通常年化指标的简化处理都是用一年225个交易日为基础做年化转换的,大家有共识能理解就行了,这个在一些教科书上有介绍,或者在wiki上也可以找到相应的说明。

    2015-10-19 07:23:56

Looks like your connection to 掘金量化社区 - 量化交易者的策略交流学习社区 was lost, please wait while we try to reconnect.