请问老师:能否发建立一组代码,其内容是连续三根长下影K线和连续三根长上影K线,如可以,请求提供,谢谢!!!
count(h>c and h>o,3) 上影线
count(l<c and l<o and l<h,3) 下影线
主要是利用count 函数以及上下影线的定义即可。
buycond:count(h>c and h>o,3)=3;
sellcond:count(l<c and l<o and l<h,3)=3;
if buycond then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end
if sellcond then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
图表虚拟持仓不能同时持有多空,因此开多前平空 开空前平多。