Questions tagged [pinescript-v5]

40 questions
0
votes
0 answers

Pinescript force request.security() to use simple string

I am interested to write an indicator that track VIX futures. The problem is that the ticker name change every mont and every year. For example Jan 2023 = CBOE:XVF2023. Feb = CBOE:VXG2023, etc. Every month has 3 Peter indicator followed by year. I…
0
votes
0 answers

Time and date entry condition

I have a Pinescript strategy which backtests trades made between two dates. It also has the option to stop trades being entered on the weekend. Now I want an extra entry condition, where the strategy only opens trades if it occurs during these hours…
0
votes
1 answer

Trying to solve a Pinescript syntax error

I keep receiving this error in Pine script and it can't get rid of it: Error at 5:18 Syntax error at input '[' //@version=5 indicator("Vertical Line Indicator", overlay=true) // Define the symbols and dates symbolDateList = [ ["MVIS",…
Eric Z
  • 1
  • 1
0
votes
0 answers

How to get indicator values and previous candle's open/close values into variables from higher&lower timeframes for alertconditions

Explanation: I have 2 alertconditions. I have them in my indicator, I apply the alerts on the 15 minute timeframe. That is my main timeframe. I want to receive alert inmediately when all the conditions happen to be met at the same time. Some…
0
votes
1 answer

Higher timeframe alertconditions are not working properly

For practicing purposes I want to create 2 alertconditions inside a pre-made indicator I use, like RSI. I apply it on the 15 minute timeframe. Basically comparing the 10 and 20 period SMA on the 15 minute, 1 hour, and 4 hour timeframes Long alert,…
Rudolphf
  • 3
  • 3
0
votes
1 answer

put label.new() below intestation

I built an oscillator. the read boxes represent the perfect position of the labels I'd like to put a label just below the head of the title. I can easily modify the y axis but I'm not able to modify the x. How can I set label.new() in order to…
0
votes
0 answers

Convert indicator to library

I have a source code //@version=5 indicator("PA-Adaptive MACD + RSI Past + STD-Stepped", overlay = true) //PA-Adaptive MACD w/ Variety Levels [Loxx] import loxx/loxxexpandedsourcetypes/3 import loxx/loxxmas/1 import loxx/loxxpaaspecial/1 SM02 =…
0
votes
0 answers

Pinescript - Problem with request.security_lower_tf() function

I'm struggeling with the request.security_lower_tf() function if I use the tradingview replay. If the replay plays, I'm only getting the last intrabar from the lower timeframe.
ocbvanelle
  • 41
  • 1
  • 2
0
votes
1 answer

I'd like to ask you a question about FineScript's ATR strategy trading

Please help me, teacher.. Stop loss Find the closing value of the lower portion of the ATR Bands when entering the strategy Exit or close when reaching or breaking the value (fixed the lower value up to exit or close) TP Find the closing…
STH
  • 27
  • 4
0
votes
1 answer

Is it possible to only retrieve the latest/last value when using the request.security_lower_tf function in PineScript v5?

So here’s the code that I’m using to retrieve the second timeframes values: secHighArr = request.security_lower_tf(syminfo.tickerid, “1S”, high) aTable = table.new(position.top_center,2,2) table.cell(aTable, 1,1, str.tostring(secHighArr)) If I’m on…
Lew2234
  • 21
  • 4
0
votes
0 answers

How to send tradingview alerts in pinescript on candle close after checking a condition between running candle and historical candle?

I have a requirement to take entry in running candle and exit immediately on candle close if my conditions are not met. I am trying to send alerts on candle close by checking condition on running candle and historical candle. below is my pseudo…
0
votes
1 answer

Pine Script Volume Indicator Not Quite Working

I've wanted to create an indicator that will show me when the current candle's buying or selling volume is higher than the previous (x) candles. I am pretty sure that I have everything, somewhat correct, but I am not plotting anything on my chart. I…
0
votes
1 answer

Get candlestick data in PineScript v5 when on a different chart type?

So I have a script and it’s code is simple: theHigh = high theLow = low theOpen = open theClose = close [PDH,PDL,PDO,PDC] = request.security(syminfo.tickerid, “D”, [theHigh[1], theLow[1], theOpen[1], theClose[1]]) However, if I change my chart…
Lew2234
  • 21
  • 4
0
votes
1 answer

2 Alerts conditions in Script but only 1 can be selected

I have added 2 conditions in the script, one alert should fire when SMA crosses the other SMA upwards, to other alert when the SMA cross the other SMA downwards. This is the script: //@version=5 indicator('SMMA 5-13 cross', shorttitle='SMMA 5-13…
0
votes
1 answer

Error while writing a Pine Script code for a Buy Signal if close prices decreases and increases for n number of days

//@version=5 indicator("Price Movement Check", overlay = true) // Set input parameters for n and m n = input.int(title="Days for price increase check", defval=5) m = input.int(title="Days for price decrease check", defval=2) // Check if close…