金字塔布林带通道突破交易系统
-
相关简介:金字塔公式 金字塔模型策略源码:runmode:0; input:m(30,1,300,1); input:n(2,0.5,10,0.5); variable:myasset=30000; mid:=ma(close,m); upper:=mid+n*std(close,m); lower:=mid-n*std(close,m); entertime:=time=091500 and time=145500; exittime:=time=150000; highest:=ref(upper,1
-
文章来源:公式网 发布时间:2015-10-25浏览次数:
金字塔公式 金字塔模型策略源码:runmode:0;
input:m(30,1,300,1);
input:n(2,0.5,10,0.5);
variable:myasset=30000;
mid:=ma(close,m);
upper:=mid+n*std(close,m);
lower:=mid-n*std(close,m);
entertime:=time>=091500 and time<=145500;
exittime:=time>=150000;
highest:=ref(upper,1);
lowest:=ref(lower,1);
longcond:=entertime and high>=highest;
longprice:=max(highest,open);
shortcond:=entertime and low<=lowest;
shortprice:=min(lowest,open);
if holding=0 then begin
if longcond then
buy(1,1,limitr,longprice);
end
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,shortprice);
end
if holding>0 then begin
if exittime then
sell(1,holding,limitr,close);
end
if holding<0 then begin
if exittime then
sellshort(1,holding,limitr,close);
end
if exittime then
myasset:=asset;
资产:myasset,colorred,noaxis;
复制上述代码粘贴到到公式管理器
源码解析:
输出RUNMODE:0
输出 INPUT:M(30,1,300,1)
输出 INPUT:N(2,0.5,10,0.5)
输出 VARIABLE:MYASSET=30000
MID赋值:收盘价的M日简单移动平均
UPPER赋值:MID+N*收盘价的M日估算标准差
LOWER赋值:MID-N*收盘价的M日估算标准差
ENTERTIME赋值:时间>=091500 AND 时间<=145500
EXITTIME赋值:时间>=150000
HI


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