假如有
if 条件A then sell(1,1,market);
if 条件B then sell(1,1,market);
if 条件B then sell(1,1,market);
平仓条件
如果在同一根K线上ABC都满足,在这跟K线同时开了3次,这种情况怎么解决?
恩,是会平仓,但我的意思是想当ABC都开仓的时候我只执行其中一个,这个有办法解决吗?
那么开仓条件里面都加一个holding=0 的判断
试过,不顶用,因为在这根K线之前都是holding=0的
你没有试对,你要每个开仓条件都加上,不是只加一个,
这样写是没问题的
1.如果abc只要成立一个就开仓
if a or b or c then
begin
buy(holding=0,.......
........................
2.如果只能a成立其他不成立是才开仓
if a and not(b) and not(c) then
begin
buy(holding=0,....
......
3.如果abc都成立才开仓
if a and b and c then
begin
buy(holding=0,.......)
.......