TradingView
Dereek69
12 de Nov de 2019 17:50

Pivot Points HIgh Low 

Bitcoin / US Dollar Perpetual Inverse Swap ContractBitMEX

Descrição

Remake of the integrated Pivot Points indicator
With higher resolution you should lower the indicator values to get a good result

Notas de Lançamento

Added the option to chose the between High/Low and Close as Source for the pivot points

Notas de Lançamento

Cleaned the code with the function pivothigh() and made sure the lines started from the right candle
Comentários
Beco27
// tnx

if pivot_high != pivot_high[1]
line.new(bar_index + hbars, pivot_high, bar_index, pivot_high, xloc = xloc.bar_index, color = color.lime)
pvh = pivot_high
pvl = pivot_low
pvf = pivot_low + (pivot_high-pivot_low)/2
line.new(bar_index + lbars, pvf, bar_index, pvf, xloc = xloc.bar_index, color = color.green, style=line.style_dashed)

if pivot_low != pivot_low[1]
line.new(bar_index + lbars, pivot_low, bar_index, pivot_low, xloc = xloc.bar_index, color = color.red)
pvh = pivot_high
pvl = pivot_low
pvf = pivot_high - (pivot_high-pivot_low)/2
line.new(bar_index + lbars, pvf, bar_index, pvf, xloc = xloc.bar_index, color = color.red, style=line.style_dashed)
EvrenAhimsa
@Behcet, Wow I really found a sweet spot here that I never knew existed on Tradingview... I must learn how to code indicators now..! Looking at the data you shared here, I assume as modifiers to the original script, I wonder how I can make these changes as well to see the difference on my end? Excuse me for being new blood here :) TIA
ravindraverma1988
Hello Sir, Kindly help me in ur this Script. I Need to Change the Color & Thickness of the Pivot & Extend the Pivot line a little more till the right side. like you can see in below links screenshots.

1) drive.google.com/file/d/1mTY4lsmIBROu-M71ZM_gCnb2THeM9Pbk/view

2) drive.google.com/file/d/16lJVS-BvN4zW_2Ih5-zwWypyfYxJIyxS/view

Kindly Help me.

Regards,
Ravindra
Beco27
ravindraverma1988
@Behcet, how & where to put " hbars + 5 " in the script. I tried but not got succeed. Please help

line.new(bar_index + hbars, pivot_high, bar_index, pivot_high, xloc = xloc.bar_index, color = color.lime)
ravindraverma1988
@Behcet, I need the PIVOT HIGH LOW like this one (kindly check the link : in.tradingview.com/script/d56Dtx3i-pivots-high-low-line/)

The above one By @Dereek69 is similar as the link one, but only issue is that the Length is very less. I need a little bit long Line. I tried " Extend Right" But it make much more long line till the Right end which is so noise full.

can I add more Style Features instead of Line only in the style property like color change, thikness, line/ line with breaks.

I am not much familiar with Pine Script Version 4. So stucked. kindly help
Regards
Dereek69
@ravindraverma1988, its not possible to chose an x value over the current bar in the line.new() function whith the xloc.bar_index parameter.
To do that you have to:
- change the parameter to xloc.bar_time
- get the current timeframe
- convert x1 and x2 to time variables
- add the preferred length to x2

PS @Behcet hbars and lbars are negative numbers that indicate where the pivot point where in the past, so changing those would only extend the line further in the past
Beco27
@ravindraverma1988,
hbars = highestbars(src_high,x+20)
lbars = lowestbars(src_low,x+20)
blessjanu1
@ravindraverma1988, bhosidke mume lee chutiye
Mais