有三个开仓条件,Bk1,Bk2,Bk3.满足条件BK1开轻仓1手,BK2加仓2手,BK3加仓3手,止盈条件为SP。
我尝试用系统里面的三进三出来做。解决不了。
如果我用这样的语句:
buy(holding=0 and bk1 ,1,thisclose);
buy(bk2 and type(1)=1,2,thisclose);
buy(bk3 and type(1)=1,3,thisclose);
遇到两个问题:1、遇到直接满足BK3的就执行不了。这里的语句好像必须是先有BK1,再有BK2,BK3的意思;
2、上述语句,在行情如期发展中,只要满足条件时就不断开新仓。。。
能有什么办法解决一下??
试试这个
buy(holding=0 and bk1 and NOT(type(1)=1) ,1,thisclose);
buy(bk2 and type(1)=1 and NOT(type(2)=1),2,thisclose);
buy(bk3 and type(2)=1 and NOT(type(3)=1),3,thisclose);
看起来可以