ma1:ma(close,5);
ma2:ma(close,20);
cond1:=close>max(ma1,ma2) and ref(close,1)>max(ma1,ma2);
cond2:=close<min(ma1,ma2) and ref(close,1)<min(ma1,ma2) ;
diff1:="macd.diff##min15"(26,12,9);
dea1:="macd.dea##min15"(26,12,9);
if cond1 and cross(diff1,dea1) then
begin
buy(holding=0,1,thisclose);
end
if cond2 then
begin
sell(holding>0,1,thisclose);
end
if cond2 and cross(diff1,dea1) then
begin
buyshort(holding=0,1,thisclose);
end
if cond1 then
begin
sellshort(holding<0,1,thisclose);
end
以上是我的一个思路,很简单,在1分钟线上,五日均线和20日均线,连续两根K线收在他们之上,并且15分钟里macd金叉,做多。跌到两根K线之下平多。反之连续两根K线收在他们之下,并且15分钟里macd死叉,做空。上涨到两根K线之上平空。
但是为什么没有信号,请高人指点
正在处理
策略没有问题 你可以输出一下你的条件,看下条件是否达成
比如这样:
cond1:=close>max(ma1,ma2) and ref(close,1)>max(ma1,ma2);
cond2:close<min(ma1,ma2) and ref(close,1)<min(ma1,ma2) ;
cond3:=cross(diff1,dea1);
cond4:cross(diff1,dea1);
cond5: cond1 and cond3;
多调一点数据出来 ,看下历史数据 我这里是看到信号出现了
我有看到少许的信号,但是这个信号明显是有问题的,完全不符合我的要求,这是为什么呢?