江恩多空轮中轮主图指标公式[其他软件公式]
这段代码是一个基于交易数据的技术指标的计算公式,大致的运算思路如下:
根据输入参数决定最近交易日数N。
分别计算N天内的最高价HH和最低价LL。
判断最近N天内的最高价和最低价对应的日期,得出该期间多空情况。
在图表上以垂直线的形式标注出该日期,并标注出 HH 和 LL 价格对应的水平线。
INPUT:最近天(30,1,360);当前月:=FRACPART(ROUND(当前日期/100)/100)*100;
月:=MONTH;日:=DAY;
N:=if(sysparam(1)=datacount,最近天,datacount-sysparam(1)+1);
HH:=HHV(HIGH,N);
LL:=LLV(LOW,N);
VN:=N;
IF VN>DATACOUNT THEN
VN=DATACOUNT+1;
FOR I=DATACOUNT DOWNTO DATACOUNT-VN+1 DO BEGIN
HH[I]:=HH[DATACOUNT];
LL[I]:=LL[DATACOUNT];
END;
TMP:=SETLBOUND(hh,DATACOUNT-VN+1);
TMP:=SETLBOUND(ll,DATACOUNT-VN+1);
KKH:=BARSLAST(H=HH);
KKL:=BARSLAST(L=LL);
N低日:=STRTONUM(NUMTOSTR(REF(DATE,KKL),0));
N高日:=STRTONUM(NUMTOSTR(REF(DATE,KKH),0));
多空:=IF(N低日>N高日,2,1),LINETHICK0;
DATE1:=IF(多空=1,N低日,N高日);
LLOW:=ref(LOW,BARSLAST(DATE1=DATE));
H1:=STRTONUM(NUMTOSTR(hh,2));
L1:=STRTONUM(NUMTOSTR(LLOW,2));
VERTLINE(DATE=DATE1),COLORFFAAAA,LINETHICK1;
{DRAWTEXT(DATE=DATE1,SYSPARAM(4)*0.95,'起\n \n\n测\n \n点'),COLORFFFFFF;}
IF 多空=1 THEN BEGIN
PARTLINE(DATE>N低日,L1),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.042),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.083),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.125),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.167),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.208),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.25),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.292),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.33),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.375),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.417),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.458),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.5),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.542),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.583),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.625),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.667),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.708),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.75),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.792),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.833),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.875),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.917),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.958),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*2),COLORMAGENTA;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1+0.002,NUMTOSTR(L1,2)+' 0 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.042+0.002,NUMTOSTR(L1*1.042,2)+' 15 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.083+0.002,NUMTOSTR(L1*1.083,2)+' 30 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.125+0.002,NUMTOSTR(L1*1.125,2)+' 45 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.167+0.002,NUMTOSTR(L1*1.167,2)+' 60 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.208+0.002,NUMTOSTR(L1*1.208,2)+' 75 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.25+0.002,NUMTOSTR(L1*1.25,2)+' 90 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.292+0.002,NUMTOSTR(L1*1.292,2)+' 105 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.33+0.002,NUMTOSTR(L1*1.33,2)+' 120 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.375+0.002,NUMTOSTR(L1*1.375,2)+' 135 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.417+0.002,NUMTOSTR(L1*1.417,2)+' 150 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.458+0.002,NUMTOSTR(L1*1.458,2)+' 165 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.5+0.002,NUMTOSTR(L1*1.5,2)+' 180 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.542+0.002,NUMTOSTR(L1*1.542,2)+' 195 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.583+0.002,NUMTOSTR(L1*1.583,2)+' 210 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.625+0.002,NUMTOSTR(L1*1.625,2)+' 225 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.667+0.002,NUMTOSTR(L1*1.667,2)+' 240 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.708+0.002,NUMTOSTR(L1*1.708,2)+' 255 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.75+0.002,NUMTOSTR(L1*1.75,2)+' 270 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.792+0.002,NUMTOSTR(L1*1.792,2)+' 285 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.833+0.002,NUMTOSTR(L1*1.833,2)+' 290 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.875+0.002,NUMTOSTR(L1*1.875,2)+' 315 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.917+0.002,NUMTOSTR(L1*1.917,2)+' 330 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.958+0.002,NUMTOSTR(L1*1.958,2)+' 345 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*2+0.002,NUMTOSTR(L1*2,2)+' 360 '),COLORWHITE,ALIGN2;
END;
ELSE BEGIN
PARTLINE(DATE>N高日,H1),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.042),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.083),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.125),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.167),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.208),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.25),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.292),COLORFFFF99,LINEDOT;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容