思路是将两个条件并列,同时注意多空仓的不同:
时间条件 time=151000
当前C以及比值 c/(c-enterprice)<=比值 or c/(enterprice-c)<=比值 // (前面多后面空)
这样就能写成:
if time=151000 and holding>0 and c/(c-enterprice)<=比值 then sell();
if time=151000 and holding<0 and c/(enterprice-c)<=比值 then sellshort();
按你给我写的 我改成这样 为何无法识别 if time=151000 and holding>0 and (c-enterprice)/c<=1% then sell(1,HOLDING,LIMITR,CLOSE);
开仓语句写了没?
时间周期呢,交易的合约呢
交易周期 和品种 没写进去的