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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 定位价格

   

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


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

主题:定位价格

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/8 11:03:25    Post IP:180.169.30.6[只看该作者]

也就是出现绿柱后就不执行止损止盈,等下一个反向信号?


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:论坛游民 帖子:178 积分:0 威望:0 精华:0 注册:2016/10/17 16:49:11
  发帖心情 Post By:2016/12/8 11:16:03    Post IP:175.11.158.248[只看该作者]

也要执行,只要那个价格定位到了,(不出现下一个红色柱,并且红色柱超过绿色柱最高点之前),都已定位的这个价格为准。

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/8 11:39:44    Post IP:180.169.30.6[只看该作者]

a1:=ma(c,10);
PARTLINE(a1>=ref(a1,1),a1,colorred,2);
PARTLINE(a1<ref(a1,1),a1,colorgreen,2);
a2:=ma(c,22);
PARTLINE(a2>=ref(a2,1),a2,colorred,3);
PARTLINE(a2<ref(a2,1),a2,colorgreen,3);

a3:=ma(c,10)>=ref(ma(c,10),1) and ma(c,22)>=ref(ma(c,22),1);
a8:=ma(c,10)<ref(ma(c,10),1) and ma(c,22)<ref(ma(c,22),1);

variable:n=0,m=0;
mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);

variable:bj=0;

mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);

if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;

uu3:=cross(i=1,0.5);
uu4:=cross(i=-1,0.5);
if uu3 or ((ref(c,1)>ref(o,1) and h>ref(h,1) and c<ref(l,1))) or (ref(h,1)=hhv(h,3) and c<ref(l,1)) or c<ref(l,barslast(c>o)) then begin
 n:=0;
 m:=m+1;
end

//m为绿色
if uu4 or (ref(l,1)=llv(l,3) and c>ref(h,1)) or ((ref(o,1)>ref(c,1) and l<ref(l,1) and c>ref(h,1))) or c>ref(h,barslast(c<o)) then begin
 n:=n+1;
 m:=0;
end
//n为红色
STICKLINE(cross(m,0.5),o,CLOSE,7.5,0),COLORgreen;
STICKLINE(cross(n,0.5),o,c,7.5,0),COLORred;


if cross(m,0.5) and a8 and holding=0 then begin
buyshort(holding=0,1,marketr);
end

if cross(n,0.5) and a3 and holding=0 then begin
buy(holding=0,1,marketr);
end

if HOLDING<=0 and cross(n,0.5)  and a3  then begin
 if holding<0 then SELLSHORT(1,0,marketr);
 BUY(holding=0,1,marketr);
 end
 if HOLDING>0 and cross(m,0.5) and a8  then begin
 if holding>0 then SELL(1,0,marketr);
 BUYshort(holding=0,1,marketr);
end
lx:=barslast(cross(m,0.5));
hx:=barslast(cross(n,0.5));

if holding>0 and enterbars>0 and h>ref(ref(h,lx),enterbars+1) then sell(1,0,marketr);
if holding>0 and enterbars>0 and l<ref(l,lx) and lx<enterbars then sell(1,0,marketr);
if holding>0 and enterbars>0 and lx<enterbars and h<=ref(ref(h,lx),enterbars+1) and l<ref(l,sumbars(cross(n,0.5),2)) then sell(1,0,marketr);

if holding<0 and enterbars>0 and l<ref(ref(l,hx),enterbars+1) then sellshort(1,0,marketr);
if holding>0 and enterbars>0 and h>ref(h,hx) and hx<enterbars then sellshort(1,0,marketr);
if holding>0 and enterbars>0 and hx<enterbars and l>=ref(ref(l,hx),enterbars+1) and h>ref(h,sumbars(cross(m,0.5),2)) then sellshort(1,0,marketr);



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:论坛游民 帖子:178 积分:0 威望:0 精华:0 注册:2016/10/17 16:49:11
  发帖心情 Post By:2016/12/8 13:00:23    Post IP:175.11.158.248[只看该作者]

你做的这个不是我要的    这个图这样不知道你能不能理解
图片点击可在新窗口打开查看此主题相关图片如下:111.png
图片点击可在新窗口打开查看

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/8 13:35:24    Post IP:180.173.193.42[只看该作者]

太复杂了,定位不到后面的点


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

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


加好友 发短信
等级:论坛游民 帖子:178 积分:0 威望:0 精华:0 注册:2016/10/17 16:49:11
  发帖心情 Post By:2016/12/8 13:39:55    Post IP:175.11.158.248[只看该作者]

一天问你两个问题   一个都没解决。。。。。。你们没有高级点的编程老师吗?

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


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

请稍等,这边正在查看该问题

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


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
  发帖心情 Post By:2016/12/8 16:47:45    Post IP:180.169.30.6[只看该作者]

r_cond:=cross(n,0.5);
g_cond:=cross(m,0.5);

variable:r_low[10000]=0,r_num=0,r_high[10000]=0;
if cross(n,0.5) THEN
begin
r_num:=r_num+1;
r_low[r_num]:=low;
r_hgih[r_num]:=high;
end

variable:g_low[10000]=0,g_num=0,g_high[10000]=0;
if cross(m,0.5) THEN
begin
g_num:=g_num+1;
g_low[g_num]:=low;
g_high[g_num]:=high;
end

 

利用上数组去记录就可以了。g_high[g_num]这就是上一根绿色柱的最高价, g_high[g_num-1]就是上一根的了。

 

if holding>0 and BARSLAST(r_cond)<barslast(g_cond) and h>g_high[g_num] and

if holding>0 and BARSLAST(r_cond)<barslast(g_cond) and h<g_high[g_num] and

 

 

多单止损为最近的红色最低点;多单止盈或止损为最近变红再前一次红色的最低价。

这两句话不明有歧义,多单止损是指止损条件还是说的报单价格,因为后面的多单止盈或止损为某一个价格,这个到底是指条件大于小于,还是指??


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


加好友 发短信
等级:论坛游民 帖子:178 积分:0 威望:0 精华:0 注册:2016/10/17 16:49:11
  发帖心情 Post By:2016/12/8 21:26:34    Post IP:175.11.158.248[只看该作者]



stickline(barpos=datacount-22 and c>=O,c,o,10,0,COLORMAGENTA);
stickline(barpos=datacount-10 and c>=o,c,o,10,0,COLORMAGENTA);
stickline(barpos=datacount-22 and c<O,c,o,10,0,COLOrblue);
stickline(barpos=datacount-10 and c<o,c,o,10,0,COLORblue);


a3:=ma(c,10)>=ref(ma(c,10),1) and ma(c,22)>=ref(ma(c,22),1);//10日和22日均线都向上
a8:=ma(c,10)<ref(ma(c,10),1) and ma(c,22)<ref(ma(c,22),1);//10日和22日均线都向下
a1:=ma(c,10);
PARTLINE(a1>=ref(a1,1),a1,colorred,2);
PARTLINE(a1<ref(a1,1),a1,colorgreen,2);
a2:=ma(c,22);
PARTLINE(a2>=ref(a2,1),a2,colorred,3);
PARTLINE(a2<ref(a2,1),a2,colorgreen,3);
variable:n=0,m=0;
mm:=ref(h,1)=hhv(h,3); 
nn:=ref(l,1)=llv(l,3);

variable:bj=0;
variable:dt=0,kt=0;
mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);

if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;

uu3:=cross(i=1,0.5);
uu4:=cross(i=-1,0.5);
if uu3 or ((ref(c,1)>ref(o,1) and h>ref(h,1) and c<ref(l,1))) or (ref(h,1)=hhv(h,3) and c<ref(l,1)) or c<ref(l,barslast(c>o)) then begin
 n:=0;
 m:=m+1;
end

//m为绿色
if uu4 or (ref(l,1)=llv(l,3) and c>ref(h,1)) or ((ref(o,1)>ref(c,1) and l<ref(l,1) and c>ref(h,1))) or c>ref(h,barslast(c<o)) then begin
 n:=n+1;
 m:=0;
end
//n为红色
STICKLINE(cross(m,0.5),o,CLOSE,7.5,0),COLORgreen;
STICKLINE(cross(n,0.5),o,c,7.5,0),COLORred;

tt:=(time>=090512 and time<=112500) or (time>=133100 and time<=145400) or (time>=210500 and time<=225500);//时间为交易时间开始五分钟后和结束五分钟前
if uu3 and a8 and holding=0 and tt then begin  
 buyshort(holding=0,1,market);
 end//向下价失控加双均线下弯
if a3 and uu4 and holding=0 and tt then begin
 buy(holding=0,1,market);
 end//向上价失控加双均线上弯
 
 b1:=c<ref(l,barslast(c>o));
 if a8 and b1 and holding=0  and tt then begin
  buyshort(holding=0,1,market);
 end//收盘价小于上一个阳线的最低点,并且双均线下弯,开空
 
b2:=c>ref(h,barslast(c<o));
 if a3 and b2 and holding=0 and tt then begin
  buy(holding=0,1,market);
 end//收盘价大于上一个阴线的最高点,双均线上弯,开多







if (time>=112900 and time<=113000) or (time>=145900 and time<=150000) or (time>=225500 and time<=230000) then begin
   sell(1,0,thisclose);
  sellshort(1,0,thisclose);
end 



这是我的策略源码,还差出场没有完善。我再发个图。我的止损就如图所示:主图上面的红色柱及绿色柱是根据一定条件显示的,但每个变色的k线,都是因为前面出现了创出新高(或者新低)的k线的最低价(或最高价)。上面的代码中有表达。所以想要通过变色的k线反推找到图中显示的“顶”以及“底”。用来做止盈和止损条件。
止盈或止损(多单为例,空单也一样):出现“红k1”后,接下来的k线,如果有高于“顶1”的价格出现后,止盈推到“底1”。出现“红k2”后,因为直接高于“顶2”,所以止盈直接推到“底2”.知道不在出现高于“顶n” 的价格是,止盈一直在“底n”,直到价格低于“底n”离场。
辛苦!!麻烦转交昨天最后一条的作者帮忙。谢谢
此主题相关图片如下:22.png
按此在新窗口浏览图片

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


加好友 发短信
等级:论坛游民 帖子:178 积分:0 威望:0 精华:0 注册:2016/10/17 16:49:11
  发帖心情 Post By:2016/12/9 10:44:10    Post IP:175.11.158.46[只看该作者]

能给个回复吗

 回到顶部
总数 44 上一页 1 2 3 4 5 下一页