相关标签:三重滤网交易系统,三重滤网系统实战成绩,三重滤网,惠比特交易和配种专区,梦三国交易专区,梦三国交易专区速秒,灵缇格力交易专区,中京交易市场下载专区,古币银元交易专区,
金字塔公式 金字塔模型策略源码:
input:n1(60,5,120,5);
input:n2(20,5,120,5);
input:n3(5,5,120,5);
ma1:=ma(close,n1);
ma2:=ma(close,n2);
ma3:=ma(close,n3);{www.88gs.com}
longcond:=ref(all(ma1>ref(ma1,1),2) and all(ma2<ref(ma2,1),2) and all(ma3>ref(ma3,1),2),1);
shortcond:=ref(all(ma1<ref(ma1,1),2) and all(ma2>ref(ma2,1),2) and all(ma3<ref(ma3,1),2),1);
if holding=0 then begin
if longcond then
buy(1,1,limitr,open);
end
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,open);
end
if holding>0 then begin
if shortcond then begin
sell(1,holding,limitr,open);
buyshort(1,1,limitr,open);
end
if time=150000 then
sell(1,holding,limitr,open);
end
if holding<0 then begin
if longcond then begin
sellshort(1,holding,limitr,open);
buy(1,1,limitr,open);
end
if time=150000 then
sellshort(1,holding,limitr,open);
end
收益:asset,noaxis,colorred;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
源码解析:
输出INPUT:N1(60,5,120,5)
输出INPUT:N2(20,5,120,5)
输出INPUT:N3(5,5,120,5)
MA1赋值:收盘价的N1日简单移动平均
MA2赋值:收盘价的N2日简单移动平均
MA3赋值:收盘价的N3日简单移动平均
LONGCOND赋值:昨日ALL(MA1>昨日MA1,2)ANDALL(MA2<昨日MA2,2)ANDALL(MA3>昨日MA3,2)
SHORTCOND赋值:昨日ALL(MA1<昨日MA1,2)ANDALL(MA2>昨日MA2,2)ANDALL(MA3<昨日MA3,2)
逻辑判断 HOLDING=0 THEN BEGIN 逻辑判断 LONGCOND THEN BUY(1,1,LIMITR,开盘价)
ENDIF HOLDING=0 THEN BEGIN 逻辑判断 SHORTCOND THEN BUYSHORT(1,1,LIMITR,开盘价)
ENDIF HOLDING>0 THEN BEGIN 逻辑判断 SHORTCOND THEN BEGIN SELL(1,HOLDING,LIMITR,开盘价)
BUYSHORT(1,1,LIMITR,开盘价)
END 逻辑判断 时间=150000 THEN SELL(1,HOLDING,LIMITR,开盘价)
ENDIF HOLDING<0 THEN BEGIN 逻辑判断 LONGCOND THEN BEGIN SELLSHORT(1,HOLDING,LIMITR,开盘价)
BUY(1,1,LIMITR,开盘价)
END 逻辑判断 时间=150000 THEN SELLSHORT(1,HOLDING,LIMITR,开盘价)
输出END 收益:ASSET,NOAXIS,画红色
输出次数:TOTALTRADE,线宽为0
输出胜率:PERCENTWIN,线宽为0
输出连亏:MAXSEQLOSS,线宽为0
输出连赢:MAXSEQWIN,线宽为0