Buenas:
Paso indicador de Tradingview para su conversión a ProRealTime, si es posible.
Double Top/Bottom [AlgoAlpha]
Muchas gracias,
Buenas tardes. No hay ninguna captura de pantalla mostrando ejemplos del indicador ni tampoco el código de éste.
Me temo que no te podré ayudar así…
Buenas. Aquí lo tienes:
//----------------------------------------------------------//
//----------------------------------------------------------//
// inputs
//----------------------------------------------------------//
x=21 // time horizon
src=close
onlysignals=0
//----------------------------------------------------------//
//----------------------------------------------------------//
limit1=average[100](abs(open-close))
//Pivots low
if src > src[x] and lowest[x](src) > src[x] and src[x] < lowest[x](src)[x+1] then
$pivoty[n+1] = src[x]
$pivotx[n+1] = barindex[x]
$pivotdir[n+1] = -1
//drawpoint(barindex[x],src[x],2)coloured("red",180)
n=n+1
endif
//Pivots high
if src < src[x] and highest[x](src)<src[x] and src[x]>highest[x](src)[x+1] then
$pivoty[n+1] = src[x]
$pivotx[n+1] = barindex[x]
$pivotdir[n+1] = 1
//drawpoint(barindex[x],src[x],2)coloured("blue",180)
n=n+1
endif
//----------------------------------------------------------//
// Limit
//----------------------------------------------------------//
limit1=average[100](abs(open-close))
//----------------------------------------------------------//
//
//----------------------------------------------------------//
if n>3 then
if n<>n[1] and $pivotdir[n]<0 and $pivotdir[n-1]>0 and $pivotdir[n-2]<0 and $pivotdir[n-3]>0 and abs(close[x]-$pivoty[n-2])<limit1 then
trigger=$pivoty[n]
drawarrowup($pivotx[n],$pivoty[n])coloured("green")
if onlysignals=0 then
drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n],$pivoty[n])coloured("green")
drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n-2],$pivoty[n-2])coloured("green")
drawsegment($pivotx[n-3],$pivoty[n-3],$pivotx[n-2],$pivoty[n-2])coloured("green")
endif
awaitingDBC=1
Bthresh=$pivoty[n-1]
Bthreshidx=$pivotx[n-1]
endif
if n<>n[1] and $pivotdir[n]>0 and $pivotdir[n-1]<0 and $pivotdir[n-2]>0 and$pivotdir[n-3]<0 and abs(close[x]-$pivoty[n-2])<limit1 then
trigger=$pivoty[n]
drawarrowdown($pivotx[n],$pivoty[n])coloured("red")
if onlysignals=0 then
drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n],$pivoty[n])coloured("red")
drawsegment($pivotx[n-1],$pivoty[n-1],$pivotx[n-2],$pivoty[n-2])coloured("red")
drawsegment($pivotx[n-3],$pivoty[n-3],$pivotx[n-2],$pivoty[n-2])coloured("red")
endif
awaitingDTC=1
Tthresh=$pivoty[n-1]
Tthreshidx=$pivotx[n-1]
endif
endif
if awaitingDBC and onlysignals=0 then
barsDBC=barsDBC+1
if close < bthresh and barsDBC>x then
awaitingDBC=0
drawsegment(bthreshidx,bthresh,barindex,bthresh)coloured("green")style(dottedline)
drawpoint(barindex,bthresh,3)coloured("orange")
elsif close > bthresh then
awaitingDBC=0
drawsegment(bthreshidx,bthresh,barindex,bthresh)coloured("green")style(dottedline)
endif
endif
if awaitingDTC and onlysignals=0 then
barsDTC=barsDTC+1
if close > Tthresh and barsDTC>x then
awaitingDTC=0
drawsegment(Tthreshidx,Tthresh,barindex,Tthresh)coloured("red")style(dottedline)
drawpoint(barindex,Tthresh,3)coloured("orange")
elsif close < Tthresh then
awaitingDTC=0
drawsegment(Tthreshidx,Tthresh,barindex,Tthresh)coloured("red")style(dottedline)
endif
endif
//----------------------------------------------------------//
return
Hola:
Acabo de verlo y voy a probarlo seguidamente, estoy seguro que va a ser bueno para todos.
Muchísimas gracias, de nuevo.
el foro