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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 最高盈利70点回测30点平仓问题

   

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


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

主题:最高盈利70点回测30点平仓问题

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


加好友 发短信
等级:论坛游侠 帖子:176 积分:0 威望:0 精华:0 注册:2019/2/22 9:45:36
最高盈利70点回测30点平仓问题  发帖心情 Post By:2019/2/24 20:27:43    Post IP:180.169.30.6[只看该作者]

//老师好,我是个新手请检查一下模型,错误之处改正,不会写的请老师帮忙
ma5yy:=stkindi('','ma.ma1',0,5,0);//斯迪看德
ma10yy:=stkindi('','ma.ma2',0,5,0);
ma20yy:=stkindi('','ma.ma3',0,5,0);
dtplyy:=ma5yy>ma10yy and ma10yy>ma20yy;
ktplyy:=ma5yy<ma10yy and ma10yy<ma20yy;
ma5:ema(close,5);
ma10:ema(close,10);
ma20:ema(close,20);
dtpl:=ma5>ma10 and ma10>ma20;
ktpl:=ma5<ma10 and ma10<ma20;
buycond1:=dtplyy and cross(ma5,ma10) and holding=0;
buycond2:=dtpl and holding>0;
buyshortcond1:=ktplyy and cross(ma10,ma5) and holding=0;
buyshortcond2:=ktpl and holding>0;
if buycond1 then buy(1,1,market);
if buycond2 then buy(1,1,market);
if cross(ma10yy,ma5yy) then sell(holding>0,0,market);//小波段行情结束平仓
if avgenterprice-close>=30*mindiff and holding>0 then sell(1,0,market);//止损
if close-avgenterprice>=100*mindiff and holding>0 then sell(1,0,market);//止盈
//if 多头盈利大于等于70跳,回撤30跳全平//请老师写上

if buyshortcond1 then buyshort(1,1,market);
if buyshortcond2 then buyshort(1,1,market);
if cross(ma5yy,ma10yy) then sellshort(holding>0,0,market);//小波段行情结束平仓
if close-avgenterprice>=30*mindiff and holding>0 then sellshort(1,0,market);//止损
if avgenterprice-close>-100*mindiff and holding>0 then sellshort(1,0,market);//止盈
//if 空头盈利大于等于70跳,回撤30跳全平//请老师写上

////////////////////////////////////////////////////////////////////////////////////////////////
input:n1(5,1,100,1),n2(10,1,100,1),n3(20,1,100,1),g(5);
ma5:ema(close,n1);
ma10:ema(close,n2);
ma20:ema(close,n3);
if cross(ma5,ma10) then begin
sellshort(1,1,market);
buy(holding=0,1,market);
end
if cross(ma10,ma5) then begin
sell(1,1,market);
buyshort(holding=0,1,market);
end
 if close>enterprice+100*mindiff and holding>0 then sell(1,1,market);
 if close<enterprice-30*mindiff and holding>0 then sell(1,1,market);
 if close<hhv(high,enterbars+1)-40*mindiff and holding>0 then sell(1,1,market);
 
 if close<enterprice-100*mindiff and holding>0 then sellshort(1,1,market);
 if close>enterprice+30*mindiff and holding>0 then sellshort(1,1,market);
 if close>llv(low,exitbars+1)+10*mindiff and holding>0 then sellshort(1,1,market);
 

 回到顶部
帅哥哟,离线,有人找我吗?
FireScript
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:14496 积分:0 威望:0 精华:0 注册:2017/7/4 13:40:18
  发帖心情 Post By:2019/2/25 10:27:19    Post IP:180.169.30.6[只看该作者]

 zgyl:=hhv(h,BARSLAST(buycond1)+1)-avGENTERPRICE;//最高盈利
dqyl:=c-AvGENTERPRICE;//当前盈利

zy2:=zgyl>=70*MINDIFF and dqyl<=zgyl*0.7 and dqyl>=0  and holding>0;//从最高点回撤30%止盈

这个上次不是帮你写过么。上面是多头部分。


命数如织,当如磐石。
 回到顶部