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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 有关程序修改问题

   

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


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

主题:有关程序修改问题

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
有关程序修改问题  发帖心情 Post By:2016/1/19 11:19:39    Post IP:101.90.255.1[显示全部帖子]

标示红色K线做多,绿色K线做空。请帮助修改程序。
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160119111720.png
图片点击可在新窗口打开查看
有关源码如下:

Q:=(3*CLOSE+HIGH+LOW+OPEN)/6;
AA10:=EMA(Q,13);
BB10:=ATAN((AA10-REF(AA10,1)))*180/3.1416;
STICKLINE(BB10>1 AND AA10>REF(AA10,1), AA10,REF(AA10,1),8,0),COLORRED;
STICKLINE(BB10<1 AND AA10<REF(AA10,1), AA10,REF(AA10,1),8,1),COLORGREEN;
DRAWNUMBER(ISLASTBAR,AA10,AA10,2),COLOR0000FF,ALIGN0;
AA20:=EMA(Q,34);
BB20:=ATAN((AA20-REF(AA20,1)))*180/3.1416;
STICKLINE(BB20>1,AA20,REF(AA20,1),8,0),COLORYELLOW;
STICKLINE(BB20<1,AA20,REF(AA20,1),8,1),COLORBBCCCC;
DRAWNUMBER(ISLASTBAR,AA20,AA20,2),COLOR00FFFF,ALIGN0;
DRAWTEXT(CROSS(AA10,AA20),AA20*0.99871,'多'),COLOR0000FF;
DRAWTEXT(CROSS(AA20,AA10),AA20*1.00239,'空'),COLOR00FF00;

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 13:45:57    Post IP:101.90.255.57[显示全部帖子]

如果是以收盘价开仓,平仓条件满足时以对手价,程序修改如下,是否正确?然而开不了仓了


N:=BARSLAST(DATE<>REF(DATE,1))+1;
Q:=(3*CLOSE+HIGH+LOW+OPEN)/6;
AA10:=EMA(Q,13);
BB10:=ATAN((AA10-REF(AA10,1)))*180/3.1416;
STICKLINE(BB10>1 AND AA10>REF(AA10,1), AA10,REF(AA10,1),8,0),COLORRED;
STICKLINE(BB10<1 AND AA10<REF(AA10,1), AA10,REF(AA10,1),8,1),COLORGREEN;
DRAWNUMBER(ISLASTBAR,AA10,AA10,2),COLOR0000FF,ALIGN0;

平空:sellshort(BB10>1 AND AA10>REF(AA10,1) &&COUNT(enterbars=1,N)<25 ,0, marketr);
buy(BB10>1 AND AA10>REF(AA10,1) &&COUNT(ENTERBARS=1,N)<25 and holding=0,1, thisclose);
平多:sell(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25,0,marketr);
buyshort(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25 and holding=0,1,thisclose);



多止损:sell(C<ENTERPRICE-12*MINDIFF,holding,marketr);
空止损:sellshort(C>ENTERPRICE+12*MINDIFF,holding,marketr);

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 14:03:54    Post IP:101.90.255.57[显示全部帖子]

6楼程序代入公式后thisclose  只能用在交易系统控制语句中

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 14:18:59    Post IP:101.90.255.57[显示全部帖子]

6楼程序代入公式后系统提示:thisclose  只能用在交易系统控制语句中
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160119141824.jpg
图片点击可在新窗口打开查看

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 14:28:15    Post IP:101.90.255.57[显示全部帖子]


另外,若用在国债上,只显示绿线,只能做空,有关
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160119142849.png
图片点击可在新窗口打开查看
见图片。
N:=BARSLAST(DATE<>REF(DATE,1))+1;
Q:=(3*CLOSE+HIGH+LOW+OPEN)/6;
AA10:=EMA(Q,13);
BB10:=ATAN((AA10-REF(AA10,1)))*180/3.1416;
STICKLINE(BB10>1 AND AA10>REF(AA10,1), AA10,REF(AA10,1),8,0),COLORRED;
STICKLINE(BB10<1 AND AA10<REF(AA10,1), AA10,REF(AA10,1),8,1),COLORGREEN;
DRAWNUMBER(ISLASTBAR,AA10,AA10,2),COLOR0000FF,ALIGN0;

平空:sellshort(BB10>1 AND AA10>REF(AA10,1) &&COUNT(enterbars=1,N)<25 ,0, marketr);
buy(BB10>1 AND AA10>REF(AA10,1) &&COUNT(ENTERBARS=1,N)<25 and holding=0,1, thisclose);
平多:sell(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25,0,marketr);
buyshort(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25 and holding=0,1,thisclose);



多止损:sell(C<ENTERPRICE-12*MINDIFF,holding,marketr);
空止损:sellshort(C>ENTERPRICE+12*MINDIFF,holding,marketr);
if hhv(h,enterbars+1)>=enterprice+3*mindiff and hhv(h,enterbars+1)<=enterprice+5*mindiff  and  (h>=enterprice+1*mindiff) and (l<=enterprice+1*mindiff)  then 多止盈1:sell(1,0, limitr,enterprice+1*mindiff);
if hhv(h,enterbars+1)>=enterprice+6*mindiff  and hhv(h,enterbars+1)<=enterprice+7*mindiff  and  (h>=enterprice+3*mindiff) and  (l<=enterprice+3*mindiff)  then 多止盈2:sell(1,0, limitr,enterprice+3*mindiff);
if llv(l,enterbars+1)<=enterprice-3*mindiff  and llv(l,enterbars+1)>=enterprice-5*mindiff  and (h>=enterprice-1*mindiff) and (l<=enterprice-1*mindiff)  then 空止盈1:sellshort(1,0, limitr,enterprice-1*mindiff);
if llv(l,enterbars+1)<=enterprice-6*mindiff  and llv(l,enterbars+1)>=enterprice-7*mindiff  and (h>=enterprice-3*mindiff) and (l<=enterprice-3*mindiff)  then 空止盈2:sellshort(1,0, limitr,enterprice-3*mindiff);
 
if hhv(h,enterbars+1)>=enterprice+8*mindiff and close<=hhv(h,enterbars+1)-3*mindiff then 移动平多:sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-8*mindiff and c>=llv(l,enterbars+1)+3*mindiff then 移动平空:sellshort(1,0,market);

if openprofit>=0 and time0>=(timetot0(closetime(0))- 2*60) then begin
 收盘平多:sell(1,0,market);
收盘平空:sellshort(1,0,market);
time0<=timetot0(closetime(0))-2*60;
end;

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 14:50:46    Post IP:101.90.255.57[显示全部帖子]

问题1:若用在国债上,只显示绿线,不显示红线,只能做空


问题26楼程序代入公式后,公式测试时,系统提示thisclose  只能用在交易系统控制语句中。


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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/19 17:47:34    Post IP:101.90.255.57[显示全部帖子]

您好,老师
此主题相关图片如下:qq图片20160119174617.png
按此在新窗口浏览图片
    1、问题1:若用在国债上,只显示绿线,不显示红线,只能做空
       2、问题2:公式代入后K线不再出现买卖点。
       另外, 12楼的问题2自然消失了。
全码如下:
N:=BARSLAST(DATE<>REF(DATE,1))+1;
Q:=(3*CLOSE+HIGH+LOW+OPEN)/6;
AA10:=EMA(Q,13);
BB10:=ATAN((AA10-REF(AA10,1)))*180/3.1416;
STICKLINE(BB10>1 AND AA10>REF(AA10,1), AA10,REF(AA10,1),8,0),COLORRED;
STICKLINE(BB10<1 AND AA10<REF(AA10,1), AA10,REF(AA10,1),8,1),COLORGREEN;
DRAWNUMBER(ISLASTBAR,AA10,AA10,2),COLOR0000FF,ALIGN0;

平空:sellshort(BB10>1 AND AA10>REF(AA10,1) &&COUNT(enterbars=1,N)<25 ,0, marketr);
buy(BB10>1 AND AA10>REF(AA10,1) &&COUNT(ENTERBARS=1,N)<25 and holding=0,1, thisclose);
平多:sell(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25,0,marketr);
buyshort(BB10<1 AND AA10<REF(AA10,1) &&COUNT(enterbars=1,N)<25 and holding=0,1,thisclose);



多止损:sell(C<ENTERPRICE-12*MINDIFF,holding,marketr);
空止损:sellshort(C>ENTERPRICE+12*MINDIFF,holding,marketr);
if hhv(h,enterbars+1)>=enterprice+3*mindiff and hhv(h,enterbars+1)<=enterprice+5*mindiff  and  (h>=enterprice+1*mindiff) and (l<=enterprice+1*mindiff)  then 多止盈1:sell(1,0, limitr,enterprice+1*mindiff);
if hhv(h,enterbars+1)>=enterprice+6*mindiff  and hhv(h,enterbars+1)<=enterprice+7*mindiff  and  (h>=enterprice+3*mindiff) and  (l<=enterprice+3*mindiff)  then 多止盈2:sell(1,0, limitr,enterprice+3*mindiff);
if llv(l,enterbars+1)<=enterprice-3*mindiff  and llv(l,enterbars+1)>=enterprice-5*mindiff  and (h>=enterprice-1*mindiff) and (l<=enterprice-1*mindiff)  then 空止盈1:sellshort(1,0, limitr,enterprice-1*mindiff);
if llv(l,enterbars+1)<=enterprice-6*mindiff  and llv(l,enterbars+1)>=enterprice-7*mindiff  and (h>=enterprice-3*mindiff) and (l<=enterprice-3*mindiff)  then 空止盈2:sellshort(1,0, limitr,enterprice-3*mindiff);
 
if hhv(h,enterbars+1)>=enterprice+8*mindiff and close<=hhv(h,enterbars+1)-3*mindiff then 移动平多:sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-8*mindiff and c>=llv(l,enterbars+1)+3*mindiff then 移动平空:sellshort(1,0,market);

if openprofit>=0 and time0>=(timetot0(closetime(0))- 2*60) then begin
 收盘平多:sell(1,0,market);
收盘平空:sellshort(1,0,market);
time0<=timetot0(closetime(0))-2*60;
end;


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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
传了两个代表性的图片。  发帖心情 Post By:2016/1/20 10:56:11    Post IP:101.90.254.15[显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160120105253.png
图片点击可在新窗口打开查看
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160120105629.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2016/1/20 10:57:18编辑过]

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/20 11:16:15    Post IP:101.90.254.15[显示全部帖子]

1、用的是16楼的程序;现在是在绿线区间不停地空开平仓,能否修改为波段开平(做波段)?
2、另外,20楼的问题怎么办?

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/20 11:39:28    Post IP:101.90.254.15[显示全部帖子]

绿线区间做空(就是从开始的第一个绿线收盘价做空,如果一直是绿线,就一直持仓),遇到红线信号立即平空;如果该收盘价为红线,红线收盘价做多,直到出现绿线信号就平仓。如果该收盘价为红线,红线收盘价做多,直到出现绿线信号就平仓。

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