hi
- User
hi
- Assistant
Hello! How can I assist you today?
- User
/HIGH-LOW(S-R) xx=ta.pivothigh(ipush,3,3) yy=ta.pivotlow(ipush,3,3) plotshape(xx,'H',style = shape.labeldown, size = size.tiny,location = location.absolute,color=color.navy, text = 'H',textcolor = color.white,offset = -3) plotshape(yy,'L',style = shape.labelup, size= size.tiny, location = location.absolute,color = color.orange, text = 'L',textcolor = color.white,offset = -3)
- Assistant
It looks like you are trying to plot pivot high and low levels on a chart using TradingView's Pine Script language. The pivot high levels are plotted as 'H' with a navy color and the pivot low levels are plotted as 'L' with an orange color. The plotshape function is used to plot these shapes with specific settings like size, location, and offset. Is there anything specific you need help with in this code?
- User
i wanna make it live h and low
- Assistant
To make the pivot high and low levels update in real-time, you can use the
securityfunction in Pine Script. Thesecurityfunction retrieves data from a security other than the main symbol on the chart. In this case, you can look for pivot high and low levels on the same symbol, but with a lower timeframe so that the levels update in real-time. Here's an example modified code://@version=4 study("Real-time Pivot High/Low", overlay=true) // Select a lower timeframe for real-time updates tf = "5" // Get pivot high and low levels from the lower timeframe high = security(syminfo.tickerid, tf, ta.pivothigh(tf, 3, 3)) low = security(syminfo.tickerid, tf, ta.pivotlow(tf, 3, 3)) // Plot pivot high and low levels as labels plotshape(high, "H", style=shape.labeldown, color=color.green, textcolor=color.white, size=size.tiny, location=location.absolute, text="H") plotshape(low, "L", style=shape.labelup, color=color.red, textcolor=color.white, size=size.tiny, location=location.absolute, text="L")This code retrieves the pivot high and low levels from a lower timeframe specified by the
tfvariable, which is set to "5" for a 5-minute timeframe. You can change this to any timeframe you want. Then, the function is used to get the pivot high and low levels from the lower timeframe. Finally, the pivot high and low levels are plotted as labels on the chart. - User
not working with me
- Assistant
I'm sorry to hear that. Can you please provide more details about what's specifically not working? Are there any error messages or unexpected outputs? Also, can you please share the full modified code you're using? I'd be glad to help you out.
- User
- Assistant
It seems that there is no issue with the
HIGH-LOW(S-R)code in the script. The pivot high and low levels should be plotted based on theipushvariable in the code which is calculated from the market sentiment indicator. One possible issue may be that the pivot high and low levels are too rare to show up on the chart.For instance, the
ta.pivothigh(ipush, 3, 3)function will only detect a pivot high if a price level makes higher highs across three bars before and three bars after the pivot high. Similarly, theta.pivotlow(ipush, 3, 3)function will only detect a pivot low if a price level makes lower lows across three bars before and three bars after the pivot low. Hence, if there are not many such price movements, the pivot high and low levels may not appear on the chart.Another possibility is that you may need to adjust the
sizeoroffsetparameter in theplotshapefunction to change the size and position of the pivot high and low levels on the chart.Please let me know if you have any other questions or issues.
- User
how much offset need to change
- Assistant
The
offsetparameter in theplotshapefunction refers to the vertical offset of the shape from the indicated location on the chart. The default value is0, which means that the shape will be vertically centered on the specifiedlocation.You can adjust the
offsetvalue depending on the height of the candlesticks or other chart elements.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.