請(qǐng)教模型編寫:
假設(shè)
A為多單條件
B為空單條件
請(qǐng)教下面的交易模式表達(dá)
如果符合A,開(kāi)多單
如果不符合A,平多單
如果符合B開(kāi)空單
如果不符合B,平空單
謝謝!!
補(bǔ)充一下:
A為多單條件,只要符合條件A,持有多單
B為空單條件,只要符合條件B,持有空單
if a and holding=0 then buy(1,1,market);
if not(a) and holding>0 then sell(1,0,market);
if b and holding=0 then buyshort(1,1,market);
if not(b) and holding<) then sellshort(1,0,market);