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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 这个反手模型可以写出来吗,我没写出来呢

   

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


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

主题:这个反手模型可以写出来吗,我没写出来呢

帅哥哟,离线,有人找我吗?
qq代人发帖
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:18691 积分:0 威望:0 精华:0 注册:2013/7/15 9:22:16
  发帖心情 Post By:2017/4/6 17:12:42    Post IP:180.169.30.6[只看该作者]

你意思是开多n手 亏损1%平多反手开空2n手,空仓亏损1%平空反手开仓4n 一直这样循环手数就只有翻倍吗?


 回到顶部
帅哥哟,离线,有人找我吗?
qq代人发帖
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:18691 积分:0 威望:0 精华:0 注册:2013/7/15 9:22:16
  发帖心情 Post By:2017/4/6 17:31:09    Post IP:180.169.30.6[只看该作者]

//开多为例
VARIABLE:x=0,y=0;//n是开仓手数
n:=1;//手数自己写数量

if kd and holding=0 then buy(1,n,marketr);
if kk and holding=0 then buyshort(1,n,marketr);
if (enterprice-c)/enterprice>=0.01 and holding>0 then begin //多头亏损超过1%平仓,平仓反手开仓以前的2倍
sell(1,holding,marketr);
buyshort(holding=0,ENTERVOL*2,marketr);
end
if (c-enterprice)/enterprice>=0.01 and holding<0 then begin //空头亏损超过1%平仓,平仓反手开仓上次的2倍
sellshort(1,holding,marketr);
buy(holding=0,2*entervol,marketr);
end


if (c-enterprice)/enterprice>=0.01 then x:=1;//记录多头盈利超过1%
hh:=hhv(h,enterbars+1);
if x=1 and 2*(hh-c)>=hh-enterprice and holding>0 then begin //盈利超过1%后,回撤50%
sell(1,holding,marketr);
x:=0;
end

if (ENTERPRICE-c)/enterprice>=0.01 then y:=1;//记录空头盈利超过1%
ll:llv(l,enterbars+1);
if y=1 and 2*(c-ll)>=enterprice-ll and holding<0 then begin
sellshort(1,holding,marketr);
y:=0;
end


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