618 questions
0
votes
0
answers
72
views
How to Reset Entry Conditions After Exit in Pine Script Strategy Generated by Pineify?
I'm developing a trading strategy using Pine Script on TradingView, and I've utilized Pineify to generate the initial code. The strategy is based on Supertrend indicators and includes specific entry ...
1
vote
0
answers
58
views
How do I synchronize different time frame on pine script?
I am kind of new to this stuff and would like some help with my pine script. I am trying to script a simple strategy which buys once 1 min, 5 min and 15 min MACD are all in dark green and sells when a ...
0
votes
0
answers
53
views
Pine Script Strategy Alert on Daily Timeframe
I have created a simple Pine Script RSI strategy for stocks on Daily Timeframe with the alert function, the issue is the alert get triggered at the end of the close bar, I want to be trigerred at the ...
0
votes
0
answers
46
views
Open Daily Line Normal Distribution
I've a discrepancy between my indicator and the line plotted.
(SDev Levels wrongHere the screenshot of the chart and below the code in pinescritp)
The standard deviation -1 in the script is -1.54%.
...
0
votes
1
answer
50
views
Pinescript Strategy Alert Triggered when market closed
My strategy was made for the Daily Timeframe but the alert is triggered at 3:00pm instead of been triggered tomorrow when the market is open how can I fix my script
Strategy
chaikin_length_short = ...
-3
votes
1
answer
137
views
Open Daily Line Normal Distribution Standard deviations (+1/-1, +2/-2, +3/-3) [closed]
How can I plot the daily opening line + add this levels (SDEV) above and below?
Above Daily Opening Line: +0.59%, +1.19%, +1.5%, +2.38%, +3.57%
Daily opening line --------------------------------------...
0
votes
0
answers
68
views
In Pinescript v5, I am not able to maintain persistent state of a variable
I am in the process of developing an indicator in pinescript v5 which plots buy/sell signal and based on that fires the alert condition to execute auto trade.
The problem I am facing is, 1. Assume ...
0
votes
0
answers
332
views
Swing High/Low tracking to find out the bias
I've tried to modify the code below Swing Points By:tufedtm in term of my desired conditions. Since I'm not familiar with arrays and I am rookie in coding, may I write what I'm expect may be you can ...
0
votes
0
answers
48
views
custom OHLC data based on Expiry
How to fetch OHLC data based on expiry periods for multiple time frames (Weekly, Monthly, Quarterly, Semi-Annually, and Annually) in Pine Script?
Define Expiry Rules:
Weekly: Expiry is the last ...
0
votes
2
answers
285
views
I am merging the RSI and VWAP codes to create a AI bot. The error is - The 'strategy.exit' function does not have an argument with the name 'when'
I am new to pinescript/ coding/ AI/ trading and am using chatGPT to sort of gain an understanding of things.
I am merging the VWAP and RSI code to create an AI strategy. I come to the same error ...
0
votes
1
answer
71
views
how to check a condition for all candles between two bars in pine script?
hi in the pine script below a_index is the bar_index of a candle that already is saved with this code a_index:= bar_index and i want to check a condition for all candles between this one and the ...
0
votes
0
answers
99
views
Discrepancy in open high low close value for straddle chart in pine script
Below is the code i am using for genearte candle stick chart for straddle options for nifty. But when i plot same chart on tradingview the high low values are different than they should be. Can ...
0
votes
1
answer
58
views
Pine Script: I want to plot bomax value on data window
Iam very new to pinescript, in the given code i want to plot bomax level on data window, so i can see the data there in trading view, here's my code:
//@version=5
indicator('Breakout Finder', 'BF', ...
1
vote
3
answers
906
views
Overlay "true" and "false" at the same time in PineScript
Recently I wrote a simple indicator with PineScript and published it on Tradingview so that my friends could use it. The code was like this:
// This Pine Script™ code is subject to the terms of the ...
0
votes
0
answers
99
views
Pinscript 2 - Write strategy instructions for alerts and webhook
I have an indicator that is still written in Pinscript 2. I tried to convert the indicator to Pinescript 5.
Unfortunately, the indicator loses its precision when converted to Pinescript. The displays ...
0
votes
1
answer
327
views
How do I fix a syntax error at input in Pinescript
Hi guys can someone help me to understand what is wrong with this code ? I keep receiving the msg syntax error at input barcolor
Here's the code
// This Pine Script™ code is subject to the terms of ...
0
votes
1
answer
71
views
Pass alert from one script to another
I have alerts two indicators first over candles and second at lower pane. I want to pass the alert value Sell1 of first indicator to another (It can be either one from first to second or second to ...
0
votes
0
answers
78
views
Pine Script Levels and Ranges - Visualization losses some levels when displaying range levels
Chart ImageFirst, I would like to point out that I am not a coder, I have a personal working script that I developed with the help of AI. The script is designed to visualize support/resistance and ...
0
votes
1
answer
89
views
Pinescript block of code executes more than once despite the flag
Can someone tell me, why does this code execute more than once?
var testalert = true
if testalert and timenow > 1724003180000
strategy.order("TestLong", strategy.long, limit=61000, ...
1
vote
1
answer
108
views
Custom volume indicator for future indices volume above 50K show in spot indices
I want to see future indices volume in the Spot chart with customized volume only above 50K. For this, I made the script. It's working fine in future charts however volume bars are not getting ...
0
votes
1
answer
80
views
Pinescript - Realtime close value in the past
When using my indicator, I would like to write the realtime price of a realtime candle in a var and use it later for price calculations. The problem is, however, if I write the price like this:
varip ...
0
votes
1
answer
80
views
Pinescript - Compare price of Premarket with another close price
I want to trigger a function when two prices have the same value. Unfortunately, I can't do this.
Apparently the prices are not quite the same and I can't run the function. How can I solve this ...
0
votes
1
answer
101
views
need to remove repaint logic of trading view indicator
i am using below indicator in trading view
Indicator name: Higher Timeframe High & Low [ChartPrime]
currently this indicator repaint the signals(remove the signal), if signal candle high/low is ...
0
votes
1
answer
95
views
Save intermediate price of realtime candle in var
I want to write the candle price in a var for every true of my indicator. I also want to output every candle price that was achieved by the indicator over the day in a total. Therefore, I want to ...
0
votes
0
answers
316
views
building a News filter using economic calendar by toodegrees
I want to extract these values from the script
a bool for cpi = flase/true for the day
string for cpi time
a bool for nfp
string for nfp time
a bool for fomc
string for fomc time
a bool for bank ...
0
votes
0
answers
145
views
Pinescript request.securities not returning consistent data, pinescript v5
I requested data from a higher timeframe "selectedTimeframe" but the float array returned is completly incosistent with what i have on the actual higher timeframe
note: the chart below is ...
1
vote
0
answers
46
views
How can i join 3 different alert conditions together with logical operators
I want to join 3 minute macd signal crossover alert on 3 minute timeframe. The alert should only be activated when 15 seconds macd is under zero line and macd crossover signal. Also same for when 3 ...
0
votes
1
answer
108
views
Mark specific candle based on opening sum digit
The day's opening number is 48786.
To reduce this to a single digit, add all the digits together:
4 + 8 + 7 + 8 + 6 = 33
3 + 3 = 6
So, I want to mark the 6th candle in intraday 5 min time frame. This ...
-2
votes
1
answer
212
views
How to make RSIS to move on vumanchu like crypto faces does on his market cipher b which smoothing and inputs do i have to use?
enter image description here
here i got example of someones else indicator the guy who made this copied two rsis i dont know how as you can see in photo purple > blue and white(RSI) i would like to ...
0
votes
1
answer
52
views
How to handle mathematical bool operations in v4
I have below indicator and i tried to convert it into version4 but getting following error
17:12:06 Error at 14:0 Cannot call 'operator -' with 'expr1'=series[bool]. The argument should be of type: ...
0
votes
1
answer
57
views
Rewriting Pine Script session function version 4 to 5
The session.ispremarket function is not working as it had in version 4 of Pine Script. The following code below worked just fine in version 4 and I can't find what has changed in the Session Function ...
0
votes
0
answers
54
views
False Alert Labels Pine script
I have one code through which I get label alerts, but there is a problem. I get false alerts where the labels are deleted. I only need the alerts which are true( Alerts shoud not be triggered for ...
-1
votes
1
answer
45
views
Why if i have continues plot mark the label is only at the first mark
If have continuous plot marks, the label is only displayed on the first mark. Is there anyway to change this behavior? I want each candlesticks to have 2% display.
plot(stopLossPrice, color=color.rgb(...
0
votes
1
answer
137
views
Problem with time 1 minute and request.security
I wanted to know why when I want to see the crossover and crossunder that occurred in the 4-hour timeframe in the 1-minute timeframe, it is not displayed in the table for the symbol related to the 4-...
0
votes
0
answers
56
views
Write a Box and push in array but dont show
i want to push a box in ArrayBox but i dont want to ahow the box on chart, if i change color to color.new(x , 100) its show the box with no color.
or if i remove the box with boz.delete(x) the ...
1
vote
1
answer
73
views
Deletion of labels not working in Pine script
var label H1 = na
var label H2 = na
var label H3 = na
t1 = time('0930', session.extended) // 1440=60*24 is the number of minutes in a whole day. You may use "0930-1600" as second session ...
0
votes
1
answer
85
views
How to compare Array Elements by greater than?
I want to create Pinescript Indicator, which compares Three Swings by Price Units and Time Units. There is Swing 1's Price and Time Units, Swing 2's Price and Time Units, Swing 3's Price and Time ...
0
votes
1
answer
101
views
Lines from a date picker
What I'm trying to get in Pinescript Tradingview are horizontal lines generated from a date picker. Selecting a date(s) should make a new line or lines using that days high and low. The calculation is ...
0
votes
1
answer
658
views
Cannot modify global variable in function in PineScript
This is my Pinescript code.
//@version=5
indicator("Strategy", overlay=false)
var count = 0
count := nz(count[1],0)
counter() =>
count := close > close[1] ? count + 1 : count
...
2
votes
0
answers
69
views
How can i program 'previous bars open price' to appear in an alert message
currently i have an alert set to arrive in my discord server, it is triggered on an engulfing candle. what i want to achieve, is when this alert triggers, is to deliver the previous bars open price as ...
0
votes
1
answer
49
views
strategy.exit is not being executed in long position while does executed in short position base on the same calculation
I'm trying to manually set a trailing take profit price.
I am calculating my trailing take profit price every time I hit a new high (while in long)
and every time I hit a new low (in short position).
...
0
votes
1
answer
180
views
Price if condition is met
I try to give out the real price when a condition is met. I tried using ta.valuewhen for this. Since I have to provide a source in the code, the price is always displayed after the source. So if I ...
1
vote
1
answer
116
views
How to compare arrays using PineScript?
I want to compare an array like this:
string_array = array.from("A", "B", "C", ...)
float_1_array = array.from(1.5, 2.5, 3.5, ...)
float_2_array = array.from(4.5, 5.5, 6....
2
votes
1
answer
308
views
request.financial() limit workaround (PineScript)
I'm trying to get the full set of financial data on TradingView, we can get this type of data calling it like that: 'request.financial(syminfo.prefix+":"+syminfo.ticker, "...
-1
votes
1
answer
126
views
Why does this strategy only take 2 trades a day?
the strategy works fine i just need it to take more than 2 trades a day(without counting the one that closes all the trades at the end of the day can someone please help?
https://it.tradingview.com/v/...
0
votes
1
answer
154
views
Having trouble converting version 2 to version 5
I am having trouble converting v2 to v5 any help greatly appreciated.
Getting below errors:
Error at 565:28 Undeclared identifier 'bool' Error at 565:23 The
'input' function does not have an argument ...
0
votes
2
answers
78
views
why is there a syntax error at line 27/ pine_vwmean?
//@version=4
strategy("HOSS Scalping", overlay=true)
// Custom OBV RSI Indicator
OBVIndicator() =>
obvsrc = close
change_1 = change(obvsrc)
obv = cum(change(obvsrc) > 0 ? ...
0
votes
1
answer
110
views
How to draw a rectangle in pinescript v4
I tried to create a rectangle using this code in pinescript v.4:
b = box.new(bar_index[100], highest(high,50), bar_index[10], lowest(low, 50), color.purple, 1, line.style_solid, extend.none, xloc....
1
vote
2
answers
185
views
Modifications of PineScript indicator
Hope you are doing well.
I'm working on a Pine Script indicator and I've successfully implemented the main logic, but I'm facing challenges with further enhancements. Here is the code:
//@version=5
...
0
votes
1
answer
77
views
Write a variable result in pinescript screener
Pinescript question.
I have 4 variable, they are:
-longA = DoWhatIwant
-longB = DoWhatIwant2
-longC = DoWhatIwant3
-longD = DoWhatIwant4
I would like that, when a variable occurs, I could print a ...