7,299 questions
0
votes
0
answers
34
views
How to plot with offset in multi-timeframe script?
I am developing pinescript indicator with multi timeframe support
indicator("My indicator", timeframe = "")
I want to plot somevalue with offset
plot(somevalue, offset = 5)
This ...
0
votes
1
answer
90
views
Other Time Frame values are strange
I am new in pine script and just tring to print the value of RSI of two different timeframes eg "D" (Daily) and "60" (Hourly) using the following code but whenever I change the ...
0
votes
1
answer
59
views
Why are my Daily MA50/100/200 lines jagged instead of smooth even with smoothing turned off?
I’ve written a Pine Script to display the Daily 50/100/200 Moving Averages on lower timeframes (like 1H or 15m).
I’m pulling the data using request.security() to lock it to the 1D timeframe so it ...
0
votes
1
answer
57
views
Pine Script request.security weird outcome (calculates future dividend to history)
When using request.security function in Pine Script, like in the script below, I find weird outcomes when there is dividend at play.
I used the function a lot for crypto... no dividends, so no problem ...
0
votes
0
answers
48
views
How to get security_lower_tf 1hr data from previous 1D candle, not current
My indicator is on the daily timeframe and I'm using the security_lower_tf to gather the 1hr volume data. The problem is that security_lower_tf only returns as many hours there are in the current/...
0
votes
0
answers
51
views
Pine Script session indicator plotting different candles across timeframes and not resetting sessions properly
I am trying to write a Pine Script indicator that draws trading sessions as a single candle (based on user-defined start and end times).
The indicator should:
Plot session candles consistently across ...
0
votes
0
answers
62
views
Pine Script v6: How to make indicator legend background transparent to match pane background?
I've created a Pine Script indicator with a custom pane background colour using bgcolor(). The background displays correctly, but the indicator legend area (showing indicator name and values) has its ...
0
votes
0
answers
71
views
Array does not keep his content via barstate.isnew in realtime
I wrote a simple indicator to test push/pop upon array.
//@version=6
indicator("My script test unshift array", overlay=true)
var t = array.new_int()
if barstate.isnew
if array.size(t) &...
0
votes
0
answers
109
views
How to read the previous day close with PineScript
I want to create an indicator and require the previous trading day close.
Currently I receive wrong values, which are closing prices from further in the past and not yesterday.
I am testing this ...
0
votes
2
answers
84
views
How do I plot finalized candles only?
I have started on a project in pine script: trying to create the 10 minute chart as an indicator. For the first step, I have decided to plot all finalized/closed candles (for the most accurate data), ...
0
votes
1
answer
74
views
Removing overlapping levels / Zones in pine script lines.new
I have written a code to mark out pivot Zones.
I am able to plot the zones and remove the ones that are broken.
I want to remove the overlapping levels and keep the newer ones amongst the overlapping ...
0
votes
1
answer
64
views
Pinescript exit order never filled with partial profits
I made a simple script that take a trade with an order bracket with Take profit and stop loss and when price go up to 50% of Take profit, i sell 70% of the contract and set the new stop loss at break ...
0
votes
0
answers
87
views
Profitable strat, draw triangle above candle break
I have a profitable indicator that displays market structue break when I candle breaks. I am tray to print a triangle about the actually breaking candle but it prints about 10-14 bars latter. I am ...
0
votes
0
answers
175
views
Struggling with code that is tracking Highs and Lows
I wanted to make an indicator for my trading Group that detects and alerts a thing called " 2 Candle Rejection". its a concept used by a couple of traders to determine if a Fair Value gap ...
0
votes
1
answer
328
views
I get the error "historical offset beyond historical buffer" in replay mode
I get an error message at line 47 "historical offset beyond historical buffer" when in replay mode. Is there any easier way to show what I want to see and get this error worked?
I want to ...
0
votes
1
answer
270
views
Pine Script v6: Syntax error at function definition 'input "("' - How to declare functions correctly?
I am trying to combine two Pine Script indicators (LuxAlgo Reversal Signals and VuManChu B Divergences) into a single script. I have recently migrated the script to Pine Script v6.
I am consistently ...
0
votes
0
answers
62
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
57
views
Pine script: how can I add a "Standard deviation channel" to a polynomial regression?
I have found a script for generating a polynomial regression, which I have adapted to my needs and which basically works.
However, in order to be able to use the script the way I want to, I need a ...
0
votes
1
answer
146
views
Creating a supply and demand EMA cloud on trading view. I keep having issues with "Undeclared identifier 'label'"
I'm having issues with supply and demand zone labels.
// === ENTRY SIGNAL LOGIC ===
bullish = close > open and close > emaFast
bearish = close < open and close < emaFast
inDemandZone = ...
1
vote
1
answer
111
views
How to get dynamic variable value in alert messages with placeholder
{{alertcondition.message}} does not work:
My Alert Script (pineversion=5):
INalIDAMlong = input.string("long", title="long Alert", group="Alert Messages")
...
0
votes
0
answers
26
views
Loops in request.security not work in TF 30 sec
I need the loop to return the same value for a smaller time frame, If 1H = 3 All candles of smaller time frames should be 3, as shown in the image where each TF presents a different value. What is ...
0
votes
0
answers
37
views
Trading View Pine Script: Can see indicator trigger on chart but alert not getting triggered
I have tried to create a trading view indicator based on below logic:
Pre-Market High is more than 50% of previous day market closing price
Today's market session price is more than 20% of Today's ...
1
vote
0
answers
68
views
TradingView - PineScript - Entry not filling (sometimes)
I do have built a strategy that waits for a certain trigger, sends an entry order and either manages that trade once filled or cancels that entry order after one day (kind of emulating an order ...
0
votes
1
answer
52
views
Calculate no of bars to a date in future in pine script
From my formula, I have calculated a future time in UNIX format (Eg = 1748457000000).
My current UNIX time is time (eg = 1746157500000).
This difference is approximately 27.18 days (round to 27 days).
...
0
votes
0
answers
29
views
Different result from evaluation ?: na() highestbars
//@version=5
indicator("Double", overlay = true, max_bars_back = 500)
prd1 = 8
prd2 = 20
float ph1 = ta.highestbars(high[1], prd1) == 0 ? high : na
float pl1 = ta.lowestbars(low[1], prd1) == ...