@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.
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
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)