Questions tagged [pinescript-v5]

40 questions
1
vote
0 answers

trouble storing higher timeframe swing points on lower timeframe chart.?

Hey guy's would really appreciate any help as to why this code doesnt work as intended it to. basically here is a sample of the code im using, it is supposed to find higher timeframe swing points and mark them on the lower timeframe chart selected.…
sam
  • 11
  • 2
1
vote
1 answer

How do you add alert to OBV-MACD indicator when direction changes

Hello im trying to add and alert to OBV-MACD indicator on pinescript when direction changes but i dont know how. I know probably simple but im new to pinescript so i dont know where to start I think it has to go somewhere here, where the plots…
0
votes
1 answer

Keep Plotcandle active all the time Pine Script Ver 5

I want to change the candlestick chart color based on the SuperTrend indicator. I did but there is a problem. The candlestick colors change only if I put my mouse on the SuperTrend line. I want these colors to stay all the time. Here are my…
0
votes
0 answers

I want to make tradingview pinescript screener for my custom indicator

I want to make stock scanner if any stock (from NSE:Nifty 500) crossed above (on D timeframe) the Daily timeframe Fibo Pivot Resistance R2, then name should appear on screen. i tried to check on google but no solid answer
0
votes
0 answers

Pinescript: How do I make my Premaket High and Low Plot from premarket open?

I'm trying to plot all key levels on the chart. The Previous day Open, High, Low, Close (OHLC) is plotted correctly colored in Green, Light Green, Orange, Red, respectively. (I have no problem with them) My challenge is the way my Premarket Highs…
Arcee
  • 149
  • 8
0
votes
0 answers

Plot All Weekly Open/Closes as Horizontal Lines in Any Timeframe

Yes, this sounds crazy but it makes sense to me. I'm trying to figure out how to plot all historical opens and closes of weekly candles as horizontal lines in any timeframe so I don't have to manually draw them every time I work with a new chart and…
vannnnnn
  • 1
  • 1
0
votes
3 answers

Why does the first alert trigger multiple times after the alert conditions have been met with a reset in it

Why does it trigger multiple times after the alert conditions have been met for the alertcondition(confirmed_signal, title="Price crosses upper range with confirmation", message="Price has crossed the upper range with confirmation") ? I am using the…
0
votes
1 answer

Pinescript: Why does the "on-chart" close work in Mansfield but request.security() does not?

I got a script to calculate the Mansfield Relative Strength (MRS) and it works like a charm. However, I am trying to build a more complex indicator that uses the MRS in conjunction with other indicators to limit the number of times it prints. …
Andrew Steitz
  • 1,856
  • 15
  • 29
0
votes
0 answers

I want the box to be deleted after is 5 times break through box

I'm new to pine programming and I struggle with this for hours. I want each drawn box to be valid until it is broken 5 times with closed candle. `var bool gapImbBull = na var bool gapImbBear = na // look for bullish GIBs if last_bar_index -…
0
votes
0 answers

Round strategy position size

How could we round strategy position size to 0 or 1 or 2 precision? Eg: Strategy is setting with Properties (Order size: 100% if equity) place order B1 165.967 , but I want to round it to 165 and send it when signal alert immediately. I have tried…
Tien Tran
  • 36
  • 4
0
votes
1 answer

take profit is not working but stop loss is pinescript

hello i'm trying to set a specific take profit amount in pine script code but it is skipping take profit amount and just hitting stop loss amount //@version=5 strategy("Golden cross","GC", overlay = true) ma9 = ta.sma(close,9) ma50 =…
0
votes
2 answers

Pine Script failed to plot some data

I'm trying to plot some data in pine script, some data failed to plot; here is the script // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © subikshababu //@version=5 indicator("Gain…
0
votes
0 answers

Triggering entry on Renko chart based on opening of following timeframe

I’m testing a PineScript strategy based on a simple EMA crossing on a Renko chart. One problem I’ve come across is simply that, if in any given timeframe, multiple Renko bricks are printed that cause my EMA crossover to trigger, it will say my entry…
0
votes
1 answer

How to handle current bar minutes that add up to over 60 minutes [pinescript v5]

I have a script that captures values at specific but varying bar times after a market opens. Market open and subsequent capture time is specified via menu input. For example: hr_open = input.int(defval= 9, title='Hour') // input opening…
paamachat
  • 53
  • 11
0
votes
1 answer

what causes script not returning value

this is a script converted from version 1 to version 5, added the function of Multitimeframe. it is not plotting anything on TradingView Chart. here is the code. any help appreciated. //@version=5 indicator("GG EhlersEOT V5", shorttitle="GG…
Ying
  • 1
1
2 3