请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

为什么我的取值和计算结果都和老师不同呢

我和老师的代码是一样的,操作时间是2022-01-05 ,但是取到闭盘价格和老师的不一样,计算的结果相差的更是超级多……目前没找到问题所在,以下是我的输出结果

            close  signal  profit_pct  cum_profit
2005-01-10   1.47      -1    0.006849    0.006849
2005-01-17   1.40      -1   -0.034483   -0.027870
2005-01-24   1.45      -1    0.013986   -0.014273
2005-01-31   1.36      -1   -0.014493   -0.028559
2005-02-21   1.50      -1    0.013514   -0.015432
2005-02-28   1.45      -1   -0.026846   -0.041863
2005-03-07   1.40      -1   -0.014085   -0.055358
2005-03-14   1.36      -1   -0.007299   -0.062253
2005-03-21   1.33      -1    0.000000   -0.062253
2005-03-28   1.19      -1   -0.016529   -0.077753
2005-04-04   1.21      -1   -0.032000   -0.107265
2005-04-11   1.55      -1    0.019737   -0.089645
2005-04-18   1.44      -1   -0.027027   -0.114249
2005-04-25   1.30      -1   -0.029851   -0.140690
2005-05-09   1.36      -1   -0.021583   -0.159236
2005-05-16   1.32      -1   -0.022222   -0.177920
2005-05-23   1.33      -1   -0.043165   -0.213405
2005-05-30   1.37      -1   -0.007246   -0.219105
2005-06-06   1.33      -1    0.023077   -0.201084
2005-06-13   1.45      -1   -0.013605   -0.211954
2005-06-20   1.43      -1    0.000000   -0.211954
2005-06-27   1.44      -1    0.021277   -0.195187
2005-07-04   1.31      -1    0.007692   -0.188996
2005-07-11   1.23      -1    0.008197   -0.182349
2005-07-18   1.26      -1   -0.007874   -0.188787
2005-07-25   1.33      -1    0.000000   -0.188787
2005-08-01   1.33      -1    0.000000   -0.188787
2005-08-08   1.40      -1    0.007194   -0.182951
2005-08-15   1.41      -1    0.014388   -0.171195
2005-08-22   1.35      -1    0.007463   -0.165010
2005-08-29   1.36      -1   -0.014493   -0.177111
2005-09-05   1.41      -1    0.007143   -0.171233
2005-09-12   1.40      -1    0.000000   -0.171233
2005-09-19   1.41      -1    0.000000   -0.171233
2005-09-26   1.33      -1    0.015267   -0.158580
2005-10-10   1.29      -1    0.000000   -0.158580
2005-10-17   1.29      -1    0.000000   -0.158580
2005-10-24   1.40      -1   -0.014085   -0.170431
2005-10-31   1.28      -1    0.024000   -0.150522
2005-11-07   1.28      -1    0.000000   -0.150522
2005-11-14   1.25      -1    0.008065   -0.143671
2005-11-21   1.28      -1   -0.007752   -0.150309
2005-11-28   1.30      -1   -0.015152   -0.163183
2005-12-05   1.26      -1   -0.030769   -0.188931
2005-12-12   1.32      -1    0.000000   -0.188931
2005-12-19   1.34      -1   -0.007407   -0.194939
2005-12-26   1.39      -1    0.014599   -0.183187
2006-01-09   1.43      -1    0.000000   -0.183187
2006-01-16   1.36      -1   -0.021583   -0.200816
2006-01-23   1.38      -1   -0.007194   -0.206565
2006-02-06   1.43      -1    0.007042   -0.200978
2006-02-13   1.39      -1    0.000000   -0.200978
2006-02-20   1.41      -1    0.007143   -0.195270
2006-02-27   1.53      -1   -0.025478   -0.215773
2006-03-06   1.47      -1    0.006849   -0.210402
2006-03-13   1.40      -1    0.014493   -0.198958
2006-03-20   1.41      -1    0.014388   -0.187432
2006-03-27   1.42      -1    0.007092   -0.181669
2006-04-03   1.43      -1    0.000000   -0.181669
2006-04-10   1.51      -1    0.041379   -0.147807
2006-04-17   1.53      -1    0.000000   -0.147807
2006-04-24   1.46      -1   -0.045752   -0.186797
2006-05-08   1.76      -1    0.000000   -0.186797
2006-05-15   1.93      -1    0.010471   -0.178281
2006-05-22   1.84      -1   -0.010753   -0.187117
2006-05-29   1.97      -1    0.000000   -0.187117
2006-06-05   1.97      -1    0.000000   -0.187117
2006-06-12   1.77      -1   -0.101523   -0.269643
2006-06-19   1.58      -1   -0.006289   -0.274237
2006-06-26   1.63      -1    0.000000   -0.274237
2006-07-03   1.81      -1    0.071006   -0.222703
2006-07-10   1.73      -1    0.000000   -0.222703
2006-07-17   1.73      -1    0.000000   -0.222703
2006-07-24   1.62      -1    0.006211   -0.217875
2006-07-31   1.50      -1   -0.038462   -0.247957
2006-08-07   1.47      -1   -0.013423   -0.258052
2006-08-14   1.52      -1   -0.006536   -0.262901
2006-08-21   1.58      -1    0.019355   -0.248635
2006-08-28   1.63      -1    0.044872   -0.214919
2006-09-04   1.59      -1    0.006329   -0.209951
2006-09-11   1.66      -1    0.024691   -0.190443
2006-09-18   1.71      -1    0.000000   -0.190443
2006-09-25   1.70      -1    0.011905   -0.180806
2006-10-09   1.94      -1    0.060109   -0.131564
2006-10-16   1.98      -1   -0.019802   -0.148761
2006-10-23   2.02      -1   -0.004926   -0.152954
2006-10-30   2.10      -1   -0.041096   -0.187764
2006-11-06   2.21      -1    0.032710   -0.161196
2006-11-13   2.26      -1   -0.021645   -0.179352
2006-11-20   2.41      -1    0.047826   -0.140104
2006-11-27   2.82      -1   -0.007042   -0.146159
2006-12-04   2.94      -1    0.057554   -0.097017
2006-12-11   3.03      -1    0.030612   -0.069375
2006-12-18   3.04      -1    0.016722   -0.053813
2006-12-25   2.99      -1    0.027491   -0.027801
2007-01-08   2.99      -1    0.023973   -0.004494
2007-01-15   3.65      -1    0.051873    0.047146
2007-01-22   3.97      -1    0.047493    0.096878
2007-01-29   4.29      -1    0.048900    0.150515
2007-02-05   3.74      -1   -0.048346    0.094892
2007-02-12   4.32      -1    0.048544    0.148042
2007-02-26   4.52      -1   -0.030043    0.113552
2007-03-05   3.92      -1   -0.036855    0.072512
2007-03-12   4.12      -1   -0.028302    0.042158
2007-03-19   4.24      -1    0.049505    0.093750
2007-03-26   4.29      -1   -0.011521    0.081149
2007-04-02   4.32      -1    0.021277    0.104152
2007-04-09   4.41      -1    0.006849    0.111715
2007-04-16   5.31      -1    0.011429    0.124420
2007-04-23   5.31      -1    0.049407    0.179974
2007-04-30   5.81      -1    0.000000    0.179974
2007-05-14   6.23      -1    0.000000    0.179974
2007-05-21   6.23      -1    0.000000    0.179974
2007-05-28   6.40      -1   -0.021407    0.154715
2007-06-04   6.42      -1    0.000000    0.154715
2007-06-11   6.42      -1    0.000000    0.154715
2007-06-18   6.42      -1    0.000000    0.154715
2007-06-25   8.67      -1   -0.005734    0.148094
2007-07-02   6.75      -1   -0.004425    0.143014
2007-07-09   6.92      -1    0.040602    0.189422
2007-07-16   6.54      -1   -0.063037    0.114444
2007-07-23   8.11      -1    0.079893    0.203481
2007-07-30   8.42      -1    0.009592    0.215025
2007-08-06   9.65      -1    0.002077    0.217548
2007-08-13   9.63      -1    0.003125    0.221353
2007-08-20   9.33      -1    0.086147    0.326569
2007-08-27   9.65      -1   -0.010256    0.312963
2007-09-03   9.33      -1   -0.003205    0.308755
2007-09-10   9.25      -1    0.012035    0.324506
2007-09-17   8.96      -1    0.000000    0.324506
2007-09-24   9.38      -1    0.053933    0.395940
2007-10-08  10.25      -1    0.040609    0.452628
2007-10-15   9.80      -1    0.010309    0.467603
2007-10-22   9.80      -1    0.000000    0.467603
2007-10-29  11.14      -1    0.014572    0.488989
2007-11-05  10.78      -1   -0.037500    0.433152
2007-11-12  10.27      -1   -0.014395    0.412521
2007-11-19   9.32      -1   -0.019979    0.384300
2007-11-26   8.93      -1   -0.019759    0.356949
2007-12-03   9.43      -1    0.061937    0.440994
2007-12-10   9.63      -1   -0.017347    0.415997
2007-12-17   8.70      -1   -0.053319    0.340498
2007-12-24   9.37      -1    0.035359    0.387897
2008-01-07   9.65      -1    0.021164    0.417270
2008-01-14  10.70      -1   -0.013825    0.397677
2008-01-21   9.31      -1   -0.075472    0.292191
2008-01-28   8.72      -1   -0.070362    0.201270
2008-02-04   9.34      -1    0.097532    0.318432
2008-02-18   8.99      -1    0.012387    0.334764
2008-02-25   7.56      -1   -0.047859    0.270884
2008-03-03   8.13      -1   -0.003676    0.266211
2008-03-10   6.77      -1   -0.073871    0.172675
2008-03-17   6.16      -1    0.004894    0.178414
2008-03-24   6.53      -1   -0.064470    0.102441
2008-03-31   6.94      -1   -0.029371    0.070062
2008-04-07   7.39      -1    0.024965    0.096776
2008-04-14   6.32      -1   -0.099715   -0.012589
2008-04-21   5.52      -1   -0.019538   -0.031881
2008-04-28   6.86      -1   -0.002907   -0.034695
2008-05-05   7.29      -1    0.000000   -0.034695
2008-05-12   6.61      -1    0.029595   -0.006127
2008-05-19   6.90      -1    0.010249    0.004059
2008-05-26   6.12      -1   -0.025478   -0.021522
2008-06-02   6.37      -1    0.025765    0.003688
2008-06-16   5.31      -1    0.017241    0.020993
2008-06-23   5.28      -1    0.021277    0.042717
2008-06-30   4.76      -1   -0.006263    0.036186
2008-07-07   5.01      -1    0.068230    0.106885
2008-07-14   5.21      -1    0.011650    0.119781
2008-07-21   4.90      -1    0.027254    0.150299
2008-07-28   5.37      -1    0.034682    0.190194
2008-08-04   5.28      -1   -0.020408    0.165904
2008-08-11   4.75      -1   -0.036511    0.123336
2008-08-18   4.69      -1   -0.028986    0.090775
2008-08-25   4.96      -1    0.012245    0.104132
2008-09-01   4.67      -1   -0.060362    0.037484
2008-09-08   4.35      -1   -0.031180    0.005135
2008-09-22   3.96      -1    0.100000    0.105648
2008-10-06   3.42      -1   -0.073171    0.024747
2008-10-13   3.27      -1    0.101010    0.128257
2008-10-20   3.34      -1    0.050314    0.185025
2008-10-27   2.67      -1   -0.097973    0.068924
2008-11-03   2.70      -1    0.003717    0.072898
2008-11-10   3.10      -1    0.099291    0.179427
2008-11-17   3.54      -1    0.038123    0.224390
2008-11-24   3.14      -1   -0.045593    0.168567
2008-12-01   2.93      -1    0.013841    0.184741
2008-12-08   3.48      -1    0.051360    0.245589
2008-12-15   3.28      -1   -0.003040    0.241803
2008-12-22   3.31      -1   -0.020710    0.216085
2008-12-29   3.04      -1   -0.025641    0.184903
2009-01-05   3.12      -1    0.026316    0.216085
2009-01-12   3.17      -1    0.003165    0.219933
2009-01-19   3.57      -1    0.046921    0.277174
2009-02-02   3.74      -1    0.000000    0.277174
2009-02-09   4.42      -1    0.042453    0.331393
2009-02-16   4.61      -1    0.054920    0.404513
2009-02-23   4.81      -1    0.098174    0.542399
2009-03-02   4.50      -1    0.015801    0.566771
2009-03-09   4.71      -1   -0.020790    0.534198
2009-03-16   4.90      -1    0.029412    0.579321
2009-03-23   5.01      -1    0.018293    0.608211
2009-03-30   5.15      -1   -0.020913    0.574580
2009-04-13   5.38      -1    0.009381    0.589351
2009-04-20   5.18      -1    0.015686    0.614282
2009-04-27   4.86      -1   -0.012195    0.594595
2009-05-04   5.38      -1    0.026718    0.637199
2009-05-11   5.67      -1   -0.029110    0.589541
2009-05-18   5.62      -1    0.000000    0.589541
2009-05-25   5.51      -1    0.003643    0.595331
2009-06-01   5.88      -1    0.026178    0.637094
2009-06-08   6.42      -1    0.000000    0.637094
2009-06-15   7.06      -1    0.099688    0.800293
2009-06-22   7.09      -1    0.000000    0.800293
2009-06-29   6.94      -1    0.000000    0.800293
2009-07-06   7.67      -1    0.011873    0.821669
2009-07-13   7.11      -1   -0.028689    0.769408
2009-07-20   7.60      -1    0.007958    0.783488
2009-07-27   7.42      -1    0.017833    0.815292
2009-08-03   8.30      -1   -0.013080    0.791549
2009-08-10   7.37      -1   -0.025132    0.746523
2009-08-17   6.81      -1   -0.065844    0.631526
2009-08-24   7.04      -1   -0.007052    0.620020
2009-08-31   5.84      -1   -0.050407    0.538360
2009-09-07   6.68      -1    0.003003    0.542980
2009-09-14   7.06      -1    0.008571    0.556206
2009-09-21   6.56      -1   -0.003040    0.551476
2009-09-28   6.24      -1   -0.035549    0.496323
2009-10-12   6.74      -1   -0.002959    0.491896
2009-10-19   7.08      -1    0.035088    0.544243
2009-10-26   7.32      -1    0.000000    0.544243
2009-11-02   7.94      -1    0.099723    0.698239
2009-11-09   7.98      -1   -0.009926    0.681383
2009-11-16   8.42      -1    0.031863    0.734957
2009-11-23   8.20      -1   -0.002433    0.730736
2009-11-30   7.79      -1    0.040053    0.800057
2009-12-07   8.14      -1    0.002463    0.804491
2009-12-14   8.19      -1    0.021197    0.842741
2009-12-21   7.57      -1   -0.014323    0.816348
2009-12-28   7.48      -1    0.000000    0.816348
2010-01-04   7.61      -1   -0.028097    0.765313
2010-01-11   7.26      -1    0.000000    0.765313
2010-01-18   6.89      -1    0.001453    0.767879
2010-01-25   7.13      -1   -0.037787    0.701077
2010-02-01   6.82      -1   -0.021521    0.664468
2010-02-08   6.92      -1   -0.019830    0.631462
2010-02-22   7.10      -1   -0.015257    0.606571
2010-03-01   7.21      -1    0.000000    0.606571
2010-03-08   7.66      -1    0.025435    0.647435
2010-03-15   7.19      -1   -0.023098    0.609382
2010-03-22   7.43      -1    0.004054    0.615907
2010-03-29   7.57      -1    0.034153    0.671095
2010-04-12   7.09      -1   -0.026099    0.627481
2010-04-19   6.45      -1   -0.087694    0.484760
2010-04-26   6.40      -1   -0.010819    0.468696
2010-05-10   5.92      -1    0.010239    0.483734
2010-05-17   5.60      -1   -0.049236    0.410681
2010-05-24   5.91      -1    0.033217    0.457539
2010-05-31   5.62      -1   -0.032702    0.409875
2010-06-07   5.43      -1   -0.023381    0.376910
2010-06-21   5.88      -1    0.057554    0.456156
2010-06-28   5.94      -1    0.020619    0.486180
2010-07-05   5.62      -1    0.000000    0.486180
2010-07-12   5.62      -1    0.000000    0.486180
2010-07-19   5.62      -1    0.000000    0.486180
2010-07-26   5.62      -1    0.000000    0.486180
2010-08-02   5.62      -1    0.000000    0.486180
2010-08-09   5.62      -1    0.000000    0.486180
2010-08-16   5.62      -1    0.000000    0.486180
2010-08-23   5.62      -1    0.000000    0.486180
2010-08-30   5.62      -1    0.000000    0.486180
2010-09-06   5.84      -1    0.024561    0.522683
2010-09-13   5.49      -1   -0.005435    0.514408
2010-09-20   5.36      -1    0.001869    0.517238
2010-09-27   5.36      -1    0.005629    0.525778
2010-10-11   5.79      -1    0.047016    0.597514
2010-10-18   6.16      -1    0.001626    0.600112
2010-10-25   6.07      -1    0.020168    0.632383
2010-11-01   5.96      -1    0.008460    0.646193
2010-11-08   6.15      -1    0.011513    0.665146
2010-11-15   5.56      -1    0.007246    0.677213
2010-11-22   5.36      -1   -0.018315    0.646494
2010-11-29   5.37      -1    0.001866    0.649566
2010-12-06   5.38      -1    0.011278    0.668170
2010-12-13   5.34      -1    0.017143    0.696768
2010-12-20   5.18      -1   -0.013333    0.674144
2010-12-27   5.16      -1   -0.022727    0.636095
2011-01-10   5.13      -1   -0.026565    0.592632
2011-01-17   4.94      -1   -0.037037    0.533645
2011-01-24   4.83      -1   -0.006173    0.524178
2011-01-31   4.92      -1    0.008197    0.536672
2011-02-14   5.14      -1    0.032129    0.586043
2011-02-21   5.13      -1    0.000000    0.586043
2011-02-28   5.12      -1    0.003922    0.592262
2011-03-07   5.38      -1    0.003731    0.598204
2011-03-14   5.19      -1    0.007767    0.610617
2011-03-21   5.06      -1   -0.003937    0.604276
2011-03-28   5.24      -1    0.003831    0.610423
2011-04-11   5.47      -1   -0.007260    0.598732
2011-04-18   6.06      -1    0.008319    0.612032
2011-04-25   5.81      -1    0.012195    0.631691
2011-05-09   5.63      -1    0.000000    0.631691
2011-05-16   5.51      -1   -0.028219    0.585647
2011-05-23   5.75      -1   -0.023769    0.547958
2011-05-30   5.64      -1   -0.001770    0.545218
2011-06-13   5.24      -1   -0.013183    0.524848
2011-06-20   5.14      -1    0.007843    0.536807
2011-06-27   5.49      -1    0.005495    0.545251
2011-07-04   5.64      -1    0.036765    0.602062
2011-07-11   5.59      -1   -0.007105    0.590680
2011-07-18   5.76      -1   -0.003460    0.585176
2011-07-25   5.42      -1   -0.019892    0.553644
2011-08-01   5.52      -1   -0.008977    0.539698
2011-08-08   5.14      -1   -0.017208    0.513202
2011-08-15   5.50      -1    0.029963    0.558541
2011-08-22   5.27      -1   -0.011257    0.540997
2011-08-29   5.37      -1   -0.037634    0.483002
2011-09-05   5.28      -1   -0.029412    0.439384
2011-09-19   5.33      -1   -0.023810    0.405113
2011-09-26   5.15      -1   -0.035581    0.355119
2011-10-10   4.98      -1   -0.033010    0.310387
2011-10-17   5.31      -1    0.011429    0.325362
2011-10-24   5.31      -1    0.031068    0.366539
2011-10-31   5.42      -1   -0.009141    0.354048
2011-11-07   5.37      -1   -0.014679    0.334172
2011-11-14   5.37      -1    0.009398    0.346711
2011-11-21   5.12      -1    0.000000    0.346711
2011-11-28   5.07      -1    0.000000    0.346711
2011-12-05   5.12      -1    0.000000    0.346711
2011-12-12   5.09      -1    0.000000    0.346711
2011-12-19   4.93      -1    0.004073    0.352196
2011-12-26   4.95      -1    0.000000    0.352196
2012-01-09   5.07      -1    0.028398    0.390596
2012-01-16   5.07      -1    0.000000    0.390596
2012-01-30   5.37      -1   -0.003711    0.385436
2012-02-06   5.40      -1   -0.010989    0.370211
2012-02-13   5.36      -1   -0.012891    0.352547
2012-02-20   5.28      -1    0.000000    0.352547
2012-02-27   5.43      -1    0.001845    0.355043
2012-03-05   5.55      -1   -0.010695    0.340550
2012-03-12   5.36      -1   -0.011070    0.325710
2012-03-19   5.25      -1   -0.003795    0.320679
2012-03-26   5.15      -1    0.001946    0.323248
2012-04-09   5.06      -1   -0.013645    0.305192
2012-04-16   5.20      -1   -0.005736    0.297706
2012-04-23   5.27      -1   -0.009398    0.285509
2012-05-07   5.33      -1   -0.007449    0.275934
2012-05-14   5.12      -1   -0.003891    0.270969
2012-05-21   5.06      -1    0.001980    0.273486
2012-05-28   5.08      -1    0.011952    0.288707
2012-06-04   4.95      -1   -0.023669    0.258205
2012-06-11   4.75      -1   -0.002101    0.255561
2012-06-18   4.88      -1    0.002053    0.258140
2012-06-25   4.74      -1   -0.008368    0.247611
2012-07-02   4.86      -1   -0.002053    0.245049
2012-07-09   4.72      -1   -0.028807    0.209184
2012-07-16   4.77      -1   -0.008316    0.199128
2012-07-23   4.76      -1   -0.002096    0.196614
2012-07-30   4.77      -1    0.006329    0.204188
2012-08-06   4.85      -1   -0.002058    0.201710
2012-08-13   4.83      -1   -0.002066    0.199227
2012-08-20   4.77      -1   -0.014463    0.181883
2012-08-27   4.53      -1   -0.017354    0.161373
2012-09-03   4.56      -1    0.000000    0.161373
2012-09-10   4.52      -1   -0.008772    0.151186
2012-09-17   4.40      -1   -0.024390    0.123108
2012-09-24   4.15      -1    0.002415    0.125821
2012-10-08   4.16      -1   -0.014218    0.109814
2012-10-15   4.21      -1   -0.014052    0.094219
2012-10-22   4.36      -1    0.004608    0.099262
2012-10-29   4.19      -1    0.002392    0.101892
2012-11-05   4.40      -1    0.004566    0.106923
2012-11-12   4.41      -1    0.016129    0.124777
2012-11-19   4.23      -1   -0.002358    0.122124
2012-11-26   4.25      -1   -0.009324    0.111661
2012-12-03   4.06      -1   -0.019324    0.090180
2012-12-10   4.63      -1    0.019824    0.111791
2012-12-17   4.92      -1    0.002037    0.114056
2012-12-24   4.83      -1    0.004158    0.118688
2012-12-31   5.18      -1    0.025743    0.147486
2013-01-07   5.27      -1    0.019342    0.169681
2013-01-14   5.53      -1    0.099404    0.285951
2013-01-21   6.37      -1    0.074199    0.381368
2013-01-28   6.82      -1    0.100000    0.519504
2013-02-04   7.12      -1   -0.019284    0.490203
2013-02-18   6.76      -1    0.007452    0.501307
2013-02-25   6.47      -1    0.045234    0.569217
2013-03-04   7.04      -1   -0.056300    0.480870
2013-03-11   7.32      -1   -0.010811    0.464861
2013-03-18   6.91      -1   -0.037604    0.409775
2013-03-25   7.36      -1   -0.012081    0.392745
2013-04-01   6.60      -1    0.013825    0.411999
2013-04-08   6.45      -1   -0.025680    0.375739
2013-04-15   6.00      -1   -0.018003    0.350971
2013-04-22   6.54      -1   -0.001527    0.348909
2013-05-06   6.57      -1    0.029781    0.389080
2013-05-13   6.44      -1   -0.013783    0.369935
2013-05-20   6.79      -1    0.028788    0.409373
2013-05-27   6.61      -1   -0.011958    0.392519
2013-06-03   6.76      -1   -0.004418    0.386367
2013-06-17   6.22      -1    0.008104    0.397601
2013-06-24   5.30      -1   -0.100170    0.257604
2013-07-01   5.09      -1   -0.023033    0.228638
2013-07-08   4.70      -1   -0.040816    0.178490
2013-07-15   5.49      -1    0.016667    0.198131
2013-07-22   4.92      -1   -0.002028    0.195701
2013-07-29   4.92      -1   -0.023810    0.167232
2013-08-05   5.19      -1    0.011696    0.180884
2013-08-12   5.40      -1    0.048544    0.238208
2013-08-19   5.64      -1    0.019892    0.262838
2013-08-26   5.70      -1    0.027027    0.296969
2013-09-02   5.62      -1    0.014440    0.315697
2013-09-09   6.34      -1    0.100694    0.448181
2013-09-16   6.90      -1    0.000000    0.448181
2013-09-23   6.73      -1    0.007485    0.459020
2013-09-30   6.21      -1   -0.001608    0.456675
2013-10-14   6.53      -1   -0.015083    0.434704
2013-10-21   6.44      -1    0.010989    0.450470
2013-10-28   6.86      -1   -0.022792    0.417411
2013-11-04   7.09      -1   -0.022069    0.386130
2013-11-11   7.00      -1    0.004304    0.392096
2013-11-18   7.36      -1    0.054441    0.467883
2013-11-25   7.05      -1   -0.012605    0.449381
2013-12-02   7.18      -1    0.009845    0.463650
2013-12-09   6.89      -1   -0.007205    0.453105
2013-12-16   6.66      -1    0.015244    0.475256
2013-12-23   6.24      -1    0.003215    0.480000
2013-12-30   6.13      -1   -0.001629    0.477589
2014-01-06   6.10      -1   -0.020867    0.446757
2014-01-13   6.06      -1   -0.019417    0.418664
2014-01-20   5.90      -1   -0.016667    0.395020
2014-01-27   5.95      -1   -0.022989    0.362951
2014-02-10   6.05      -1    0.016807    0.385857
2014-02-17   6.25      -1   -0.009509    0.372680
2014-02-24   5.83      -1   -0.037954    0.320581
2014-03-03   5.77      -1   -0.008591    0.309236
2014-03-10   5.39      -1   -0.044326    0.251203
2014-03-17   5.47      -1    0.014842    0.269773
2014-03-24   5.64      -1    0.000000    0.269773
2014-03-31   5.63      -1    0.000000    0.269773
2014-04-14   5.89      -1   -0.011745    0.254860
2014-04-21   5.59      -1   -0.008865    0.243735
2014-04-28   5.76      -1   -0.020408    0.218353
2014-05-05   5.74      -1   -0.013746    0.201606
2014-05-12   5.93      -1    0.027730    0.234926
2014-05-19   5.89      -1    0.000000    0.234926
2014-05-26   6.05      -1    0.000000    0.234926
2014-06-09   6.00      -1    0.008403    0.245303
2014-06-16   6.44      -1    0.001555    0.247240
2014-06-23   6.21      -1   -0.007987    0.237278
2014-06-30   6.30      -1    0.009615    0.249175
2014-07-07   6.27      -1   -0.004762    0.243226
2014-07-14   6.18      -1    0.004878    0.249291
2014-07-21   6.07      -1   -0.004918    0.243147
2014-07-28   6.85      -1    0.053846    0.310086
2014-08-04   6.95      -1    0.022059    0.338985
2014-08-11   6.81      -1    0.016418    0.360968
2014-08-18   6.77      -1    0.005944    0.369057
2014-08-25   6.49      -1   -0.013678    0.350331
2014-09-01   6.55      -1    0.004601    0.356544
2014-09-15   6.55      -1   -0.006070    0.348310
2014-09-22   6.39      -1   -0.031818    0.305410
2014-09-29   6.43      -1    0.000000    0.305410
2014-10-13   6.42      -1   -0.006192    0.297327
2014-10-20   6.46      -1    0.004666    0.303379
2014-10-27   6.37      -1   -0.015456    0.283234
2014-11-03   7.06      -1    0.007133    0.292387
2014-11-10   7.08      -1    0.021645    0.320361
2014-11-17   6.84      -1   -0.015827    0.299463
2014-11-24   6.85      -1   -0.002911    0.295680
2014-12-01   7.75      -1   -0.020228    0.269472
2014-12-08   9.68      -1    0.047619    0.329923
2014-12-15   8.63      -1   -0.025959    0.295399
2014-12-22   9.75      -1    0.023085    0.325303
2014-12-29   9.48      -1   -0.012500    0.308737
2015-01-05  10.18      -1    0.010924    0.323033
2015-01-12   9.39      -1   -0.020855    0.295441
2015-01-19   8.79      -1   -0.100307    0.165499
2015-01-26   9.12      -1   -0.003279    0.161678
2015-02-02   8.66      -1   -0.021469    0.136738
2015-02-09   8.59      -1    0.000000    0.136738
2015-02-16   8.85      -1   -0.002255    0.134175
2015-03-02   8.92      -1    0.003375    0.138002
2015-03-09   8.99      -1    0.052693    0.197967
2015-03-16   9.80      -1    0.028332    0.231907
2015-03-23   9.81      -1    0.007187    0.240761
2015-03-30   9.95      -1    0.037539    0.287338
2015-04-13  12.73      -1    0.011120    0.301653
2015-04-20  12.54      -1   -0.037606    0.252704
2015-04-27  12.63      -1    0.016908    0.273885
2015-05-04  12.71      -1   -0.010895    0.260006
2015-05-11  12.33      -1    0.010656    0.273432
2015-05-18  11.68      -1   -0.017662    0.250941
2015-05-25  12.77      -1    0.019968    0.275920
2015-06-01  12.23      -1    0.037320    0.323537
2015-06-08  13.30      -1    0.060606    0.403751
2015-06-15  12.25      -1   -0.035433    0.354012
2015-06-29  10.43      -1   -0.016038    0.332297
2015-07-06  10.68      -1    0.061630    0.414406
2015-07-13  11.11      -1   -0.027997    0.374808
2015-07-20  10.46      -1   -0.015992    0.352821
2015-07-27   9.57      -1   -0.070874    0.256942
2015-08-03   9.86      -1    0.036803    0.303201
2015-08-10   9.94      -1    0.024742    0.335446
2015-08-17   9.65      -1   -0.008222    0.324466
2015-08-24   7.96      -1   -0.100565    0.191271
2015-08-31   8.52      -1    0.022809    0.218443
2015-09-07   8.38      -1   -0.080132    0.120807
2015-09-14   8.36      -1   -0.008304    0.111500
2015-09-21   8.33      -1    0.001202    0.112836
2015-09-28   8.10      -1   -0.002463    0.110095
2015-10-12   8.64      -1    0.029797    0.143173
2015-10-19   8.66      -1    0.002315    0.145819
2015-10-26   8.86      -1    0.003398    0.149712
2015-11-02   8.57      -1   -0.019451    0.127349
2015-11-09   9.96      -1    0.045121    0.178216
2015-11-16   9.50      -1    0.008493    0.188222
2015-11-23   9.58      -1   -0.008282    0.178382
2015-11-30   9.03      -1    0.000000    0.178382
2015-12-07   9.35      -1    0.002144    0.180908
2015-12-14   9.29      -1    0.020879    0.205564
2015-12-21   9.63      -1    0.023379    0.233749
2015-12-28   9.22      -1   -0.034555    0.191117
2016-01-04   8.72      -1   -0.055255    0.125302
2016-01-11   8.28      -1   -0.032710    0.088493
2016-01-18   8.01      -1   -0.004969    0.083085
2016-01-25   7.98      -1   -0.002500    0.080377
2016-02-01   7.54      -1   -0.019506    0.059303
2016-02-15   7.53      -1   -0.013106    0.045420
2016-02-22   7.92      -1    0.024580    0.071116
2016-02-29   7.36      -1   -0.022576    0.046934
2016-03-07   7.96      -1   -0.005000    0.041699
2016-03-14   7.89      -1    0.008951    0.051024
2016-03-21   8.31      -1    0.024661    0.076943
2016-03-28   8.06      -1   -0.011043    0.065051
2016-04-11   8.25      -1    0.014760    0.080771
2016-04-18   8.26      -1   -0.013142    0.066567
2016-04-25   8.08      -1   -0.004926    0.061313
2016-05-09   7.96      -1   -0.016069    0.044259
2016-05-16   7.97      -1    0.001256    0.045571
2016-05-23   7.91      -1   -0.002522    0.042934
2016-05-30   7.91      -1    0.001266    0.044254
2016-06-06   8.09      -1    0.001238    0.045546
2016-06-13   7.95      -1   -0.016089    0.028724
2016-06-20   8.06      -1    0.002488    0.031283
2016-06-27   8.07      -1    0.004981    0.036420
2016-07-04   8.26      -1    0.012255    0.049122
2016-07-11   8.20      -1    0.001221    0.050403
2016-07-18   8.47      -1    0.005938    0.056640
2016-07-25   8.42      -1    0.004773    0.061684
2016-08-01   8.70      -1    0.009281    0.071537
2016-08-08   8.54      -1    0.008264    0.080393
2016-08-15   9.07      -1    0.019101    0.101029
2016-08-22   8.81      -1   -0.011223    0.088672
2016-08-29   8.83      -1   -0.003386    0.084986
2016-09-05   8.83      -1   -0.003386    0.081312
2016-09-12   8.58      -1   -0.023891    0.055479
2016-09-19   8.55      -1    0.007067    0.062938
2016-09-26   8.47      -1   -0.011669    0.050535
2016-10-10   8.55      -1    0.005882    0.056715
2016-10-17   8.48      -1   -0.004695    0.051753
2016-10-24   8.66      -1    0.011682    0.064040
2016-10-31   8.57      -1   -0.002328    0.061563
2016-11-07   8.55      -1    0.001171    0.062806
2016-11-14   8.64      -1    0.004651    0.067749
2016-11-21   8.66      -1    0.006977    0.075199
2016-11-28   9.02      -1    0.001110    0.076392
2016-12-05   8.86      -1   -0.010056    0.065568
2016-12-12   8.90      -1   -0.015487    0.049066
2016-12-19   8.62      -1   -0.005767    0.043016
2016-12-26   8.55      -1    0.004700    0.047918
2017-01-09   8.57      -1    0.001168    0.049143
2017-01-16   8.57      -1   -0.001166    0.047920
2017-01-23   8.64      -1    0.000000    0.047920
2017-02-06   8.72      -1    0.004608    0.052749
2017-02-13   8.82      -1    0.009153    0.062385
2017-02-20   8.96      -1    0.018182    0.081701
2017-02-27   8.84      -1   -0.006742    0.074409
2017-03-06   8.86      -1    0.005675    0.080506
2017-03-13   8.85      -1    0.004540    0.085412
2017-03-20   8.67      -1   -0.005734    0.079189
2017-03-27   8.57      -1   -0.004646    0.074175
2017-04-10   8.60      -1   -0.002320    0.071683
2017-04-17   8.53      -1    0.002350    0.074201
2017-04-24   8.37      -1   -0.004756    0.069092
2017-05-08   8.03      -1   -0.007417    0.061163
2017-05-15   8.30      -1   -0.004796    0.056074
2017-05-22   8.13      -1   -0.001229    0.054776
2017-06-05   8.46      -1   -0.015134    0.038813
2017-06-12   8.54      -1   -0.003501    0.035177
2017-06-19   8.56      -1    0.013018    0.048653
2017-06-26   8.71      -1    0.004614    0.053491
2017-07-03   8.81      -1    0.001136    0.054688
2017-07-10   8.99      -1    0.013529    0.068956
2017-07-17  10.13      -1   -0.007835    0.060581
2017-07-24  10.41      -1    0.005797    0.066729
2017-07-31  10.14      -1   -0.006856    0.059415
2017-08-07  10.46      -1   -0.015066    0.043454
2017-08-14   9.72      -1    0.019937    0.064258
2017-08-21   9.94      -1    0.001007    0.065330
2017-08-28  10.79      -1    0.021780    0.088533
2017-09-04  11.14      -1    0.045028    0.137547
2017-09-11  10.82      -1   -0.009158    0.127130
2017-09-18  10.70      -1   -0.002796    0.123979
2017-09-25  10.73      -1   -0.013787    0.108483
2017-10-09  10.74      -1    0.017045    0.127377
2017-10-16  11.02      -1    0.020370    0.150343
2017-10-23  10.64      -1   -0.024748    0.121874
2017-10-30  10.99      -1    0.000000    0.121874
2017-11-06  10.72      -1   -0.010157    0.110479
2017-11-13  12.26      -1    0.048760    0.164626
2017-11-20  13.55      -1    0.081405    0.259432
2017-11-27  13.24      -1   -0.043353    0.204832
2017-12-04  12.64      -1    0.022654    0.232126
2017-12-11  12.83      -1    0.031350    0.270754
2017-12-18  12.12      -1    0.002481    0.273907
2017-12-25  12.60      -1   -0.019455    0.249123
2018-01-08  12.32      -1   -0.025316    0.217499
2018-01-15  13.50      -1    0.048137    0.276106
2018-01-22  13.73      -1   -0.024165    0.245269
2018-01-29  13.06      -1   -0.022455    0.217306
2018-02-05  13.83      -1    0.035180    0.260130
2018-02-12  11.14      -1    0.002700    0.263533
2018-02-26  12.01      -1    0.001668    0.265641
2018-03-05  11.28      -1   -0.007042    0.256728
2018-03-12  11.44      -1   -0.004352    0.251259
2018-03-19  11.25      -1    0.016260    0.271605
2018-03-26  10.39      -1   -0.036178    0.225600
2018-04-02  10.18      -1   -0.017375    0.204306
2018-04-09  10.48      -1    0.014521    0.221794
2018-04-16  10.55      -1   -0.040909    0.171811
2018-04-23  11.00      -1    0.019462    0.194618
2018-05-07  10.28      -1    0.012808    0.209918
2018-05-14  10.63      -1    0.015282    0.228408
2018-05-21  10.41      -1   -0.000960    0.227229
2018-05-28  10.07      -1    0.000000    0.227229
2018-06-04   9.76      -1    0.007224    0.236094
2018-06-11   9.54      -1   -0.008316    0.225815
2018-06-25   8.99      -1   -0.039530    0.177359
2018-07-02   8.19      -1   -0.052083    0.116038
2018-07-09   8.58      -1    0.042527    0.163500
2018-07-16   8.43      -1   -0.016336    0.144493
2018-07-23   9.09      -1    0.034130    0.183554
2018-07-30   9.06      -1    0.014558    0.200784
2018-08-06   8.63      -1    0.003488    0.204973
2018-08-13   8.74      -1   -0.019080    0.181982
2018-08-20   8.69      -1    0.022353    0.208403
2018-08-27  10.07      -1    0.040289    0.257089
2018-09-03   9.84      -1    0.006135    0.264801
2018-09-10   9.54      -1   -0.012422    0.249089
2018-09-17   9.35      -1   -0.015789    0.229367
2018-10-08  10.09      -1   -0.054358    0.162541
2018-10-15   9.76      -1   -0.018109    0.141489
2018-10-22  10.76      -1    0.035611    0.182138
2018-10-29  10.38      -1   -0.037998    0.137219
2018-11-05  10.54      -1   -0.014953    0.120214
2018-11-12  10.19      -1    0.000982    0.121315
2018-11-19  10.47      -1    0.026471    0.150996
2018-11-26   9.98      -1    0.002008    0.153308
2018-12-03  10.22      -1    0.022000    0.178680
2018-12-10   9.82      -1   -0.010081    0.166799
2018-12-17   9.93      -1    0.011202    0.179869
2018-12-24   9.09      -1   -0.003289    0.175987
2019-01-07   9.40      -1   -0.001063    0.174738
2019-01-14   9.76      -1   -0.009137    0.164004
2019-01-21   9.98      -1   -0.008937    0.153601
2019-01-28  10.56      -1   -0.005650    0.147083
2019-02-11  10.82      -1    0.000925    0.148144
2019-02-18  10.97      -1    0.037843    0.191594
2019-02-25  12.11      -1    0.087074    0.295350
2019-03-04  12.54      -1    0.017857    0.318481
2019-03-11  11.89      -1    0.001685    0.320703
2019-03-18  12.46      -1    0.032312    0.363377
2019-03-25  11.69      -1   -0.037860    0.311759
2019-04-01  12.72      -1    0.028294    0.348874
2019-04-08  13.47      -1    0.006726    0.357948
2019-04-15  13.21      -1    0.020077    0.385211
2019-04-22  13.66      -1   -0.039381    0.330660
2019-04-29  13.61      -1    0.022539    0.360653
2019-05-06  12.42      -1   -0.071055    0.263972
2019-05-13  11.87      -1   -0.030229    0.225764
2019-05-20  11.95      -1   -0.004996    0.219640
2019-05-27  11.94      -1    0.001678    0.221686
2019-06-03  11.49      -1   -0.022959    0.193637
2019-06-10  11.91      -1    0.034752    0.235119
2019-06-17  12.23      -1    0.014096    0.252530
2019-06-24  13.21      -1    0.003037    0.256334
2019-07-01  13.59      -1    0.011161    0.270355
2019-07-08  13.26      -1   -0.023564    0.240421
2019-07-15  13.66      -1   -0.007988    0.230512
2019-07-22  13.51      -1   -0.010256    0.217891
2019-07-29  13.94      -1    0.004323    0.223156
2019-08-05  13.02      -1   -0.028358    0.188469
2019-08-12  14.75      -1    0.041667    0.237989
2019-08-19  14.55      -1    0.001376    0.239693
2019-08-26  13.90      -1   -0.027292    0.205859
2019-09-02  14.09      -1    0.020275    0.230308
2019-09-09  14.33      -1   -0.008304    0.220091
2019-09-16  14.09      -1   -0.016061    0.200495
2019-09-23  15.00      -1    0.002674    0.203705
2019-09-30  15.21      -1   -0.019342    0.180422
2019-10-14  16.80      -1    0.024390    0.209213
2019-10-21  16.47      -1    0.022981    0.237002
2019-10-28  16.25      -1   -0.012758    0.221220
2019-11-04  16.50      -1    0.003040    0.224932
2019-11-11  15.88      -1   -0.022167    0.197779
2019-11-18  16.05      -1    0.006901    0.206044
2019-11-25  15.41      -1    0.013149    0.221903
2019-12-02  14.98      -1    0.004695    0.227640
2019-12-09  15.03      -1   -0.012484    0.212314
2019-12-16  15.73      -1    0.000636    0.213085
2019-12-23  15.84      -1   -0.021014    0.187594
2019-12-30  16.16      -1   -0.003699    0.183201
2020-01-06  16.65      -1   -0.006563    0.175435
2020-01-13  16.57      -1    0.017813    0.196374
2020-01-20  16.05      -1    0.003752    0.200863
2020-02-03  13.65      -1   -0.099604    0.081252
2020-02-10  14.14      -1   -0.008415    0.072153
2020-02-17  14.99      -1    0.022510    0.096287
2020-02-24  14.86      -1   -0.022368    0.071765
2020-03-02  14.43      -1    0.020509    0.093746
2020-03-09  14.09      -1   -0.038881    0.051220
2020-03-16  13.41      -1   -0.052966   -0.004459
2020-03-23  11.85      -1   -0.029484   -0.033812
2020-03-30  12.62      -1   -0.016368   -0.049626
2020-04-13  12.28      -1   -0.016026   -0.064856
2020-04-20  12.67      -1    0.007955   -0.057417
2020-04-27  13.17      -1    0.020139   -0.038434
2020-05-11  13.66      -1    0.003674   -0.034901
2020-05-18  12.88      -1   -0.001550   -0.036398
2020-05-25  12.64      -1    0.003175   -0.033338
2020-06-01  13.22      -1    0.024806   -0.009359
2020-06-08  13.51      -1    0.002226   -0.007155
2020-06-15  12.72      -1   -0.013189   -0.020249
2020-06-22  12.54      -1   -0.012598   -0.032592
2020-06-29  12.70      -1    0.000000   -0.032592
2020-07-06  15.56      -1    0.100424    0.064559
2020-07-13  14.77      -1    0.002035    0.066726
2020-07-20  14.62      -1    0.042053    0.111585
2020-07-27  13.14      -1   -0.018671    0.090831
2020-08-03  13.48      -1    0.018127    0.110604
2020-08-10  13.84      -1    0.018396    0.131035
2020-08-17  15.07      -1    0.049443    0.186956
2020-08-24  14.35      -1    0.000697    0.187784
2020-08-31  14.96      -1   -0.003331    0.183827
2020-09-07  14.82      -1   -0.001348    0.182232
2020-09-14  15.18      -1    0.019476    0.205257
2020-09-21  15.74      -1   -0.012547    0.190135
2020-09-28  15.19      -1    0.007963    0.199612
2020-10-12  15.78      -1    0.047809    0.256963
2020-10-19  17.34      -1    0.021803    0.284369
2020-10-26  17.56      -1   -0.023902    0.253670
2020-11-02  17.49      -1   -0.006814    0.245127
2020-11-09  17.70      -1    0.011429    0.259357
2020-11-16  17.23      -1    0.010557    0.272652
2020-11-23  19.47      -1    0.040620    0.324348
2020-11-30  19.59      -1    0.002046    0.327057
2020-12-07  18.76      -1   -0.020366    0.300031
2020-12-14  18.73      -1    0.019042    0.324787
2020-12-21  18.14      -1   -0.004391    0.318970
2020-12-28  18.70      -1    0.044693    0.377918
2021-01-04  18.45      -1   -0.038562    0.324783
2021-01-11  20.22      -1    0.026396    0.359752
2021-01-18  22.52      -1    0.080614    0.469368
2021-01-25  22.31      -1    0.020586    0.499615
2021-02-01  24.36      -1    0.063291    0.594528
2021-02-08  24.61      -1   -0.005255    0.586149
2021-02-22  22.21      -1   -0.061285    0.488942
2021-03-01  21.28      -1    0.003300    0.493856
             open       close        high         low        volume  \
count  769.000000  769.000000  769.000000  769.000000  7.690000e+02   
mean     7.555306    7.569545    7.690988    7.438713  1.111485e+08   
std      4.079289    4.102257    4.170083    4.015496  9.108665e+07   
min      1.200000    1.190000    1.210000    1.170000  0.000000e+00   
25%      5.090000    5.120000    5.150000    5.050000  5.287571e+07   
50%      6.920000    6.860000    6.990000    6.740000  9.046336e+07   
75%      9.630000    9.650000    9.850000    9.480000  1.388514e+08   
max     24.710000   24.610000   24.800000   23.910000  7.024621e+08   

              money  weekday  buy_signal  sell_signal  signal  profit_pct  \
count  7.690000e+02    769.0       769.0        769.0   769.0  769.000000   
mean   9.470058e+08      0.0         0.0         -1.0    -1.0    0.000930   
std    1.050995e+09      0.0         0.0          0.0     0.0    0.028641   
min    0.000000e+00      0.0         0.0         -1.0    -1.0   -0.101523   
25%    3.240256e+08      0.0         0.0         -1.0    -1.0   -0.013605   
50%    6.230258e+08      0.0         0.0         -1.0    -1.0    0.000000   
75%    1.200912e+09      0.0         0.0         -1.0    -1.0    0.013514   
max    8.596942e+09      0.0         0.0         -1.0    -1.0    0.101010   

       cum_profit  
count  769.000000  
mean     0.226495  
std      0.235805  
min     -0.274237  
25%      0.074175  
50%      0.216085  
75%      0.362951  
max      0.842741  

正在回答 回答被采纳积分+3

3回答

DeltaF 2022-01-05 14:07:06

收盘价有可能不同,因为复权价格

默认值前复权,前复权的话就是从后往前推,也就是说按现在的价格倒退原始价格,倒退的原因是为了消除分红拆分股权等对价格的影响

1 回复 有任何疑惑可以回复我~
  • 我取出来的收盘价也跟这位童鞋一样,想问一下,我们取出来的数据到底是否可信?
    回复 有任何疑惑可以回复我~ 2022-03-29 10:27:51
  • 这个从代码上要怎么调整呢,都JQData上获取的数据,理论上应该是一样的
    回复 有任何疑惑可以回复我~ 2022-08-08 23:06:50
  • 是因为直接使用data.loc[data['signal'] != 0, 'profit_pct'] = data['close'].pct_change()是有问题的,这行代码会在data DataFrame 中,对于所有signal列不为0的行,将profit_pct列的值设置为close列的百分比变化。这意味着,即使data DataFrame 中存在signal为0的行,这些行的profit_pct值不会被改变。
    而因该使用
    data = data[data['signal'] != 0]  # 筛选买入和卖出的数据  
    data.loc[data['signal'] != 0, 'profit_pct'] = data['close'].pct_change()
    
    这两行代码首先会筛选出data DataFrame 中所有signal不为0的行,并将其赋值回data。然后,它会在筛选后的data DataFrame 中,对于所有signal列不为0的行,将profit_pct列的值设置为close列的百分比变化。
    
    由于第二段代码首先进行了筛选,因此任何原本signal为0的行都将从data中移除。然后,profit_pct列只会针对筛选后的数据进行设置。
    
    并不是老师说的“收盘价有可能不同,因为复权价格”的问题,差距也太大了……
    
    还有就是对于本节课给老师的一点建议:
    1.对于pct_change、cumprod这类计算怎么来的可以简单讲解一个小例子,便于基础较差的同学理解,而不是只有对文档的解释
    2.对于profit_pct  cum_profit数据的解释也不要只看个大概,还是要解释和验证一下数据的真实性,即便可能因为价格有误差,也可以说明一下
    3. 对于这个收益因该还是多说明一下,这个收益是按照周四买周一卖的累计收益最高有10倍,像课程中的口误1000倍明显是只有持有原始股一直不卖,卖在高点才能有的收益吧,实际上这种收益是10倍左右,这种常识性问题从老师口中说出会误导这个收益的计算是计算的初始购买然后不卖的累计收益……
    回复 有任何疑惑可以回复我~ 2024-03-01 11:43:55
weixin_慕圣7555940 2022-08-08 23:24:15
(data):
    data = data[data[] != ]
    data[] = (data[] - data[].shift()) / data[].shift()
    data = data[data[] == -]
    data


用我上面的代码就对了,老师上面讲的时候,就是用的这个代码,用pct_change()算的结果,和上面是不一样的

显然这里用pct_change()这个函数是不对的



0 回复 有任何疑惑可以回复我~
  • data[] == -      是何意?
    回复 有任何疑惑可以回复我~ 2023-01-06 11:03:50
Allen_MC 2022-03-06 14:33:01

我得到的也是这个结果

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信