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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 跨周期开仓条件

   

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


  共有4037人关注过本帖平板打印复制链接

主题:跨周期开仓条件

帅哥哟,离线,有人找我吗?
yukizzc
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
  发帖心情 Post By:2020/2/24 9:21:18    Post IP:49.221.253.36[只看该作者]

MID:  MA(CLOSE,26);//布林中轨
UPPER: MID + 2*STD(CLOSE,26);//布林上轨
LOWER: MID - 2*STD(CLOSE,26);//布林下轨

 

//公式1里面的内容就是布林线

day_upper:stkindi('','公式1.UPPER',0,6,0);
day_lower:stkindi('','公式1.lower',0,6,0);
day_mid:stkindi('','公式1.mid',0,6,0);
1hour_upper:stkindi('','公式1.UPPER',0,5,0);
1hour_lower:stkindi('','公式1.lower',0,5,0);
1hour_mid:stkindi('','公式1.mid',0,5,0);

//n用来表示完成第一个步骤
variable:n=0;
IF (CLOSE>day_upper and ref(c,1)<day_upper and n=0) or (close<day_upper and close>day_mid and ref(close,1)>day_upper and n=0) then
begin
  n:=1;
END

//首次开仓
ref_hh:=ref(hhv(close,20),1);
IF (CLOSE>1hour_upper and ref(c,1)<1hour_upper and n=1) or (close<1hour_upper and close>1hour_mid and ref(close,1)>1hour_upper and n=1) then
begin
  if close>ref_hh and holding=0 then
  BEGIN
   buy(1,1,marketr);
  end
END

 

//循环加仓
IF (CLOSE>1hour_upper and ref(c,1)<1hour_upper and n=1) or (close<1hour_upper and close>1hour_mid and ref(close,1)>1hour_upper and n=1) then
begin
  if close>ref_hh and holding>0 and MID>enterprice then
  BEGIN
   buy(1,1,marketr);
  end
END

if close<mid and holding>0 then
begin
 n:=0;
 sell(1,holding,marketr);
end


 回到顶部
总数 17 1 2 下一页