金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
楼主: 先生

帮我写下 谢谢

[复制链接]

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-17 08:44 | 显示全部楼层
[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);
 

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 02:32 , Processed in 0.188912 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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