if o<4000 and c>3900 and o>c then buyshort(holding=0,3,market);//开仓条件
if ENTERPRICE<4000 and c>4000 and o>4000 and c>o and holding<0 then sellshort(1,2,MARKET);
if c<3650 and holding<0 then sellshort(holding<0,holding,market);////全平止盈
我就想实现开3手,平2手。
三行代码,第一行就是开3手,第二行是平2手,第三行是全平止盈。 具体你要改什么?不需要那个全平止盈?
达到第二个平仓的时候,显示先平2手,后面一根K线又平了1手,我是想留1手
你说的那个情况肯定是第三条语句的条件被触发了,所以按照全平平仓的话,就把剩下的1手给平掉。 你可以考虑去掉那个第三个持仓全平的语句。这个你需要考虑好具体的处理逻辑。