金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
12
返回列表 发新帖
楼主: MR.C

请问这些编写是什么意思??请详细说明指导一下,谢谢

[复制链接]

9

主题

37

帖子

37

积分

Rank: 1

等级: 新手上路

注册:
2021-7-16
曾用名:
 楼主| 发表于 2021-7-16 10:12 | 显示全部楼层
技术009 发表于 2021-7-16 09:58
你可以不加的。因为你这里写的几个语句,都是不输出指标线的。实际上加不加无所谓。你如果要看盘,肉眼观察 ...

J70:=stkindi('','KDJ.J',0,7),noaxis;
CCI70:=stkindi('','CCI.CCI',0,7),noaxis;
J71:=stkindi('','KDJ.J',0,7,-1),noaxis;
CCI71:=stkindi('','CCI.CCI',0,7,-1),noaxis;
J72:=stkindi('','KDJ.J',0,7,-2),noaxis;
CCI72:=stkindi('','CCI.CCI',0,7,-2),noaxis;

DIFF70:=stkindi('','MACD.DIFF',0,7),noaxis;
DEA70:=stkindi('','MACD.DEA',0,7),noaxis;
DIFF71:=stkindi('','MACD.DIFF',0,7,-1),noaxis;
DEA71:=stkindi('','MACD.DEA',0,7,-1),noaxis;
DIFF72:=stkindi('','MACD.DIFF',0,7,-2),noaxis;
DEA72:=stkindi('','MACD.DEA',0,7,-2),noaxis;

DIFF0:=stkindi('','MACD.DIFF',0, datatype);
DEA0:=stkindi('','MACD.DEA',0, datatype);
DIFF1:=stkindi('','MACD.DIFF',0, datatype,-1);
DEA1:=stkindi('','MACD.DEA',0, datatype,-1);
DIFF2:=stkindi('','MACD.DIFF',0, datatype,-2);
DEA2:=stkindi('','MACD.DEA',0, datatype,-2);

k0:=stkindi('','KDJ.k',0, datatype);
k1:=stkindi('','KDJ.k',0, datatype,-1);
k2:=stkindi('','KDJ.k',0, datatype,-2);

d0:=stkindi('','KDJ.d',0, datatype);
d1:=stkindi('','KDJ.d',0, datatype,-1);
d2:=stkindi('','KDJ.d',0, datatype,-2);

J0:=stkindi('','KDJ.J',0, datatype);
J1:=stkindi('','KDJ.J',0, datatype,-1);
J2:=stkindi('','KDJ.J',0, datatype,-2);

MA10:=stkindi('','MA.MA1',0, datatype);
MA11:=stkindi('',' MA.MA1',0, datatype,-1);
MA12:=stkindi('',' MA.MA1',0, datatype,-2);

MA20:=stkindi('','MA.MA2',0, datatype);
MA21:=stkindi('',' MA.MA2',0, datatype,-1);
MA22:=stkindi('',' MA.MA2',0, datatype,-2);

CCI0:=stkindi('','CCI.CCI',0, datatype);
CCI1:=stkindi('','CCI.CCI',0, datatype,-1);

UPPER0:=stkindi('','BOLL.UPPER',0, datatype);
UPPER1:=stkindi('','BOLL.UPPER',0, datatype,-1);
UPPER2:=stkindi('','BOLL.UPPER',0, datatype,-2);
UPPER3:=stkindi('','BOLL.UPPER',0, datatype,-3);
UPPER4:=stkindi('','BOLL.UPPER',0, datatype,-4);
UPPER5:=stkindi('','BOLL.UPPER',0, datatype,-5);

LOWER0:=stkindi('','BOLL.LOWER',0, datatype);
LOWER1:=stkindi('','BOLL.LOWER',0, datatype,-1);
LOWER2:=stkindi('','BOLL.LOWER',0, datatype,-2);
LOWER3:=stkindi('','BOLL.LOWER',0, datatype,-3);
LOWER4:=stkindi('','BOLL.LOWER',0, datatype,-4);
LOWER5:=stkindi('','BOLL.LOWER',0, datatype,-5);

xy:=if(c<o,c-l,o-l);
sy:=if(c<O,h-o,h-c);
pd:=if(c<o,h=o,h=c);

MACD金叉:=DIFF1<DEA1 and DIFF0>DEA0;
MACD金叉1:=DIFF2<DEA2 and DIFF1>DEA1 and DIFF0>DEA0;
MACD金叉区:=DIFF2>DEA2 and DIFF1>DEA1 and DIFF0>DEA0;

MACD死叉:=DIFF1>DEA1 and DIFF0<DEA0;
MACD死叉1:=DIFF2>DEA2 and DIFF1<DEA1 and DIFF0<DEA0;
MACD死叉区:=DIFF2<DEA2 and DIFF1<DEA1 and DIFF0<DEA0;

K1:=O/C>=1.05 AND C<O AND ((H-L)<=(O-C)*1.36 OR (H-L)=(O-C)) and REF(O,1)>LOWER1 AND REF(C,1)>LOWER1 AND REF(O,2)>LOWER2 AND REF(C,2)>LOWER2 AND J71>-5 AND CCI71>-220 AND J1>-5 AND CCI1>-220 and ((DIFF1>DEA1 and DIFF0<DEA0) or (DIFF2>DEA2 and DIFF1<DEA1 and DIFF0<DEA0) OR (MACD死叉区 and (abs(DIFF0-DEA0)>abs(DIFF1-DEA1)*1.1 or abs(DIFF0-DEA0)>abs(DIFF2-DEA2)*1.1)) OR (MACD金叉区 and (abs(DIFF0-DEA0)<abs(DIFF1-DEA1)*0.9 or abs(DIFF0-DEA0)<abs(DIFF2-DEA2)*0.9))) AND DIFF0<DIFF1;

K2:=REF(O,1)/REF(C,1)>=1.025 AND O/C>=1.025 AND REF(C,1)<REF(O,1) AND O<REF(O,1) AND C<REF(C,1) AND C<O AND ((HHV(H,2)-LLV(L,2))<=(HHV(O,2)-LLV(C,2))*1.36 OR (HHV(h,2)-LLV(l,2))=(HHV(O,2)-LLV(C,2))) and REF(O,1)>LOWER1 AND REF(C,1)>LOWER1 AND REF(O,2)>LOWER2 AND REF(C,2)>LOWER2 AND J71>-5 AND CCI71>-220 AND J1>-5 AND CCI1>-220 and ((DIFF1>DEA1 and DIFF0<DEA0) or (DIFF2>DEA2 and DIFF1<DEA1 and DIFF0<DEA0) OR (MACD死叉区 and (abs(DIFF0-DEA0)>abs(DIFF1-DEA1)*1.1 or abs(DIFF0-DEA0)>abs(DIFF2-DEA2)*1.1)) OR (MACD金叉区 and (abs(DIFF0-DEA0)<abs(DIFF1-DEA1)*0.9 or abs(DIFF0-DEA0)<abs(DIFF2-DEA2)*0.9))) AND DIFF0<DIFF1;

D1:=C/O>1.05 and c>o AND ((H-L)<=(C-O)*1.36 OR (H-L)=(C-O)) and REF(O,1)<UPPER1 AND REF(C,1)<UPPER1 AND REF(O,2)<UPPER2 AND REF(C,2)<UPPER2 AND J71<105 AND CCI71<220  AND J1<105 AND CCI1<220 and ((DIFF1<DEA1 and DIFF0>DEA0) or (DIFF2<DEA2 and DIFF1>DEA1 and DIFF0>DEA0) or (MACD金叉区 and (abs(DIFF0-DEA0)>abs(DIFF1-DEA1)*1.1 or abs(DIFF0-DEA0)>abs(DIFF2-DEA2)*1.1)) OR (MACD死叉区 and (abs(DIFF0-DEA0)<abs(DIFF1-DEA1)*0.9 or abs(DIFF0-DEA0)<abs(DIFF2-DEA2)*0.9))) AND DIFF0>DIFF1;

D2:=REF(C,1)/REF(O,1)>=1.025 and REF(c,1)>REF(o,1) AND C/O>=1.025 and c>o AND O>REF(O,1) AND C>REF(C,1) AND ((hhv(h,2)-llv(l,2))<=(hhv(C,2)-LLV(O,2))*1.36 OR (hhv(h,2)-llv(l,2))=(hhv(C,2)-LLV(O,2))) and REF(O,1)<UPPER1 AND REF(C,1)<UPPER1 AND REF(O,2)<UPPER2 AND REF(C,2)<UPPER2 AND J71<105 AND CCI71<220  AND J1<105 AND CCI1<220 and ((DIFF1<DEA1 and DIFF0>DEA0) or (DIFF2<DEA2 and DIFF1>DEA1 and DIFF0>DEA0) or (MACD金叉区 and (abs(DIFF0-DEA0)>abs(DIFF1-DEA1)*1.1 or abs(DIFF0-DEA0)>abs(DIFF2-DEA2)*1.1)) OR (MACD死叉区 and (abs(DIFF0-DEA0)<abs(DIFF1-DEA1)*0.9 or abs(DIFF0-DEA0)<abs(DIFF2-DEA2)*0.9))) AND DIFF0>DIFF1;

if holding>0 and ((C<ref(L,enterbars) AND DIFF2>DEA2 and DIFF1<DEA1 and DIFF0<DEA0) OR (C<ref(C,enterbars) AND DIFF2>DEA2 and DIFF1<DEA1 and DIFF0<DEA0) OR (C<ref(L,enterbars)*0.985) OR (C<=ref(C,enterbars)*0.96)) then 止损多单:sell(1,0,thisclose);

if holding>0 and J1>106 AND J0<J1 AND DIFF0<DIFF1 then 多单止盈1:sell(1,0,thisclose);

if holding>0 and REF(H,2)>UPPER2 AND REF(H,1)>UPPER1 AND DIFF0<DIFF1 AND UPPER0<UPPER1 then 多单止盈2:sell(1,0,thisclose);

if holding>0 and REF(H,3)>UPPER3 AND REF(H,2)>UPPER2 AND REF(H,1)>UPPER1 AND H>UPPER 0 AND C<O AND DIFF0<DIFF1 then 多单止盈3:sell(1,0,thisclose);

if holding>0 and REF(H,4)>UPPER4 AND REF(H,3)>UPPER3 AND REF(H,2)>UPPER2 AND REF(H,1)>UPPER1 AND H>UPPER0 and c<o then 多单止盈4:sell(1,0,thisclose);

if holding>0 and REF(H,1)>UPPER1 AND H>UPPER0 AND H<REF(H,1) AND L<REF(L,1) AND  C<REF(C,1) AND REF(C,1)<REF(O,1) AND C<O then 多单止盈5:sell(1,0,thisclose);

if holding<0 and ((C>ref(H,enterbars) AND DIFF2<DEA2 and DIFF1>DEA1 and DIFF0>DEA0) OR (C>ref(C,enterbars) AND DIFF2<DEA2 and DIFF1>DEA1 and DIFF0>DEA0) OR (C>ref(H,enterbars)*1.015) OR (C>=ref(C,enterbars)*1.04)) then 止损空单:sellshort(1,0,thisclose);

if holding<0 and J1<-6 AND J0>J1 AND DIFF0>DIFF1 then 空单止盈1:sellshort(1,0,thisclose);

if holding<0 and REF(L,2)<LOWER2 AND REF(L,1)<LOWER1 AND DIFF0>DIFF1 AND LOWER0>LOWER1 then 空单止盈2:sellshort(1,0,thisclose);

if holding<0 and REF(L,3)<LOWER3 AND REF(L,2)<LOWER2 AND REF(L,1)<LOWER1 AND L<LOWER0 AND C>O AND DIFF0>DIFF1 then 空单止盈3:sellshort(1,0,thisclose);

if holding<0 and REF(L,4)<LOWER4 AND REF(L,3)<LOWER3 AND REF(L,2)<LOWER2 AND REF(L,1)<LOWER1 AND L<LOWER0 and c>o then 空单止盈4:sellshort(1,0,thisclose);

if holding<0 and REF(L,1)<LOWER1 AND L<LOWER0 AND H>REF(H,1) AND L>REF(L,1) AND C>REF(C,1) AND REF(C,1)>REF(O,1) AND C>O then 空单止盈5:sell(1,0,thisclose);


if d1 or d2 then begin
sellshort(1,0,thisclose);
buy(holding=0,1,thisclose);
end

if k1 or k2 then begin
sell(1,0,thisclose);
buyshort(holding=0,1,thisclose);
end


请问以上的编写设置,语法上 是否正常?有没有错误?
谢谢老师指导!!
回复

使用道具 举报

19

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2021-7-16 10:14 | 显示全部楼层
本帖最后由 技术009 于 2021-7-16 10:15 编辑

能编译通过,语法上肯定没有问题的。引用语句也没错误。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

9

主题

37

帖子

37

积分

Rank: 1

等级: 新手上路

注册:
2021-7-16
曾用名:
 楼主| 发表于 2021-7-16 10:20 | 显示全部楼层
技术009 发表于 2021-7-16 10:14
能编译通过,语法上肯定没有问题的。

能不能达到先确认上上周、上周、当周的条件后,再确认 上上日、上日、当日的条件后,再符合设定条件后,出现买、卖提示。
请老师认真帮我看看 编写是否正确,有没有编写错误的问题??
谢谢老师指导一下!
回复

使用道具 举报

19

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2021-7-16 10:34 | 显示全部楼层
这个我没法直接判断。我不可能给你代码一句句理清楚的。而且你这里的代码 远比你这里简单的一句话描述的要复杂混乱的多。写了那么多调用,很多竟然在后面根本没用到。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-16 10:17 , Processed in 0.290883 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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