Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Is it possible to use different scales?

How to combine left and right scales in one indicator for MACD, RSI, and Stochastic in Pine Script? I have a script that combines MACD, RSI, and Stochastic, and I want to have the following setup: ...
Sarkis John Bertizlian Serna's user avatar
0 votes
0 answers
17 views

Working with various timeframe inside script irrespective of timeframe selected in charts

I want to extract high, low, close, open of 1st 30minute candle and make it save/plot for throughout the day irrespective of the time frame selected in tradingview chart. I have tried using various ...
Devdeepsinh Zala's user avatar
0 votes
0 answers
55 views

Draw vertical line offset by number of days on intraday charts

I created a short script that plots Moving Averages on all timeframes - specifically it draws Daily Moving Averages on intraday charts. I want to add to the script vertical lines in the same color as ...
ideapix's user avatar
0 votes
0 answers
49 views

Pinescript: Plot an entry point where Volume bars are Red, Red, Green

I am trying to write a Pine script that observes the volume bars on a 3 minute chart and plots a triangleup entry point whenever there is any instance of the following: Volume bars in the following ...
SKINNY's user avatar
  • 3
0 votes
1 answer
254 views

How to display Intrabar Values when using Lower Time frame?

I want to display last three close values of Intrabar when using Lower Time frame in Pinescript. The code I tried gives is not what I needed. I am using 15 min chart and I need close of 3 min candle. ...
paulcab's user avatar
  • 1,112
0 votes
1 answer
73 views

I want to write a pine code strategy but everytime I get a malfunction that says 'could not find indicator 'sma'

i want to create a strategy with pine code that gives me a buy signal everytime when the price of the stock is above the SMA200 and the MACD is below 0 and when the MACD level line crosses the MACD ...
Cliche's user avatar
  • 1
0 votes
1 answer
544 views

Add extended trading hours (premarket and afterhours) to current pine script code

I have an indicator that plots percentage levels above current high/low/open/close (user selected) for the intraday levels. I would like to incorporate extended trading hours into the code. For ...
sfsurftrades's user avatar
0 votes
2 answers
509 views

Plotting a series of numbers into horizontal lines

I've been trying to figure out the code to plot lines like these based on me copy and pasting a series of numbers into the code each day. I was trying to use an array but I'm not sure that's what I ...
AMG's user avatar
  • 1
0 votes
1 answer
631 views

pine script. merging 2 charts into one

I am searching for a pine-script that calculates an average-chart out of 2 given chart-symbols an after that shows me the MA200 of the newly generated chart. Does anybody has this? Or knows how to do? ...
qmp's user avatar
  • 1
0 votes
1 answer
339 views

How to find the bar which is the highest high green bar within 5 bars, excluding the current bar?

I would like to find the green bar which is the highest high bar of last 5 bars, and not the current bar (the current bar may be the highest green one, so I need to exclude it) I tried this but it ...
CandyG80's user avatar
0 votes
1 answer
519 views

Replace default chart in Pine Script while using overlay=true

Is it possible to replace/make invisible the default chart using Pine Script? As an example, the default chart always shows candles. I would like to write an indicator (using overlay=true) to erase (...
silverstreak's user avatar
0 votes
1 answer
42 views

How to check if low is under a plot

I have the following plot last13 = lowest(close, 13) Bottom = last13 == nz(last13[1]) ? last13 : na plot(Bottom, color=#0000ff, linewidth=4, style=plot.style_linebr, title="Bottom", offset=0)...
CandyG80's user avatar
0 votes
1 answer
157 views

How to find the first value of Bollinger Bands when bar open

Actually, the Bollinger Bands code is: //@version=4 study(title="AAAA", shorttitle="AAAA", overlay=true) len = 5 multi = 2 bb5med = sma(close, len) devBB5 = mult2 * stdev(close, ...
CandyG80's user avatar
-2 votes
2 answers
126 views

Find the first value of a plot line

I have the plot: //@version=4 study(title="Line", shorttitle="Line", overlay=true) theline(src, len) => wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len))) Line = ...
CandyG80's user avatar
1 vote
3 answers
109 views

How to find data of wma at the open position?

I have this plot: WMA_point = wma(close, 9) plot(WMA_point, title='WMA', color=#000000) It makes a line on the chart. When the price goes up, the line moves up, and vice versa, when the price goes ...
CandyG80's user avatar
1 vote
2 answers
625 views

Wrong value from a second time interval in pine script

Good morning, I have a little problem there. I would like work with data from two different time interval. for example, BTC (1 day time interval) and BTC (4 hour time interval) chart. The main time ...
Pit's user avatar
  • 21
0 votes
1 answer
498 views

How to plot green and red dots or labels when QQE fast curve crosses slow curve and vice-versa

I'm working further on a pine script for TradingView originally developed by Glaz Metastock Version of QQE (published Feb 19, 2015). I've been able to modify it a bit however I want to be able to plot ...
bassaad17's user avatar
2 votes
2 answers
5k views

What's the logic within LINREG function in pine (trading view)?

So i'm building some sort of charts in C#, i'm basically reverse-engineering what I need from TradingView functions which uses PineScript. I'm Kind of stuck with this one "LINREG" because ...
Yogurtu's user avatar
  • 3,001
0 votes
1 answer
2k views

How to add all or some conditions to alert ? - Pine script tradingview

I have a list of conditions for a candle. This is just an example: aa = (close > open) and (low > low[1]) bb = (close[1] > open[1]) and (close[1] > 5) cc = (close > ((high[1] - low[1])*...
CandyG80's user avatar
0 votes
1 answer
275 views

Buy and sell-markers on lower time frames when longer time frame shows uptrend

So, I'm trying to run a trading bot on medium timeframes (1h - 4h) using the KDJ-indicator. I know it's not the most responsive indicator but it is very reliable, at least on higher time frames (8h - ...
Daniel Bauer's user avatar
2 votes
2 answers
1k views

How to get all lines manually drawn on chart

I need to find all horizontal lines manually drawn (via Toolbar) on a chart. So that I can find intersections of candle-stick.
user3431704's user avatar
0 votes
1 answer
897 views

How to find the number of bars from the last Monday ? tradingview

Please tell me how to find the number of bars from a previous date. i.e today is Friday 12-Mar-2021 and Im on the chart of 1 minute timeframe How to know the number of bars from Monday 8-Mar-2021 00:...
CandyG80's user avatar
0 votes
0 answers
504 views

barssince function problem - tradingview pine

The following code is working. But the 2nd doesnt work. Why ? specificTime = dayofweek == dayofweek.monday and hour == 0 and minute == 0 and second == 0 countbar = barssince(specificTime) plot(...
CandyG80's user avatar
0 votes
1 answer
227 views

Mutable variable + security function - tradingview pine error

Im getting the error: Cannot use a mutable variable as an argument of the security function This is the code to show 3 lines as Resistance, Middle and Support. //@version=4 srch = input(high, "...
CandyG80's user avatar
0 votes
2 answers
2k views

How to get value at a point of line extended - TradingView Pine script

Im using the code below to draw a line: //@version=4 simplesma = sma(close, 14) var line3 = line.new(bar_index[0], high[0], bar_index, low, extend = extend.right) line.set_xy1(line3, bar_index[5], ...
CandyG80's user avatar
4 votes
1 answer
5k views

Creating shape or marks in custom indicator, (tradingview charting library (pinejs))

is there any way to create shape or create marks on chart in custom indicator using tradingview charting library. I am using this way to create custom indicators. Thanks in advance.
user9639650's user avatar
1 vote
1 answer
2k views

Need to remove the previous day plots in tradingview - pinescript

This is my code. Can you please update your answer in this bcz i tried and the indicator is not compiled properly. //@version=3 study(title="TEST", overlay=true) fib1 = security(tickerid,&...
raja_rd's user avatar
  • 11
0 votes
1 answer
470 views

How to next highest point after the days lowest low in pinescript

I want to find the best low/high range. //@version=4 study("Daily Open High Range") plot(((high-low)/low)*100) This works mostly fine except it will return results for the low against the ...
RvBVakama's user avatar
  • 101
0 votes
1 answer
2k views

Get session-time (start and close time) of main chart series in pinescript

I am currently trying to write up a script in Pine Script for TradingView, and am having difficulties getting the session (the start and close times) of the current displayed main chart series. e.g ...
ta_zoa's user avatar
  • 11
0 votes
1 answer
378 views

PineScript Variables Intermittent Vales during candle making

I have a question regarding variables value during pine script execution. Below picture shows a scenario on a five minute chart. In the first candle 11.00 am, the close price is 9200. New candle ...
Raj's user avatar
  • 47
0 votes
2 answers
5k views

Tradingview Pinescript alert not working as expected

I am using below pinescript and i am not getting alerts as expected. I am aware that it is a repainting script. It is working fine with the back testing. Long alert is set to "Once per bar close" and ...
Raj's user avatar
  • 47
0 votes
1 answer
4k views

Export Data with Flag on Tradingview chart

I have manually marked some flag on tradingview chart. I hve a premium account and I can export chart data. I want to include these flags in my export. Does anyone knows how can I do that?
Raj's user avatar
  • 47
0 votes
0 answers
115 views

How to customise a chart in Pinescript?

I'm trying to create my own chart. Interested in customized trading hours on the chart. Found a similar code. But it does not work correctly. The problem is that it cuts out the beginning and end of ...
imtochukwu's user avatar