Relative Content

Tag Archive for pine-scriptpine-script-v5

how to get a series of all time high?

I am trying to write a Pine Script function that will take a series of data (e.g., [1, 2, 3, 4, 5, ..., 100]) and return a new series where every element is replaced by the highest value in the input series (in this case, [100, 100, ..., 100]).

how to get a series of all time high?

I am trying to write a Pine Script function that will take a series of data (e.g., [1, 2, 3, 4, 5, ..., 100]) and return a new series where every element is replaced by the highest value in the input series (in this case, [100, 100, ..., 100]).

Creating a horizontal line at specific time each day for 5 days in pinescript

I am trying to create a line from an exact time that I will enter as input for each day (for 5 days) but I cant make it work. The following code is one part of it that seems to work correctly by putting lines at correct places but even though I meant to create only one line (one day) it is repeating for everyday possible. I commented out the remaining part of the code which is the repeat of the last part by creating targetTime1, targetTime2 and etc. because I was trying to figure out where is the problem.
I tried to do this in a loop too, it failed exactly like this. If you could help me find why it is repeating for everyday even though I use a timestamp including year, month, day I would really appreciate it.
I am also trying to make this available for all timeframes and if the entered time is not on the table then it may not show its okay.

Pine script repainting the plot history

The problem I’m facing is repainting of plot history, I would get a plot while the bar is open which is the way I want it. But the issue is the plot history not being accurate. I want the plots to lock onto the chart once it’s been triggered, and not to disappear.

Pine script repainting the plot history

The problem I’m facing is repainting of plot history, I would get a plot while the bar is open which is the way I want it. But the issue is the plot history not being accurate. I want the plots to lock onto the chart once it’s been triggered, and not to disappear.