All Questions
Tagged with pine-script technical-indicator
36 questions
0
votes
1
answer
98
views
How do I highlight the most recent signal in PineScript for TradingView?
I am encountering an issue in Pine Script v5 that I hope you can help with. My script runs perfectly fine, but I want to make the most recent "BUY" and "SELL" condition labels and ...
0
votes
1
answer
141
views
How to plot horizontal lines based on Parabolic SAR swing points?
I recently added the SAR to a particular trading strategy. Even more recently I had the idea to plot horizontal lines every time the SAR changes direction because I noticed when it does change ...
0
votes
1
answer
129
views
Pine Script Nadaraya-Watson How to draw multiple lines based on two values in a single indicator?
I wish to have double band lines for 2 and 3 at the same time by giving the "mult" parameter more than once in the nadaraya-watson indicator. I tried merging the code block but it always ...
0
votes
1
answer
65
views
Pine script - declaration variable overruling reassignment operator
I think I'm trying to write a loop. I am trying to switch the value of ims_dir (and eventually ms_dir too) depending on fulfillments of two if statements. I've tried declaring ims_dir = na, and then ...
0
votes
0
answers
56
views
accurate calculation for pitchfork indicator
I'm working on creating a manual pitchfork drawing indicator in Pine Script (version 5). The issue I'm facing is that the pitchfork drawn by my indicator is not as accurate as the one drawn using the ...
0
votes
1
answer
31
views
Adding values of Indicators
I want to count how many times some indicators give signals in last 50 candles, means if Some indicators give Buy 1st time, then 1 and after some time again buy then add one more time so total is 2, ...
0
votes
0
answers
28
views
How to plot boxes that correlate with technical indicator
I am trying to plot boxes on my chart that correlate with the technical indicator I am using. The indicator is the MACD. Basically, what I want it to do is create a green box when there is a long ...
0
votes
1
answer
52
views
seperate data from a single request.security
//@version=5
indicator("FREC", overlay=true)
my_table = table.new(position = position.bottom_center, columns = 5, rows = 5, bgcolor = color.white, frame_color = color.black, border_color = ...
0
votes
1
answer
93
views
How can i replicate the TradingView indicator Relative Moving Average(RMA) in Javascript/Typescript
I'm trying to “clone” the technical indicator ta.RMA from tradingview.
But i've not managed to convert it to working code after a good while of trying.
Here is the equivalent in the pine language:
...
0
votes
2
answers
196
views
Using Timeframe parameters Pinescript indicator
I'm trying to create an indicator that uses the "Auto Fibo Retracement" technical indicator, but I want the timeframe on which the indicator is based not to be the one on the chart, but one ...
0
votes
1
answer
89
views
Trading View Indicator
I want to develop a Trading View Indicator in which the Candle turns Blue if TR<ATR. I tried the below code but no result.
//@version=5
indicator("TR < ATR Color Change", overlay=true)...
0
votes
1
answer
263
views
Different oscillator indicators in the same pine script but plot them separately
I wrote different oscillator indicators (such as RSI, SRSI, etc.) in the same pine script so that all can be plotted by loading a single script. However, all the indicators are being plotted together. ...
0
votes
0
answers
36
views
pine-script v5, script error of Mismatched input 'var8' expecting 'end of line without line continuation'
This is the logic of my script in words, "VAR8 assignment: If the lowest price <= VAR5, return (VAR4+VAR6*2)/2, otherwise return the 3-day exponential moving average of 0/618*VAR7"
and ...
0
votes
0
answers
46
views
using label.new lookback candle count for Stoch-Rsi 20 CrossOver/Crossunder for 20/80 levels
I am trying you create a label.new for stochastic-Rsi indicator which specify no of candles back crossover or crossunder occured . The label.new text should consist of below text
//@version=5
...
0
votes
0
answers
174
views
How To Plot My Custom Volume Indicator To Right Side Of The Chart?
I am trying to plot my custom volume indicator to the right side of the chart, similar to the Visable Volume Profile indicator. (Image at bottom of post) The following is the code for the indicator:
...
-1
votes
1
answer
55
views
requesting to help me by converting pine script version 2 to version 5
help me to convert below pine script 3 lines in version 5.(below lines are in version 2)
src=ohlc4
haOpen = (src + nz(haOpen[1]))/2
haC=(ohlc4+haOpen+max(high,haOpen)+min(low,haOpen))/4
try to ...
0
votes
1
answer
623
views
Change TradingView Indicator Daily Start Time
I want my Pinescript code to start with UTC-4 (GMT-5) instead of the default UTC. You can see my indicator starts at 17:00 in the images. So 17:00-17:00 is a daily span instead of 00:00-00:00 in UTC-4....
1
vote
1
answer
210
views
pinescript for not yet closed candle, not yet closed candle should be invisib
Can you please share the pinescript for tradingview which should hide the current moving candle, I mean the not yet closed candle should be invisible, once closed it should be visible
//@version=4
//...
0
votes
2
answers
362
views
Check if a plot is displayed using pinescript
I have an indicator with 2 moving averages lines, and for each MA line I put a label with the price corresponding to that MA, the problem is the following:
I want to hide a MA line and it's price ...
0
votes
1
answer
1k
views
Getting error and don't know how to solve it - an argument of 'float[]' type was used but a 'series float' is expected
I am getting this error on compliation for Tradingview Pine script 5
# Cannot call 'operator *' with argument 'expr0'='call 'operator SQBR' (float[])'. An argument of 'float[]' type was used but a '...
0
votes
1
answer
29
views
How to remove consecutive candle highlight in the following indicator?
I have created an indicator in pinescript as following which will highlight a candle that is closed above 9EMA and stok %k above 80.
//@version=5
indicator("ASK - Algo Short", overlay=true)
...
0
votes
1
answer
1k
views
Nadaraya - Watson Envelope Strategy
Completely new to pine script. Been trying to make a strategy using Nadaraya-Watson Envelope but its shows no output on the Strategy Tester. Here's the Code.
I just want to make a simple strategy ...
0
votes
1
answer
90
views
Does anyone know where the code for the magnet tool can be found? And/or if that functionality can be applied to data other than the price chart?
NEOPHYTE DISCLAIMER:
I am (very new to pine-script and have only MINImal C++ experience, btw) working on writing a script for a pretty unique method of TA, as far as I can tell (experience, and ...
0
votes
1
answer
450
views
create pine script indicator: continuous rate of return oscillator from a fixed date (velocity)
UPdate: I figured out how to create a velocity/ror indicator but I cannot get the rate of change to show negative values when it moves down instead of up. any help with this??
Original post: I am ...
0
votes
0
answers
78
views
Alert only after 2 conditions meet in sequences
I want to make alert after 2 conditions met in sequences. Is it posssible?
alertcondition(rsi > 50 and dicross) something like this doesnt work.
alertcondition(rsi > 50 + dicross) also doesnt ...
0
votes
1
answer
595
views
Is there a way to display indicator value of last closed bar in TradingView PineScript?
I'm trying to display (using plotchar() and the Data Window) the latest closed value of a Moving Average, or in other words the value of the Moving Average of the last closed bar.
This is my current ...
0
votes
2
answers
623
views
How would I combine 2 colour moving averages into 1 line that changes colour
New programmer here! Thanks to the great stack overflow community, we were able to create an indicator with multiple colour moving averages.
Now I would like to go one step further.
I want both the ...
0
votes
1
answer
60
views
End of line without continuation problem again. Need to add this to BTC or ETH
first question here. Just starting to learn PineScript and I just want to add this to my charts. The first error is the usual "end of line without continuation" at line 69 (I tried on that ...
0
votes
1
answer
867
views
Change a bar's bgcolor transparency based on previous bar's bgcolor transparency
I am working on an indicator, where, based on certain conditions, I change the color of a bar's background (using bgcolor). This is easy to do. But what I now want to do is to edit the bar's bgcolor ...
1
vote
0
answers
670
views
How Can I create a Pinescript indicator that plots the s&p500 price to it's dividend per share in chart (p/d)
I want to be able to see a chart of the s&p500 price divided by its dividend per share. There are no current indicators built in tradingview to allow this that I am aware of.
In tradingview, I am ...
1
vote
2
answers
3k
views
ATR Trailing Stop Loss Indicator in TradingView
I was going through below pinescript code of ATR Trailing Stop loss indicator and was trying to code it in Python. I'm facing difficulty understanding below lines.
Prev = H,barssince(close>H and ...
0
votes
1
answer
378
views
PineScript Variables Intermittent Vales during candle making
I have a question regarding variables value during pine script execution.
Below picture shows a scenario on a five minute chart. In the first candle 11.00 am, the close price is 9200. New candle ...
0
votes
2
answers
5k
views
Tradingview Pinescript alert not working as expected
I am using below pinescript and i am not getting alerts as expected. I am aware that it is a repainting script. It is working fine with the back testing.
Long alert is set to "Once per bar close" and ...
0
votes
1
answer
4k
views
Export Data with Flag on Tradingview chart
I have manually marked some flag on tradingview chart. I hve a premium account and I can export chart data. I want to include these flags in my export. Does anyone knows how can I do that?
1
vote
1
answer
1k
views
TradingView Pivot Reversal Strategy
The Pivot Reversal Strategy in TradingView includes in the script the function "pivothigh" and "pivotlow".
The exact mathematical formula is not available in the Pine Documentation. Could you provide ...
2
votes
1
answer
3k
views
Tradingview pine script is a piece of poop: Cannot use a mutable variable as an argument of the security function
Honestly how hard is it to implement options without a backend problem in a scripting language. I get the following error "Cannot use a mutable variable as an argument of the security function" just ...