我正在使用一个在线回测平台 Quantconnect,它使用 jupyter 作为他们的研究环境。我有以下代码:fig, ax = plt.subplots()expiry_range = [180, 360]#, 540, 720]for upper in expiry_range: data = getAllOptionChains(symbols, -200, 200, upper-30, upper, datetime(2020, 1, 16, 10, 10), datetime(2020, 1, 16, 10, 11)) clean = data[data['S/E'] <1.2] clean = clean.sort_values('S/E') params, params_covariance = curve_fit(func,np.asarray(clean['S/E']).astype(np.float64), np.asarray(clean['W/E']).astype(np.float64)) #ax.scatter(np.asarray(clean['S/E']).astype(np.float64), np.asarray(clean['W/E']).astype(np.float64)) ax.plot(np.asarray(clean['S/E']).astype(np.float64), func(np.asarray(clean['S/E']).astype(np.float64), params[0], params[1]))我试图在同一张图上绘制 2 条线。但我只能在情节中看到一条线。我做错了什么?这是我得到的情节数据样本clean expiry symbol W/E S/E26 2020-06-19 UVXY XFH59VEMBEQU|UVXY 2T 0.000864865 0.057783824 2020-06-19 UVXY XFH59UN03NNQ|UVXY 2T 0.000277778 0.059388923 2020-06-19 UVXY XFH59VCYS292|UVXY 2T 0.000914286 0.061085721 2020-06-19 UVXY XFH59UMU5BLY|UVXY 2T 0.00635294 0.062882420 2020-06-19 UVXY XFH59VBB8PRA|UVXY 2T 0.00545455 0.064787918 2020-06-19 UVXY XFH59UMO6ZK6|UVXY 2T 0.0046875 0.066812517 2020-06-19 UVXY XFH59V9NPD9I|UVXY 2T 0.00483871 0.068967715 2020-06-19 UVXY XFH59UMI8NIE|UVXY 2T 0.000933333 0.071266714 2020-06-19 UVXY XFH59V8060RQ|UVXY 2T 0.00344828 0.073724112 2020-06-19 UVXY XFH59UMCABGM|UVXY 2T 0.00535714 0.076357111 2020-06-19 UVXY XFH59V6CMO9Y|UVXY 2T 0.00555556 0.07918529 2020-06-19 UVXY XFH59UM6BZEU|UVXY 2T 0.00384615 0.08223088 2020-06-19 UVXY XFH59V4P3BS6|UVXY 2T 0.006 0.085526 2020-06-19 UVXY XFH59UM0DND2|UVXY 2T 0.00416667 0.08908335 2020-06-19 UVXY XFH59V31JZAE|UVXY 2T 0.00156522 0.09295653 2020-06-19 UVXY XFH59ULUFBBA|UVXY 2T 0.00454545 0.09718182 2020-06-19 UVXY XFH59V1E0MSM|UVXY 2T 0.00104762 0.101810 2020-06-19 UVXY XFH59UK6Y3ZA|UVXY 2T 0.00395 0.1069
添加回答
举报
0/150
提交
取消