This tag should be used for questions relating to scripts and code built specifically on version 5 of Trading View's Pine Script language.
Questions tagged [pine-script-v5]
2372 questions
0
votes
1 answer
Pine V5 - Alert on Crossing RSI and Crossing MACD
How can I create an alert or a script mixing 2 different indicators?
Alert on RSI Crossing and MACD Crossing (MACD crossing after the RSI will give that confirmation).
Thank you in advance for your help.
I don't know how to create an alert mixing 2…

CantIhavecrypto
- 13
- 3
0
votes
1 answer
Tradingview - pine script - How to config or code alert display will same order in list of trade
i Has a strategy using request.security.
My problem is alert display different order in list of trade
example :
error 1 : Alert show more than / less than order in list of trade
error 2 : Alert show not same position of Long / short on chart
Alert…

Long token
- 5
- 2
0
votes
2 answers
Use bar_index from label plot to get length/lookback input for another function
I'm currently trying to combine two indicators where the first function shows the lowest bar since n'th days. When found it plots a label with price on that bar_index. Now, I'd like to add the regression channel indicator but with that bar_index as…

NoPants
- 3
- 2
0
votes
2 answers
Pinescript How to use a Higher Time Frame Value from an RSI Divergence indicator
Please help me write the syntax and use the RSI Divergence value from 15 minutes to the 1-minute timeframe.
Here is the original code. I want to use this expression in the 1minute Strategy:
"divergence > 0" from the 15-minute…

John Smith
- 55
- 1
- 1
- 3
0
votes
0 answers
Nested loop help needed in Pinescript TradingView
Loops is my weakness unfortunately... and I need to build a nested loop, unless it can be done differently somehow. Also this is in TradingView Pinescript v5.
So I have automated trendlines and I can capture crossings of each up or down at any point…
0
votes
1 answer
Need Help Converting This Pinescript into V5 TradingView
So I have an old pinescript I believe v2 or v3 that I Need help converting into V5 as my knowledge of pinescript is very limited, but I can not do that auto convert to work because the values seem to be not converting or it has changed so much. Any…

LJ2
- 11
- 2
0
votes
0 answers
Pine Script - Could anyone assist with an indicator Pine Script which showing the daily loss amount on the chart?
Could anyone help to enhance the following pine scrips? Much appreciated and thanks for your answers!
//@version=5
indicator("Daily loss limit")
var testTable = table.new(position = position.top_right, columns = 2, rows = 1, bgcolor = color.yellow,…

GOLDFISH
- 1
0
votes
1 answer
Pine V5, alert when RSI changing color
I have tried to create an alert when the RSI change color from Green to Red and Red to Lime.
But have not succeeded.
Can someone help me for that?
Thank you in advance.
Here is the code:Pine V5
//@version=5
indicator(title='RSI Divergence',…

CantIhavecrypto
- 13
- 3
0
votes
0 answers
Creating a fan of lines in pinescript
I'm trying to code a script that draws a line from a starting candle to another candle if some conditions are meet.
If more candles meet the condition another line from the starting candle will be drawn, just like a "fan of lines" from the starting…

Dennis Nilsson
- 21
- 3
0
votes
1 answer
How to set stop loss at previous low of long entry?
I want to set a stoploss at previous low of long entry.
which command I need to use ?
(https://i.stack.imgur.com/c9imo.png)
currently I use
if ta.change(strategy.position_size) == 0
strategy.exit(id="Close Long", stop=low)
if…
0
votes
1 answer
How to draw lines and check the degrees between certain highs and lows
Hello I have this simple code that tells me the where are the lows and highs
pHigh = (high[1] > high[2]) and (high <= high[1] )
pLow = (low[1] < low[2]) and (low >= low[1] )
plotshape(pHigh, style=shape.triangledown, location=location.abovebar,…

sey eeet
- 229
- 2
- 8
0
votes
1 answer
How to make a calculator and repeat function on Trading View?
Excuse me! I'm a beginner programmer from Japan.
I'm not a native English user, so I'll show you my broken English!
[Pine-script on Trading View]
Now, I want to create a calculator works on the Trading View's charts.
By clicking 3 prices(high or low…

とっぷあめりあ
- 1
- 2
0
votes
1 answer
Covert iff from v4 to Pinescript v5
I'm trying my best to understand how to convert code form v4 to v5 and I have some successful attempts on some easy scripts, but I don't have any code skills, I'm trying to learn by myself the thing I need, but and I miss the basic to understand…

Doge
- 1
0
votes
2 answers
How would one do minv3.1 in pinescript?
In TC2000 its possible to use minv3.1 (minimum volume requirement for each of the last 3 bars) which I cannot figure out for pinescript (since its not the same a average volume). How would one create it?
I've only tried
V[0] > 1000 and V[1] > 1000…

Ghan
- 19
- 4
0
votes
1 answer
How do I entry every single 1 min bar after a certain delay (like 6 sec) in pinescript?
Im building a strategy on pinescript that entries in every single candle in the minute timeframe, and of course exit before the close, and the entry should happen after a short delay after the open of the candle has formed, anyone has any idea how…

D YAY
- 19
- 5