Bonjour, je teste l’indicateur créé par Ivan et publié dans la librairie Range detector :
Range Detector Indicator
J’aimerais créer un indicateur simple permettant d’indiquer la première occurence créant un range. Dans l’indicateur publié, on voit cette première occurence en gris (colonne grise sur le graphique prix).
L’idée serait d’avoir un histogramme (fenêtre sous prix) à 0 passant à +1 au niveau la colonne grise.
Cela permettrait de créer des alertes sonores, emails et un screener idenfidiant la création d’un Range.
J’espère avoir été assez clair dans mon descriptif. Vous remerciant par avance pour votre aide.
Hola Quizás esto te sirva:
//-----Inputs-------------------------------------------------------------//
length=20//Minimum Range Length
mult=1//Range Width
atrLen=500//ATR Length
//------------------------------------------------------------------------//
//-----Moving average and ATR definition----------------------------------//
n=barindex
atr=averagetruerange[atrlen](close)*mult
ma=average[length,0](close)
//-----Check range--------------------------------------------------------//
count=0
for j=0 to length-1 do
if abs(close[j]-ma) > atr then
count=count+1
else
count=count
endif
next
//-----Box definition-----------------------------------------------------//
if count=0 and count[1]<>count then
//Test for overlap and change coordinates
if n[length] <= $boxright[x] then
$boxright[x]=n
signal = 0
else
$boxright[x+1]=n
signal = 1
x=x+1
endif
elsif count=0 then
$boxright[x]=n
signal = 0
endif
//------------------------------------------------------------------------//
return signal