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


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

   

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


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

主题:请帮忙写个公式

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


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

ma5:ma(close,5);
ma150:ma(close,150);
if cross(ma5,ma150) then
begin
 sellshort(1,1,marketr);
 buy(1,1,marketr);
end

if cross(ma150,ma5) then
begin
 sell(1,1,marketr);
 buyshort(1,1,marketr);
end

//止损
if close<enterprice*(1-0.008) and holding>0 then sell(1,holding,marketr);
if close>enterprice*(1+0.008) and holding<0 then sellshort(1,holding,marketr);

//止盈
if close>enterprice*(1+0.02) and holding>0 then sell(1,holding,marketr);
if close<enterprice*(1-0.02) and holding<0 then sellshort(1,holding,marketr);

//回撤
if close<hhv(close,enterbars)*(1-0.2) then sell(1,holding,marketr);
if close>llv(close,enterbars)*(1+0.2) then sellshort(1,holding,marketr);

if time = 150000 then
begin
 sell(1,holding,marketr);
 sellshort(1,holding,marketr);
end


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