金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 745|回复: 2

wh8的代码 求转为金字塔可用

[复制链接]

4

主题

10

帖子

10

积分

Rank: 1

等级: 新手上路

注册:
2023-2-7
曾用名:
发表于 2023-11-30 07:53 | 显示全部楼层 |阅读模式
VARIABLE:XTREND:=0,TREND2:=0,XU:=0,XU1:=0,XU2:=0,XU3:=0,CL:=0,OP:=0,LL:=0,HH:=0,SPJ:=0;

IF BARPOS=1 AND CLOSE>=OPEN THEN
BEGIN
  XTREND:=1;
  TREND2:=XTREND;
  XU:=CLOSE;
  XU1:=OPEN;
  XU2:=OPEN;
  XU3:=OPEN;
  CL:=XU;
  OP:=XU1;
  LL:=OP;
  HH:=CL;
END

IF BARPOS=1 AND CLOSE<OPEN THEN
BEGIN
  XTREND:=0;
  TREND2:=XTREND;
  XU:=CLOSE;
  XU1:=OPEN;
  XU2:=OPEN;
  XU3:=OPEN;
  CL:=XU;
  OP:=XU1;
  LL:=CL;
  HH:=OP;
END

IF BARPOS>1 AND XTREND=1 AND CLOSE>XU THEN
BEGIN
   TREND2:=XTREND;
   XU3:=XU2;
   XU2:=XU1;
   XU1:=XU;
   XU:=CLOSE;
   CL:=XU;
   OP:=XU1;
   LL:=OP;
   HH:=CL;
END

IF BARPOS>1 AND XTREND=1 AND CLOSE<XU3 THEN
BEGIN
   XTREND:=0;
   TREND2:=XTREND;
   XU:=CLOSE;
   XU2:=XU1;
   XU3:=XU1;
   CL:=XU;
   OP:=XU1;
   LL:=CL;
   HH:=OP;
END

IF BARPOS>1 AND XTREND=1 AND (CLOSE>XU)=0 AND (CLOSE<XU3)=0 THEN
BEGIN
   TREND2:=XTREND;
   CL:=REF(CL,1);
   OP:=REF(OP,1);
   LL:=REF(LL,1);
   HH:=REF(HH,1);
END

IF BARPOS>1 AND XTREND<>1 AND CLOSE>XU3 THEN
BEGIN
   XTREND:=1;
   TREND2:=XTREND;
   XU:=CLOSE;
   XU2:=XU1;
   XU3:=XU1;
   CL:=XU;
   OP:=XU1;
   LL:=OP;
   HH:=CL;
END

IF BARPOS>1 AND XTREND<>1 AND CLOSE<XU THEN
BEGIN
   TREND2:=XTREND;
   XU3:=XU2;
   XU2:=XU1;
   XU1:=XU;
   XU:=CLOSE;
   CL:=XU;
   OP:=XU1;
   LL:=CL;
   HH:=OP;
END

IF BARPOS>1 AND XTREND<>1 AND (CLOSE>XU3)=0 AND (CLOSE<XU)=0 THEN
BEGIN
   TREND2:=XTREND;
   CL:=REF(CL,1);
   OP:=REF(OP,1);
   LL:=REF(LL,1);
   HH:=REF(HH,1);
END

回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-11-30 09:12 | 显示全部楼层
[PEL] 复制代码
variable:xtrend:=0,trend2:=0,xu:=0,xu1:=0,xu2:=0,xu3:=0,cl:=0,op:=0,ll:=0,hh:=0,spj:=0;

if barpos=1 and close>=open then
begin
  xtrend:=1;
  trend2:=xtrend;
  xu:=close;
  xu1:=open;
  xu2:=open;
  xu3:=open;
  cl:=xu;
  op:=xu1;
  ll:=op;
  hh:=cl;
end

if barpos=1 and close<open then
begin
  xtrend:=0;
  trend2:=xtrend;
  xu:=close;
  xu1:=open;
  xu2:=open;
  xu3:=open;
  cl:=xu;
  op:=xu1;
  ll:=cl;
  hh:=op;
end

if barpos>1 and xtrend=1 and close>xu then
begin
   trend2:=xtrend;
   xu3:=xu2;
   xu2:=xu1;
   xu1:=xu;
   xu:=close;
   cl:=xu;
   op:=xu1;
   ll:=op;
   hh:=cl;
end

if barpos>1 and xtrend=1 and close<xu3 then
begin
   xtrend:=0;
   trend2:=xtrend;
   xu:=close;
   xu2:=xu1;
   xu3:=xu1;
   cl:=xu;
   op:=xu1;
   ll:=cl;
   hh:=op;
end

last_cl:=ref(cl,1);
last_op:=ref(op,1);
last_ll:=ref(ll,1);
last_hh:=ref(hh,1);


if barpos>1 and xtrend=1 and (close>xu)=0 and (close<xu3)=0 then
begin
   trend2:=xtrend;
   cl:=last_cl;
   op:=last_op;
   ll:=last_ll;
   hh:=last_hh;
end

if barpos>1 and xtrend<>1 and close>xu3 then
begin
   xtrend:=1;
   trend2:=xtrend;
   xu:=close;
   xu2:=xu1;
   xu3:=xu1;
   cl:=xu;
   op:=xu1;
   ll:=op;
   hh:=cl;
end

if barpos>1 and xtrend<>1 and close<xu then
begin
   trend2:=xtrend;
   xu3:=xu2;
   xu2:=xu1;
   xu1:=xu;
   xu:=close;
   cl:=xu;
   op:=xu1;
   ll:=cl;
   hh:=op;
end

last_cl:=ref(cl,1);
last_op:=ref(op,1);
last_ll:=ref(ll,1);
last_hh:=ref(hh,1);


if barpos>1 and xtrend<>1 and (close>xu3)=0 and (close<xu)=0 then
begin
   trend2:=xtrend;
   cl:=last_cl;
   op:=last_op;
   ll:=last_ll;
   hh:=last_hh;
end

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

使用道具 举报

4

主题

10

帖子

10

积分

Rank: 1

等级: 新手上路

注册:
2023-2-7
曾用名:
 楼主| 发表于 2023-11-30 11:27 | 显示全部楼层
谢谢!
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-8-2 11:21 , Processed in 0.095597 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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