欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 请老师帮助编写

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有2873人关注过本帖树形打印复制链接

主题:请老师帮助编写

美女呀,离线,留言给我吧!
pyd
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2015/5/13 15:15:08    Post IP:58.246.57.26[只看该作者]

模型中标红的n是你的开仓条件中的n

 回到顶部
美女呀,离线,留言给我吧!
pyd
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2015/5/13 15:18:38    Post IP:58.246.57.26[只看该作者]

VARIABLE:x=0,y=0;
MID :  MA(CLOSE,26);
UPPER: MID + 2*STD(CLOSE,26);
LOWER: MID - 2*STD(CLOSE,26);

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1);
D:SMA(K,3,1);
n:=20;
sc:cross(d,k);
jc:cross(k,d);
n1:barslast(h>upper)+1;
n2:barslast(l<lower);
hh:hhv(h,enterbars+1);
ll:llv(l,enterprice+1);

if n1<=n and sc=1 then begin
平多a:sell(holding>0,holding,market);
开空a:buyshort(holding=0,1,market);
end

if n2<=n and jc=1 then begin
平空a:sellshort(holding<0,holding,market);
开多a:buy(holding=0,1,market);
end
//止损
if h-enterprice>=50 then
多损:sell(holding>0,holding,market);
if enterprice-l>=50 then
空损:sellshort(holding<0,holding,market);

//盈利80点后设30点保本。
if hh-enterprice>=80 then x:=1;
if x=1 and hh-l>=50 then begin
多保本:sell(holding>0,holding,market);
x:=0;
end
if enterprice-ll>=80 then y:=1;
if y=1 and h-ll>=50 then begin
空保本:sellshort(holding<0,holding,market);
y:=1;
end


 回到顶部
总数 12 上一页 1 2