金字塔震荡交易系统策略源码
-
相关简介:金字塔公式 金字塔模型策略源码:runmode:0; input:p(5,1,60,1); lc:=ref(close,1); rsi:=sma(max(close-lc,0),p,1)/ sma(abs(close-lc),p,1)*100; entertime:=time=143000 and time=145500; exittime:=time=150000; if holding=0 then begin if entertime and rsi=10 then buy(1,1,lim
-
文章来源:公式网 发布时间:2015-10-25浏览次数:
金字塔公式 金字塔模型策略源码:runmode:0;
input:p(5,1,60,1);
lc:=ref(close,1);
rsi:=sma(max(close-lc,0),p,1)/
sma(abs(close-lc),p,1)*100;
entertime:=time>=143000 and time<=145500;
exittime:=time>=150000;
if holding=0 then begin
if entertime and rsi<=10 then
buy(1,1,limitr,close);
end
if holding=0 then begin
if entertime and rsi>=90 then
buyshort(1,1,limitr,close);
end
if holding>0 then begin
if entertime and rsi>=90 then begin
sell(1,holding,limitr,close),orderqueue;
buyshort(1,1,limitr,close),orderqueue;
end
if exittime then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if entertime and rsi<=10 then begin
sellshort(1,holding,limitr,close),orderqueue;
buy(1,1,limitr,close),orderqueue;
end
if exittime then
sellshort(1,holding,limitr,close);
end
盈亏:asset,noaxis,colormagenta;
收益:(asset-50000)/50000,linethick0;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
复制上述代码粘贴到到公式管理器
源码解析:
输出RUNMODE:0
输出INPUT:P(5,1,60,1)
LC赋值:昨收
RSI赋值:收盘价-LC和0的较大值的P日[1日权重]移动平均/收盘价-LC的绝对值的P日[1日权重]移动平均*100
ENTERTIME赋值:时间>=143000 AND 时间<=145500
EXITTIME赋值:时间>=150000
逻辑判断 HOLDING=0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI<=10 THEN BUY(1,1,LIMITR,收盘价)
ENDIF HOLDING=0 THEN BEGIN 逻辑判断 ENTERTIME AND RSI>=90 THE


现在就去充值积分
加入VIP可下载100以下的所有资源