Estoy intentando adaptar a Prorealtimev10.3 este ineteresante indicador aparecido en la plataforma Tradingview :https://es.tradingview.com/script/5ylLrNiE-DeMark-Pivot-Points/
¿Alguién puede ayudar en la adaptación ? no doy con ello.El código es:
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 15/05/2017
// Demark Pivot Points start with a different base and use different formulas for support
// and resistance. These Pivot Points are conditional on the relationship between the
// close and the open.
////////////////////////////////////////////////////////////
study(title=”DeMark Pivot Points”, shorttitle=”Pivot Point”, overlay = true)
width = input(2, minval=1)
xHigh = security(tickerid,”D”, high[1])
xLow = security(tickerid,”D”, low[1])
xClose = security(tickerid,”D”, close[1])
xOpen = security(tickerid,”D”, open[1])
xP = iff(xClose < xOpen, xHigh + (2 * xLow) + xClose,
iff(xClose > xOpen, (2 * xHigh) + xLow + xClose,
iff(xClose == xOpen, xHigh + xLow + (2 * xClose), xClose)))
xPP = xP / 4
vR1 = xP / 2 – xLow
vS1 = xP / 2 – xHigh
plot(xPP, color=blue, title=”PP”, style = circles, linewidth = width)
plot(vS1, color=#009600, title=”S1″, style = circles, linewidth = width)
plot(vR1, color=#ff0000, title=”R1″, style = circles, linewidth = width)
¿Encontraste este código de los puntos del pivote del demark en la tela, es exacto con el de tradingview?
IF DCLOSE(1) > DOPEN(1) THEN
phigh = DHIGH(1) + (DCLOSE(1) - DLOW(1)) / 2
plow = (DLOW(1) + DCLOSE(1)) / 2
ELSIF DCLOSE(1) < DOPEN(1) THEN
phigh = (DHIGH(1) + DCLOSE(1)) / 2
plow = DLOW(1) - (DHIGH(1) - DCLOSE(1)) / 2
ELSE
phigh = DCLOSE(1) + (DHIGH(1) - DLOW(1)) / 2
plow = DCLOSE(1) - (DHIGH(1) - DLOW(1)) / 2
ENDIF
RETURN phigh AS"DEMARK R", plow AS"DEMARK S"
Buenos días Nicolas.Ese código me sale de la misma forma que el intento de traducción del código de Traingview que tengo,el problema es que visualmente no salen lineas paralelas como en el de Tradingview y no sé como hacerlo….
REM DEMARK PIVOT POINTS
//adaptación para Prorealtimev10.3
//indicador aparecido en la plataforma Tradignview
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 15/05/2017
// Demark Pivot Points start with a different base and use different formulas for support
// and resistance. These Pivot Points are conditional on the relationship between the
// close and the open.
///////////////////////////////////////////////////////////
xHigh = high[1]
xLow = low[1]
xClose = close[1]
xOpen = open[1]
if xClose < xOpen then
xP= xHigh + (2 * xLow) + xClose
endif
if xClose > xOpen then
xP=(2 * xHigh) + xLow + xClose
endif
if xClose = xOpen then
xP= xHigh + xLow + (2 * xClose)
endif
xPP = xP / 4
vR1 = xP/ 2 - xLow
vS1 = xP / 2 - xHigh
return xPP coloured(0,0,255)style(point,2)as "PP",vS1 coloured(0,100,0)style(point,2)as "S1",vR1 coloured(255,0,0)style(point,2)as "R1"
Si desea obtener líneas en lugar de puntos, debe eliminar todos los “style(point,2)” en tu código.
creo que ahora lo comprendo Nicolas.Para que se vea como en el original hay que tener intradia (tiempo real).Lo mismo ocurre con el indicador de la biblioteca Pivot Point (Dayly)