Relative Content

Tag Archive for pine-scriptpine-script-v5

Display 2 arrows on same bar separately

I have pinescript v5 code that may display 2 arrows on the same bar on certain occasions. How do I make the arrows appear separately on the same bar? Currently, they overlap each other and I can only see one bar.

Pine Script: Automatically mark point in previous day

Hi i have a script that automatically draw open price of 00:00 and 08:30 candles. The problem is the code only mark for current day, not for historical data. Can anyone help me modify the code so that it can also mark these point in previous day. Thank you in advance

Finding lowest low between to given bar indexes

I have two array’s that tracks the higher highs in a market, one tracks the price at the high and the other tracks the bar index. I am having trouble of finding a solution of what i want to do when a higher high is detected. as of now, when a higher high is found, I am able to find the the two bar indexes (prev high and the current high)

Strategy is only creating long positions. How can I correctly impliment if conditions for long and short possitions in wheel like strategy

The following code I wish to impliment a strategy that automatically enters a new position when long or short position previous has failed. It should enter a short when long has failed and the opposite. And, if the trade is successful it should enter another identical trade above the last.
My code is only creating long positions and it is only doing so as though the first condition is met and ignoring my other if conditions.
Please help.

how to get chart point from crossover

I want to get a chart point from crossover for place a label in pine script language.
I write a code that give crosses between a plot (sma) and price to make a label but I don’t know how to give chart point to label function. please help me.
l don’t have any idea fo this.

Using var on request.security in pinescript

I want to hold the result of ‘request.security’ in a variable once so I can refer it later, but when I’m checking the result in my sample code below I get the correct result only when the timeframe of chart is daily.
When I make it 4h or even weekly I get ‘NAN’ result. Can someone explain to me why this is happening?