客服一號,向您請教一下
If investment_residual > 0 then begin buy investing_units shares next bar at market; counter = counter + 1; end;
If investment_residual < 0 then begin sell 1 shares next bar at market; counter = counter + 1; end;
我想在 investment_residual < 0 條件達成時,我只要賣出所有open position的一個單位。可是系統卻會賣出86單位,不知如何克服?
以下為資料輸出,問題在最後2行。在到數第2行,系統應該要賣出1個單位。可是在最還一行系統卻賣出86單位
Currentshare/ counter/ invest_residual/ investment_unit
198.00 71.00 46.30 1.00 199.00 72.00 271.83 3.00 202.00 73.00 102.80 1.00 203.00 74.00 347.43 4.00 207.00 75.00 505.49 6.00 213.00 76.00 353.19 4.00 217.00 77.00 426.97 5.00 222.00 78.00 646.40 8.00 230.00 79.00 251.30 3.00 233.00 80.00 233.92 3.00 236.00 81.00-100.12 1.00 157.00 82.007143.64 86.00
sell 1 shares total next bar at market;
再次謝謝克服一號
請問一下 sell 1 shares next bar at market
和
sell 1 shares total next bar at market
到底在使用上有何不同?
加 TOTAL 是從總部位中 平掉1口
沒加它,是把總部位平倉到 "只剩"1口