Voila ce que je voudrait faire : un mix entre Reversal point indicator et Multi Fractals ZigZag
Multi Fractals ZigZag High/Low
Reversal point indicator
En fait les signaux de Reversal point indicator PLUS le bout de code qui permet de determiner les derniers signaux pour avoir alternativement un rouge et un vert .
Soit tout ça
//PRC_Reversal point indicator | indicator
//09.04.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//https://www.prorealcode.com/topic/need-help-coding-the-following-reversal-indicator/
// LONG
//Red/Green candle (reversal)
//Bullish candle close above the open of the previous red candle
//Space to the left (the low of the last 3 candles lower than the low of the last 50 candles)
//default stochastic (8,3,3) was in the oversold area within the last 3 candles
sto = stochastic[8,3]
c1 = close[1]<open[1] and close>open
c2 = close>open[1]
c3 = lowest[3](low)<lowest[50](low)[1] or lowest[3](low)<lowest[50](low)[2] or lowest[3](low)<lowest[50](low)[3]
c4 = summation[3](sto<20)>0
long = c1 and c2 and c3 and c4
if long then
drawarrowup(barindex,lowest[3](low)) coloured(0,255,0)
endif
// SHORT
//Green/Red candle (reversal)
//Bearish candle close below the close of the previous green candle
//Space to the left (the high of the last 3 candles higher than the high of the last 50 candles)
//default stochastic (8,3,3) was in the overbought area within the last 3 candles.
c5 = close[1]>open[1] and close<open
c6 = close<open[1]
c7 = highest[3](high)>highest[50](high)[1] or highest[3](high)>highest[50](high)[2] or highest[3](high)>highest[50](high)[3]
c8 = summation[3](sto>80)>0
short = c5 and c6 and c7 and c8
if short then
drawarrowdown(barindex,highest[3](high)) coloured(255,0,0)
endif
plus ce bout de code :
//---external parameters
//cp = 20
once lastpoint = 0
ATR = averagetruerange[cp]
//---major zigzag points
if high[cp] >= highest[2*cp+1](high) then
LH = 1
else
LH = 0
endif
if low[cp] <= lowest[2*cp+1](low) then
LL = -1
else
LL = 0
endif
if LH = 1 then
TOPy = high[cp]
TOPx = barindex[cp]
endif
if LL = -1 then
BOTy = low[cp]
BOTx = barindex[cp]
endif
if LH>0 and (lastpoint=-1 or lastpoint=0) then
DRAWTEXT("░",TOPx,TOPy+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
lastpoint = 1
endif
if LL<0 and (lastpoint=1 or lastpoint=0) then
DRAWTEXT("░",BOTx,BOTy-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
lastpoint = -1
endif
j aimerais bien savoir ce que ça pourrait donner .
est que quelqu un se sent de le code , c est u peu une usina a gaz pour moi ?
@ nicolas , ça pourrait faire un tres bon nouvel indicateur pour la librairie ….
return long as “long reversal”, short as “short reversal”