Here’s a method to graphically display the signal status for a group of indicators as well as an algorithm for generating a consensus indicator that shows when these indicators are in sync. (by Norm North).
The below indicator compiled trend conditions on many indicators, such as the Bollinger Bands, RSI, CCI, Ease Of Movement, MACD, Money Flow Index, ROC and Stochastic. Each conditions gain a score of +5 or -5 (depending of the direction) and therefore give a global indicator with a score between 5 and 95.
5 is extremely bearish, while 95 is extremely bullish. Converted from a Metastock code following a request in the italian forum.
bolinslb = BollingerDown[20](close)
BOLInSUB= BollingerUp[20](close)
BOLInS2 = (close - BOLInSLB ) / (BOLInSUB- BOLInSLB)
//BOLInSLL
if bolins2<.05 then
bolinsll=-5
elsif bolins2>.95 then
bolinsll=5
else
bolinsll=0
endif
//CCIInS
if cci[14]>100 then
cciins=5
elsif cci[14]<-100 then
cciins=-5
else
cciins=0
endif
EMVInS2 = EaseOfMovement[10]-average[10](EaseOfMovement[10])
//EMVInSB
if emvins2<0 then
if average[10](EaseOfMovement[10])<0 then
emvinsb = -5
else
emvinsb=0
endif
else
emvinsb=0
endif
//EMVInSS
if emvins2>0 then
if average[10](EaseOfMovement[10])>0 then
emvinss=5
else
emvinss=0
endif
else
emvinss=0
endif
MACDInS2 = MACD[12,26,9](close)-average[10](MACD[12,26,9](close))
//MACDinSB
if macdins2<0 then
if average[10](MACD[12,26,9](close))<0 then
macdinsb=-5
else
macdinsb=0
endif
else
macdinsb=0
endif
//MACDInSS
If MACDInS2 > 0 then
if average[10](MACD[12,26,9](close))>0 then
macdinss=5
else
macdinss=0
endif
else
macdinss=0
endif
//MFIInS
if MoneyFlowIndex[20]>80 then
mfiins=5
elsif MoneyFlowIndex[20]<20 then
mfiins=-5
else
mfiins=0
endif
PDOInS2 = DPO[18] - average[10](DPO[18])
//PDOInSB
if pdoins2<0 then
if average[10](DPO[18])<0 then
pdoinsb=-5
else
pdoinsb=0
endif
else
pdoinsb=0
endif
//PDOInSS
if pdoins2>0 then
if average[10](DPO[18])>0 then
pdoinss=5
else
pdoinss=0
endif
else
pdoinss=0
endif
ROCInS2 = ROC[10](close) - average[10](ROC[10](close))
//ROCInSB
if rocins2<0 then
if average[10](ROC[10](close))<0 then
rocinsb=-5
else
rocinsb=0
endif
else
rocinsb=0
endif
//ROCInSS Index
if rocins2>0 then
if average[10](ROC[10](close))>0 then
rocinss=5
else
rocinss=0
endif
else
rocinss=0
endif
//RSIInS
If( RSI[14]> 70) then
rsiins=5
elsIf( RSI[14]< 30) then
rsiins=-5
else
rsiins=0
endif
//STO%dInS
if Stochastic[14,3](close)>80 then
stodins=5
elsif Stochastic[14,3](close)<20 then
stodins=-5
else
stodins=0
endif
//STO%kInS
if Stochastic[14,1](close)>80 then
stokins=5
elsif Stochastic[14,1](close)<20 then
stokins=-5
else
stokins=0
endif
InSync=50 + CCIInS+ BOLInSLL+ RSIInS+ STOkInS+ STOdInS+ MFIInS+ EMVInSB+ EMVInSS+ ROCInSS+ ROCInSB+ PDOInSS[10]+ PDOInSB[10]+ MACDInSS+ MACDInSB
return insync coloured(150,0,0) style(line,3) as "InSync Index", 5 coloured(0,168,0) as "level 5", 25 coloured(0,168,0) style(point,4) as "level 25", 50 coloured(168,168,168) as "level 0", 75 coloured(255,0,0) style(point,4) as "level 75", 95 coloured(255,0,0)
You must be logged in to post a comment.
Merci Nicolas, le problème était donc autre.
Je viens de comprendre l'origine de mon problème : le graphique n'avait tout simplement pas assez de place sur mon écran pour afficher toutes les étiquettes, et l' "Insync Index" ne s'affichait pas. Tout bête.
Bonjour. Votre code a l'air efficace. Sauriez-vous comment modifier les étiquettes qui s'affichent sur le graphique svp ? Mon problème est que j'ai les étiquettes avec les indices "inSync 95" et "level 5" qui s'affichent, alors que j'aimerais afficher l' "InSync Index" . Merci.
Bravo Nicolas ! Tu es en quelque sorte l’inventeur de Metascore…(oups je viens de lire jusqu’au bout et cela vient d’une demande d’un forum italien) J’y avais pensé mais impossible de savoir comment traduire la chose … C’est génial on va pouvoir réaliser notre propre « metascore « d’après cette base et en retirant « extratrend « qui pèse « lourd « dans metascore au point de le rendre asymétrique mais je comprends => beaucoup de stratégie et de programme automatique ne prennent que des longs…pas de shorts Une question => Pourquoi ? Merci pour toutes ces idées Arnaud