Questions tagged [tradingview-api]

TradingView is a financial web-platform and a social network for traders. Use this tag for questions related to the programming API of TradingView products: Charting Library, Social Tools, Widgets. If you have questions about the Pine Script language use the [pine-script] tag. Do not use this tag for questions about the website.

TradingView is a financial web-platform and a social network for traders. Use this tag for questions related to the programming API of TradingView products: Charting Library, Social Tools, Widgets. If you have questions about the Pine Script language use the pine-script tag. Do not use this tag for questions about the website.

1436 questions
-1
votes
1 answer

How can I display only part of candles on Tradingview Chart?

I`m using Premium membership So when I use BTCUSDT chart, there are 20K candles. If I want to only display or call 10K or 15K candles, is it possible? then how? (the reason why I want to display only 10K candles on the chart is like below. -> I`m…
vwy089
  • 11
  • 2
-1
votes
1 answer

how can I find out if a condition for sell or buy met in either of the last n bars

How can I find out if a condition for sell or buy met in either of the last n bars in trading view pinescript
-1
votes
1 answer

Use pine to evaluate trades from multiple pairs on CSV

I have a bunch of trades already performed on a CSV. It contains their time, type (buy/sell), amount, pair, price and other data. How can I insert this data on pine to evaluate the trades on the graph, taking into account there are multiple pairs?
-1
votes
1 answer

hi i want to know how to make a tradindingview script with alert , condition when ema 2 crossed above by recent candle

hi i want to know how to make a Trading-view script with alert, condition when ema 2 crossed above by previous close candle and new open candle also close above it. the color of the candle should be green.
-1
votes
2 answers

Return X weeks high in pine-script

To get the 52-week high of closing price, I use the following code in tradingview; High52 = ta.highest(close, 52) I would like to do the reverse and find out the X-week high of the mouse-selected close price. How do I find X? I want to find out…
user3848207
  • 3,737
  • 17
  • 59
  • 104
-1
votes
1 answer

how do i plot a vertical line in pine script whenever the 50 ema crosses up or down the 200 ema?

I keep getting mismatch. whats wrong with it? I want to be able to plot a very faint vertical line indicating that the security is either in an up or down trend. someone please help.
-1
votes
2 answers

Pine Script: horizontal line above previous day close price

I want to create a pine script indicator which draws horizontal line 100 points above based on the previous day close price. E.g. If Previous day close price is 1500, i want horizontal line "100 points above previous day close price" i.e. at 1600
-1
votes
1 answer

Want to access previous trades data before entering a new data

I want to access trades data of last 3 months in pine script before entering a new date , how can i do that
-1
votes
1 answer

pinescript coding for tradingview

I need a pinescript code for below scenario. Can anyone help please... tEma=(close,25) if current candle crossesover tEma then calculate close price minus tEma price(value)close-tEMA if the value is <5, bgcolor it should be green with 80%…
-1
votes
1 answer

How to write code which detect high (highest point of candle) of biggest candle in a particular time range in Pine-Script?

I need help in getting the highest point of biggest candle in a particular time range of any previous session irrespective of my current session.
-1
votes
1 answer

Plot buy or sell only when candle closes

I am developing a pine script indicator for Tradingview, and I would like some help: is there any code or command to make my plotshape command appear only after the candle closes? This would avoid premeditated signals, which can vary before the…
-1
votes
2 answers

Internal server study error (pinescript/tradingview)

I'm working on a score strategy, based on several indicators. The script has no error, but when i add the score sistem i got "Study error: internal server study error" score = 0 plot(score) if ma_buy score := score + 1 if st_buy score :=…
-1
votes
1 answer

Cannot call 'fill' with argument

I can`t fill between ema and cmf! Thank you for your help! ////@version=5 //indicator(title="Chaikin Money Flow", shorttitle="CMF", format=format.price, precision=2, //timeframe="", timeframe_gaps=true) //var cumVol = 0. //cumVol += nz(volume) //if…
Rony12
  • 3
  • 2
-1
votes
1 answer

how to set max draw down per trade in pine

hi guys so i have a cross over strategy in pine, it dosent have tp, sl it simply buys on bullish cross over and sells at bearish i keep it as it is without messing around with tp and sl but i wanna set a max draw down of 5% percent that if it falls…
-1
votes
1 answer

How to take the colour of a line plotted by an indicator and assign a number based on that colour (if colour X, -1 or if colour y, +1)?

I have a small riddle that I can not manage to solve for a good while now! It is possible to assign colours to values when coding a TV indicator but is it possible to do the opposite - to assign values to colours taken from an other indicator? In…