请教模型编写:
假设
A为多单条件
B为空单条件
请教下面的交易模式表达
如果符合A,开多单
如果不符合A,平多单
如果符合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);