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
Next day Central Pivot Range
I've this code for present day CPR. Could anyone please help me to add CPR level for the next day.
indicator(title='Pivot Range', shorttitle='CD_PivotR', overlay=true)
sd = input(true, title='Show Daily Pivots?')
//Pivot Range Calculations - Mark…

AKHIL ASHOK
- 15
- 3
0
votes
1 answer
How to get previous day US session close of the ES mini contract in pinescript?
I am trying to code an indicator to measure the Gap between the previous day close and new day opening bar in pinescript.
My script works for markets that operate on regular session but when I use it on futures contract, it gives me a different…
0
votes
2 answers
Plotting a number under the candle
I am using version 5
I check whether indicator conditions are met, and if they are, I get a specific number - 1, 2 or 3.
I want to display these numbers under the candles.
I have this code, where I try to convert my numeric value to string with…

Emka
- 1
0
votes
1 answer
Mismatched input 'plot' expecting 'end of line without line continuation'
Compilation error. Line 23: Mismatched input 'plot' expecting 'end of line without line continuation'.
// Plot the trend indicator EMA if it's enabled
if (useTrendIndicator)
plot(trendIndicator, title="Trend Indicator EMA", color=color.blue)
If I…

Gittiwilo
- 11
- 2
0
votes
0 answers
Buyer Seller Volume Balance between two Pivots
The following code shows the pivot points with tool tip showing the traded volume between two pivots. Another part of code contains select start date and end date to see the buyer and seller volume in number and in percentage. I want to display the…

Ram
- 17
- 7
0
votes
1 answer
Draw a box around a specific 1-hour candle every day
I'm a newb with Pineview and I'm trying to piece together some examples of how to draw a box around the 8am UTC+2 1H candle every day.
I can't seem to figure out how to calculate the coordinates of the box itself. Does anyone have any examples…

Joe R
- 1
0
votes
0 answers
How to get an alert once on a trend on a supertrend, in pinescript,with loop or another way?
How to get an alert once on a supertrend trend,I think with while i can solve(but my knowledge is not enough),maybe is another way to solve my problem.
I need to skip the first signal(on down/up trend) and enter the second alert, and this signal …

Roberto
- 1
- 1
0
votes
1 answer
How to limit amount of plotshapes?
I wrote an Indicator in Pincescript, which shows seperator lines for the weekdays and also for the weekend. Additional to that, its possible to show the weekday names.
With the kind help of stack overflow users I was already able to reduce the…

Luca
- 17
- 5
0
votes
2 answers
How to Limit the Amount of Lines?
I wrote an Indicator in Pincescript, which shows seperator lines for the weekdays and also for the weekend. Additional to that, its possible to show the weekday names.
So far this works finde, but when I combine it together with the rest of the…

Luca
- 17
- 5
0
votes
1 answer
how to know the total number of bars in the chart at the begining of the code (not via barstate.islast)
I am wondering if there is a way to get the number of bar of the timeframe that my chart is in it from the beginning.
My goal is to use the final bar_index as a variable in my code, but the issue is that the bar index will increase by time. so I was…

sey eeet
- 229
- 2
- 8
0
votes
1 answer
How could i make a 3D matrix in pinescript
I would like to make a matrix with 3 dimensions for storing a grid of values overtime.
ive tried making multiple matrixs but caling them is tricky and i would like to have it easily scalable
0
votes
1 answer
How to check the time execution for my code?
Is there a way to check the time that piece of the pinescript code takes to execute/run?
And I was wondering for the same code if there is any difference if I run it as a plain code in my script or if I make it a export in a library and then call…

sey eeet
- 229
- 2
- 8
0
votes
1 answer
How to grab Fibonnacci levels' price to perform calculations?
Based on TradingView's built-in Auto Fib Retracement code, how to calculate and plot the price difference between 0 and 1.
I cannot figure out how and where to grab the price value of these Fibonnacci levels in the pinescript code.
Example from the…

Paul
- 5
- 3
0
votes
1 answer
how to use two outputs in library
I was wondering if it is possible to have more that one outputs in the pinescript library?
For example is the following code valid?
export sorting_float(float[] Value, int[] BarIndex) => //{
var NewBarInd = array.new_int()
ValueSorted =…

sey eeet
- 229
- 2
- 8
0
votes
1 answer
Difficulty displaying price on price scale for line in indicator [Pinescript/TradingView]
I'm trying to get the ath and atl prices to display on the price line. I would like to have price appear like it does for other lines by default in TradingView - chart displaying what I'm trying to do
I thought this would be possible to do with…

KangarooJack77
- 1
- 1