求助哪位老师帮助编写个程序!
以五分钟K线 M5上穿M10 同时MACD金叉 开仓
M5下穿M10 同时MACD死叉 开仓
开多仓还是开空仓?
M5是不是均线?
[此贴子已经被作者于2012-3-7 10:29:02编辑过]
m是均线
以五分钟K线 M5上穿M10 同时MACD金叉 开多仓
M5下穿M10 同时MACD死叉 开空仓
仅供参考
// 同时MACD金叉
diff:=ema(c,12)-ema(c,26);
dea:=ema(diff,9);
daymacd:=stkindi('','macd',0,6,-1);
ma5:=ma(c,5);
ma10:=ma(c,10);
cond1:=cross(ma5,ma10);
cond2:=cross(ma10,ma5);
//M5上穿M10
if cross(diff,dea) and daymacd>0 and cond1 then
begin
sellshort(holding<0,0,market);
buy(holding=0,1,market);
end
if cross(dea,diff) and daymacd<0 and cond2 then
begin
sell(holding>0,0,market);
buyshort(holding=0,1,market);
end
[此贴子已经被作者于2012-3-7 13:42:29编辑过]