Category "pine-script"

Is there a way to plot values from a google sheets workbook to tradingview pinescript?

I am trying to plot values calculated in an GoogleSheets workbook on a tradingview chart. I cannot do the same calculations in Tradingview because the values co

strategy.exit exiting all orders at arbitrary point even with independent pts/stop losses (pyramiding)

So this is a follow-up from my previous question. I've tried to utilize some arrays to create multiple buy, profit taking and stop orders so that trades can be

History referencing in Pine Script arrays

I have been trying to use array feature, which recently has been introduced in PineScript 4, but it seams that either I'm not aware of its limitations, or , pos

Pinescript - Why does my stoploss trigger upon entry stop?

I'm working strategy based on a MTF Stoch RSI indicator I created. In the strategy, based on Stoch RSI higher and medium timeframe direction and entry timeframe

How to convert strategy to study pinescript V5

I need to figure out how to turn my strategy into a study for V5 Pinescript. I cannot seem to find any info about it online. Im pretty sure for v3 you have to c

Difference between := and = operator in pine script

I'm super new to TradingView Pine Script and I didn't find a proper reference for understanding the difference between the := and = operators. Does anyone have

Get Value of MACD on different TimeFrame

How can you get the value of the Macd Line and Signal Line real-time from different timeframe. Like for example I am on a 4HR chart and I want to get the value

Variable not becoming a series of values. Why?

I created this script to detect Swing Highs and Lows and then to determine the High and Low values of these Swings. The code works for the last bar, but I wou

Check if crossover occurred in the period of last 10 candles

I am working on a strategy that requires me to check if there was a certain crossover few candles back in time when I get my signal on current candle close. Rig

Highest high "of the last n days", not "n days ago"

If I want to compare the close of today with the high of the last 4 days, what is the format? I have used _hi = close > high[4] ? 1 : 0 But that only coun

Pinescript duplicate alerts

I have created a very basic script in pinescript. study(title='Renko Strat w/ Alerts', shorttitle='S_EURUSD_5_[MakisMooz]', overlay=true) rc = close buy_entr

PineScript: plot a line with custom values

I'm a newbie and I'd like to create a simple indicator I update every day with my numeric values and that plots one line chart. I tried this but it plots 3 sing

Price crossing levels in both directions, in realtime bar, not activating subsequent alerts

My code is configured to initiate an alert whenever the current price crosses a predetermined buy/sell level. This part works. However, in certain time frames (

plotting Candles as Seconds Timefame/ Chart(TradingView/Pinescript)

is there a way to plot candles as Seconds Timeframe, without using a timeframe.isseconds. found a calculation but i cant plot candle on it. // calculate bar tim

How to set stop loss at previous bar low of long entry?

I would like to set my stop loss at the previous bar low of long entry. I'm trying value when(your_condition, low[1], 0), but I don't know what "your_condition"

Multi-TF Volume Table (Pine Script)

I'm making an indicator to calculate two EMAs, compare which one is greater, and then deliver the user a bias of bullish or bearish (by coloring the second row