金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
楼主: 先生

帮我写下 谢谢

[复制链接]

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-15 08:42 | 显示全部楼层
需要明确以下:
1.你这个触碰均线 就是指最高或者最低碰到 而不是收盘价?
2.你20楼说的情况:如果第一次触及K后,后续K都不再触及了但是满足阴阳线条件 那开不开仓呢你是只判断到第三根K 还是一致延续判断下去呢?因为第三根K可能也不满足,可能要到第四,第五...第N个K才满足。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

10

主题

66

帖子

66

积分

等级: 免费版

注册:
2021-7-23
曾用名:
 楼主| 发表于 2022-11-15 10:03 | 显示全部楼层
技术009 发表于 2022-11-15 08:42
需要明确以下:
1.你这个触碰均线 就是指最高或者最低碰到 而不是收盘价?
2.你20楼说的情况:如果第一次 ...

1.触碰均线 就是指最高或者最低碰到 而不是收盘价。
2.第一次k触及后  后续k触及或者不触及 只要满意阴阳线的条件 就可以开仓,只要趋势均线方向没有改变 就可以一直判断 。如果均线拐头趋势也就不成立了,
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-15 10:57 | 显示全部楼层
[PEL] 复制代码
variable:len1:=0,len2:=0;
ema30:ema(c,30),colorwhite;
 
 
ktxs:=ema30>ref(ema30,1) and ref(ema30,1)>ref(ema30,2);//拐头向上
ktxx:=ema30<ref(ema30,1) and ref(ema30,1)<ref(ema30,2);//拐头向下
 
 
if ktxs or (not(ktxs or ktxx) and len1<>0)  then len1:=len1+1;//仅在红绿转换时候进行 拐头的切换,否则沿用最近的拐头方向,这样做是因为一个趋势中间个别突破的K会造成趋势断开。
if ktxx  then len1:=0;
 
if ktxx or (not(ktxs or ktxx) and len2<>0) then len2:=len2+1;
if ktxs then len2:=0;
 
if ktxs or (not(ktxs or ktxx) and len1<>0) then red:ema30,colorred;
if ktxx or (not(ktxs or ktxx) and len2<>0) then green:ema30,colorgreen;
 
jc:cross(h,ema30);
sc:cross(ema30,l);

lenj:=BARSLAST(jc);
lens:=BARSLAST(sc);



if lens<len1 and lens>0 and  len1>0 and isup  and (TYPEBAR(2,1)>len1  or  TYPEBAR(2,1)=-1) then buy(holding=0,1,market);
if lenj<len2 and lenj>0 and len2>0 and  isdown  and (TYPEBAR(2,3)>len1  or  TYPEBAR(2,3)=-1) then buyshort(holding=0,1,market);
 
 
hc:hhv(h,len1),nodraw;//多趋势最大的C
lc:llv(l,len2),nodraw;
 
if c>hc then dzy:sell(1,holding,market);
if c<lc then kzy:sellshort(1,holding,market);
 
if len2>0 then dzs:sell(1,holding,market);
if len1>0 then kzs:sellshort(1,holding,market);
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

10

主题

66

帖子

66

积分

等级: 免费版

注册:
2021-7-23
曾用名:
 楼主| 发表于 2022-11-15 11:59 | 显示全部楼层
技术009 发表于 2022-11-15 10:57
[mw_shl_code=pel,true]variable:len1:=0,len2:=0;
ema30:ema(c,30),colorwhite;

刚试了下  有两处地方 错了
1. 开仓问题
开空条件 第一次k最高价触及均线 第二根k满足阴线或者后面k 但收盘价要在均线之下 且均线趋势没有改变 开仓做空 。 开多也是一样的第一次k最低价触及均线 第二根k或者后面k满足阳线 但收盘价要在均线之上 且均线趋势没有改变 开仓做多 。
2.止盈问题
止盈在图表上并没有在 趋势最高或者最低收盘价止盈 01.jpg
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-15 12:09 | 显示全部楼层
本帖最后由 技术009 于 2022-11-15 12:13 编辑

你在条件里自行补下收盘价的判断就行了。
止盈止损判定都是用的c去判断的,下单价格不是限价 是市价。你改下判断条件用h和l,或者你如果是指用止盈止损价作为平仓价格的话,你平仓价格改成限价就行了。你按你意思去改下就行,你之前描述没说是按照这个价格作为平仓价格。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

10

主题

66

帖子

66

积分

等级: 免费版

注册:
2021-7-23
曾用名:
 楼主| 发表于 2022-11-15 13:38 | 显示全部楼层
技术009 发表于 2022-11-15 12:09
你在条件里自行补下收盘价的判断就行了。
止盈止损判定都是用的c去判断的,下单价格不是限价 是市价。你改 ...

判断条件用h和l我试了不行。越改越乱    就开仓问题跟 止盈问题这两个在帮我完善下吧  辛苦 辛苦  最后一次
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-15 13:44 | 显示全部楼层
直接明确下:
止盈止损 怎样算满足条件。我前面记录了那个价格,比如是多头区间的H1。
你要明确说明下:止盈的判断条件(以当前K的H 还是C 大于时候算满足)+止盈时候平仓的委托价格(市价 还是 用限价用H1委托出去)。

金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

10

主题

66

帖子

66

积分

等级: 免费版

注册:
2021-7-23
曾用名:
 楼主| 发表于 2022-11-15 14:17 | 显示全部楼层
技术009 发表于 2022-11-15 13:44
直接明确下:
止盈止损 怎样算满足条件。我前面记录了那个价格,比如是多头区间的H1。
你要明确说明下: ...

止盈的判断条件(以当前K的H 最高价 大于等于时候算满足)+止盈时候平仓的委托价格是市价
止损 就是均线拐头就平仓
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-15 15:10 | 显示全部楼层
[PEL] 复制代码
variable:len1:=0,len2:=0;
ema30:ema(c,30),colorwhite;
  
  
ktxs:=ema30>ref(ema30,1) and ref(ema30,1)>ref(ema30,2);//拐头向上
ktxx:=ema30<ref(ema30,1) and ref(ema30,1)<ref(ema30,2);//拐头向下
  
  
if ktxs or (not(ktxs or ktxx) and len1<>0)  then len1:=len1+1;//仅在红绿转换时候进行 拐头的切换,否则沿用最近的拐头方向,这样做是因为一个趋势中间个别突破的k会造成趋势断开。
if ktxx  then len1:=0;
  
if ktxx or (not(ktxs or ktxx) and len2<>0) then len2:=len2+1;
if ktxs then len2:=0;
  
if ktxs or (not(ktxs or ktxx) and len1<>0) then red:ema30,colorred;
if ktxx or (not(ktxs or ktxx) and len2<>0) then green:ema30,colorgreen;
  
jc:cross(h,ema30);
sc:cross(ema30,l);
 
lenj:=barslast(jc);
lens:=barslast(sc);
 
 
hc:hhv(c,len1),nodraw;//多趋势最大的c
lc:llv(c,len2),nodraw;
  
if h>hc then dzy:sell(1,holding,market);
if l<lc then kzy:sellshort(1,holding,market);
  
if len2>0 then dzs:sell(1,holding,market);
if len1>0 then kzs:sellshort(1,holding,market);

scct:=count(sc,typebar(1,1));
jcct:=count(jc,typebar(1,3));

if lens<len1 and lens>0 and  len1>0 and (scct>=1 or typebar(1,1)=-1) and isup  and (typebar(2,1)>len1  or typebar(2,1)=-1) and c>ema30 then buy(holding=0,1,market);
if lenj<len2 and lenj>0 and len2>0 and (jcct>=1 or typebar(1,3)=-1) and isdown  and (typebar(2,3)>len1  or typebar(2,3)=-1) and c<ema30 then buyshort(holding=0,1,market);
  
  
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

10

主题

66

帖子

66

积分

等级: 免费版

注册:
2021-7-23
曾用名:
 楼主| 发表于 2022-11-16 17:10 | 显示全部楼层
技术009 发表于 2022-11-15 15:10
[mw_shl_code=pel,true]variable:len1:=0,len2:=0;
ema30:ema(c,30),colorwhite;
  

之前是 多头空头趋势中达到条件的 都开仓两次然后等待下一轮的趋势。   这个在代码里 怎么修改  我想多头空头都只开仓一次就够了  是修改哪里的参数呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-6-9 06:38 , Processed in 0.159620 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表