找回密码
 立即注册

QQ登录

只需一步,快速开始

广告载入中...
查看: 206|回复: 1

指标编写问答114学习的宝藏

[复制链接]
发表于 2022-1-10 13:30 | 显示全部楼层 |阅读模式

马上注册,享用更多功能,让你轻松玩转本论坛。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
576.问:
      我想用上面的六根均线做一个六线开金叉的盘中的预警公式
ma5:MA(CLOSE,5),LINEDOT;
ma20:MA(CLOSE,20),LINEDOT;
MA34:MA(CLOSE,34),LINEDOT;
MA55:MA(CLOSE,55),LINEDOT;
ma77:MA(CLOSE,77),LINEDOT;
ma99:MA(CLOSE,99),LINEDOT;
    答(zxcv-889):
        一,
ma5:=MA(CLOSE,5),LINEDOT;
ma20:=MA(CLOSE,20),LINEDOT;
MA34:=MA(CLOSE,34),LINEDOT;
MA55:=MA(CLOSE,55),LINEDOT;
ma77:=MA(CLOSE,77),LINEDOT;
ma99:=MA(CLOSE,99),LINEDOT;
ma5>ma34 and ma34>ma55 ma55>ma77 and ma77>ma99;
        二,
ma5:=MA(CLOSE,5),LINEDOT;
ma20:=MA(CLOSE,20),LINEDOT;
MA34:=MA(CLOSE,34),LINEDOT;
MA55:=MA(CLOSE,55),LINEDOT;
ma77:=MA(CLOSE,77),LINEDOT;
ma99:=MA(CLOSE,99),LINEDOT;
ma5>ma34 and ma34>ma55 ma55>ma77 and ma77>ma99 and ma5/ma34<n;
加了一个条件:and ma5/ma34<n, N多大自己去调试.
        三,飞狐的
ma5:=MA(CLOSE,5);
ma20:=MA(CLOSE,20);
MA34:=MA(CLOSE,34);
MA55:=MA(CLOSE,55);
ma77:=MA(CLOSE,77);
ma99:=MA(CLOSE,99);
ma5>ma34 and ma34>ma55 and ma55>ma77 and ma77>ma99;



577.问:
      我想六线开金叉是象:  KDJ 的那种的才是金叉吧, 不过好像这六根均线的出现有点难,机 会少点,不过一但出现,必然是大牛股了,  那么再简化一点的用5日  34 日 99日这三根线的开金叉就可能机会多了很多吧,也是一种三线开花吧!我喜欢这种形态的
    答(股市浪子):
      均线同时交叉的几率很小,试试少几个条件的,如:
CROSS(MA5,MA34) AND CROSS(MA34,MA99);

别名: 交叉函数
所属类别: 逻辑函数  参数数量: 2

两条线交叉。
用法:
CROSS(A,B)表示当A从下方向上穿过B时返回1,否则返回0
例如:
CROSS(MA(CLOSE,10),MA(CLOSE,20))表示10日均线与20日均线交金叉



578.问:
CROSS(MA5,MA34) AND CROSS(MA34,MA99);
语句缺少分号 ?
    答(股市浪子):
你把最后那个分号抹掉,重新点一个,可能是中文标点。



579.问:
      我想搞一个 MACD 和 RSI 同时在两天之内出现底背离共振的选股公式:

A1:=BARSLAST(ref(cross("macd.diff","macd.dea"),1));
B1:=ref(c,A1+1)>c and ref("macd.diff",A1+1)<"macd.diff" and cross  ("macd.diff","macd.dea");
DRAWTEXT(FILTER(B1>0,5),0,'MACD'),COLORGREEN,ALIGN0;;
Stickline(FILTER(B1>0,5),-1,0,1,0),COLORGREEN;

A3:=BARSLAST(ref(cross("RSI.RSI1","RSI.RSI2"),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1",A3+1)<"RSI.RSI1" and cross ("RSI.RSI1","RSI.RSI2");
DRAWTEXT(FILTER(B3>0,5),-0.25,'RSI'),COLORCYAN,ALIGN0;;
Stickline(FILTER(B3>0,5),-1,-0.25,1,0),COLORCYAN;
C1:=BARSLAST(ref(cross("macd.dea","macd.diff"),1));
D1:=ref(c,C1+1)<c and ref("macd.diff",C1+1)>"macd.diff" and cross  ("macd.dea","macd.diff");
DRAWTEXT(FILTER(D1>0,5),-0.5,'MACD'),COLORwhite,ALIGN0;
Stickline(FILTER(D1>0,5),-0.5,1,1,0),COLORwhite;
C3:=BARSLAST(ref(cross("RSI.RSI2","RSI.RSI1"),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1",C3+1)>"RSI.RSI1" and cross  ("RSI.RSI2","RSI.RSI1");
DRAWTEXT(FILTER(D3>0,5),0.25,'RSI'),COLORMAGENTA,ALIGN0;
Stickline(FILTER(D3>0,5),1,0.25,1,0),COLORMAGENTA;
   答(馨芸):
xx1:=(count(FILTER(B1>0,5),2)>=1)*2;
xx2:=count(FILTER(B3>0,5),2)>=1;
xx3:=(xx1=2 and xx2=1)*5;
xx4:ref(xx3,1)=0 and xx3=5;
  答(achen):
      {底背共振}
A1:=BARSLAST(ref(cross("macd.diff","macd.dea"),1));
B1:=ref(c,A1+1)>c and ref("macd.diff",A1+1)<"macd.diff" and cross  ("macd.diff","macd.dea");
A3:=BARSLAST(ref(cross("RSI.RSI1","RSI.RSI2"),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1",A3+1)<"RSI.RSI1" and cross ("RSI.RSI1","RSI.RSI2");
xx1:=(count(FILTER(B1>0,5),2)>=1)*2;
xx2:=count(FILTER(B3>0,5),2)>=1;                        
xx3:=(xx1=2 and xx2=1)*5;
底背共振:ref(xx3,1)=0 and xx3=5;



580.问:
★下影:=(MIN(CLOSE,OPEN)-LOW)/(HIGH-LOW)>0.667;
★上影:=(HIGH-MAX(CLOSE,OPEN))/(HIGH-LOW)>0.667;
★十字:=CLOSE=OPEN AND HIGH/LOW >1.03;

drawtext(★下影,if(★下影=ref(★下影,1),L*0.98,L*0.99),'★長下影'),coloryellow;
drawtext(★上影,if(★上影=ref(★上影,1),H*1.005,H*1.01),'★長上影'),colorgreen;
drawtext(★十字,if(★十字=ref(★十字,1),(H+c)/2*1.005,(H+c)/2*1.01),'★長十字'),colorwhite;
     我想只要上下影线的线的升跌幅超过了   2.6%  才发出信号来(如果能够加上前三天的 K 线组合总加起来升跌幅达七个点才发出信号)
     长十字星的上下线是大于三个点(上面三个点,下面三个点)
    答(馨芸):
      用影线做讯号是危险的,这不便帮你
      要讯号可参这个
      黄线,绿线是抄底,红线是追涨
      蓝线是逃顶
      黄线,绿线讯号太多时,可试着调整
vertline(攻擊>50),colorgreen;  50- - - ->60, 70,80……
vertline(出擊>60),coloryellow;60 - - - ->70, 80,90……
          原码
n:=40;
VAR1:=EMA(HHV(HIGH,120),21);
VAR2:=EMA(HHV(HIGH,60),21);
VAR3:=EMA(HHV(HIGH,30),21);
VAR4:=EMA(LLV(LOW,120),21);
VAR5:=EMA(LLV(LOW,60),21);
VAR6:=EMA(LLV(LOW,30),21);
VAR7:=EMA((VAR4*0.96+VAR5*0.96+VAR6*0.96+VAR1*0.558+VAR2*0.558+VAR3*0.558)/6,21);
VAR8:=EMA((VAR4*1.25+VAR5*1.23+VAR6*1.2+VAR1*0.55+VAR2*0.55+VAR3*0.65)/6,21);
VAR9:=EMA((VAR4*1.3+VAR5*1.3+VAR6*1.3+VAR1*0.68+VAR2*0.68+VAR3*0.68)/6,21);
VARA:=EMA((VAR7*3+VAR8*2+VAR9)/6*1.738,21);
VARB:=REF(LOW,1);
VARC:=SMA(ABS(LOW-VARB),3,1)/SMA(MAX(LOW-VARB,0),3,1)*100;
VARD:=EMA(IF(CLOSE*1.35<=VARA,VARC*10,VARC/10),3);
VARE:=LLV(LOW,30);
VARF:=HHV(VARD,30);
VAR10:=IF(MA(CLOSE,58),1,0);
MID:=REF(HIGH+LOW,1)/2;
VAR12:=SUM(MAX(0,HIGH-MID),N)/SUM(MAX(0,MID-LOW),N)*100 ;
CR:=IF(VAR12<230,VAR12,230),COLORcyan;
VAR11:=EMA(IF(LOW<=VARE,(VARD+VARF*2)/2,0),3)/618*VAR10;
VAR13:=IF(VAR11>115,115,VAR11);
VAR14:=IF(VAR12<24.5,24.5,VAR12);
攻擊:=IF(VAR12<60 AND VAR11>10,5500/VAR14,0),COLORGREEN;
vertline(攻擊>50),colorgreen;
出擊:=IF(VAR13>20,VAR13*2,0),COLORYELLOW;
vertline(出擊>60),coloryellow;
趨勢線:= ((3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA (SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1)-50) *1.032+50)*2,COLORRED;
買入:= IF(CROSS(趨勢線,30),150,0),COLORWHITE;
vertline(買入),COLORred;
賣出:= IF(CROSS(190,趨勢線),150,220),COLORFFAA00;
vertline(賣出<>220),COLORFFAA00;
  问:
      上影线和下影线的 K 线信号,因为我是以看 k 线组图为主的,有一个明显一点的短线炒底和短线走人的信号会对我有帮助的,我喜欢在上影线走人,在下影线抢货的,
   答(馨芸):
★下影:=(MIN(CLOSE,OPEN)-LOW)/(HIGH-LOW)>0.667;
★上影:=(HIGH-MAX(CLOSE,OPEN))/(HIGH-LOW)>0.667;
★十字:=CLOSE=OPEN AND HIGH/LOW >1.03;
★垂死十字:=CLOSE=OPEN AND CLOSE=LOW AND CLOSE<>HIGH;
drawtext(★下影,if(★下影=ref(★下影,1),L*0.98,L*0.99),'★長下影'),coloryellow;
drawtext(★上影,if(★上影=ref(★上影,1),H*1.005,H*1.01),'★長上影'),colorgreen;
drawtext(★十字,if(★十字=ref(★十字,1),(H+c)/2*1.005,(H+c)/2*1.01),'★長十字'),colorwhite;
drawtext(★垂死十字,if(★垂死十字=ref(★垂死十字,1),(L+c)/2*1.005, (L+c)/2*1.01),'★垂死十字'),colorff9900;

vertline((MIN(CLOSE,OPEN)-LOW)/(LOW)>0.026),colormagenta;
vertline((HIGH-MAX(CLOSE,OPEN))/(HIGH)>0.026),colorff9900;
aa:10*((c-llv(c,3))/llv(c,3)*100>7)coloryellow;
bb:20*((HHV(C,3)-C)/HHV(C,3)*100>7)colorwhite;

AC:=C;
AH:=H;
AL:=L;
AO:=O;
STICKLINE(AC>=AO,AH,AC,1,0),color225588;
STICKLINE(AC>=AO,AH,AC,0,0),color66ccff;
STICKLINE(AC>=AO,AO,AL,1,0),color225588;
STICKLINE(AC>=AO,AO,AL,0,0),color66ccff;

STICKLINE(AC>AO,AC,AO,8,0),COLOR225588;
STICKLINE(AC>AO,AC,AO,7,0),COLOR226699;
STICKLINE(AC>AO,AC,AO,6,0),COLOR3377aa;
STICKLINE(AC>AO,AC,AO,5,0),COLOR3388bb;
STICKLINE(AC>AO,AC,AO,4,0),COLOR4499cc;
STICKLINE(AC>AO,AC,AO,3,0),COLOR44aadd;
STICKLINE(AC>AO,AC,AO,2,0),COLOR55bbee;
STICKLINE(AC>AO,AC,AO,1,0),COLOR66ccff;

STICKLINE(AC<=AO,AH,AC,1,0),color888800;
STICKLINE(AC<=AO,AH,AC,0,0),colorffff00;
sTICKLINE(AC<=AO,AO,AL,1,0),color888800;
STICKLINE(AC<=AO,AO,AL,0,0),colorffff00;

STICKLINE(AC<=AO,AC,AO,8,0),COLOR888800;
STICKLINE(AC<=AO,AC,AO,7,0),COLOR999900;
STICKLINE(AC<=AO,AC,AO,6,0),COLORaaaa00;
STICKLINE(AC<=AO,AC,AO,5,0),COLORbbbb00;
STICKLINE(AC<=AO,AC,AO,4,0),COLORcccc00;
STICKLINE(AC<=AO,AC,AO,3,0),COLORdddd00;
STICKLINE(AC<=AO,AC,AO,2,0),COLOReeee00;
STICKLINE(AC<=AO,AC,AO,1,0),COLORffff00;


 楼主| 发表于 2022-1-10 13:32 | 显示全部楼层
这个帖子值得一读,都是实用的东西,可以举一反三
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|股海明灯官网 ( 京ICP备18020431号 )

GMT+8, 2024-11-23 03:15 , Processed in 0.113745 second(s), Total 12, Slave 11 queries , Gzip On, MemCached On.

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

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