7,432 questions
-1
votes
0
answers
20
views
How to Draw a Horizontal Line on TradingView Based on the Highest Volume Day in the Last 200 Days?
"I want to draw a horizontal line on a TradingView chart. The process is as follows:
Identify the date with the highest trading volume in the past 200 days.
Find the high price on that date.
Draw ...
0
votes
0
answers
22
views
Order execution data in pine-script indicator
Is there a way to get the order execution data in a pine-script indicator? I'm looking to plot order executions on a chart. I'm not interested in the strategy tester or backtesting. This is for a live ...
0
votes
1
answer
24
views
Can someone help me with moving average logic in Pine Script?
I'm facing an issue with a Pine Script strategy I've been working on, and I'd appreciate your help.
Strategy Overview:
Entry condition: the strategy enters a trade when the price crosses above (for a ...
0
votes
1
answer
22
views
Keltner Channel Funktion in Trading View delivers another value than the chart is showing
i have a problem with following statement in relation to Keltner Channel:
[middleband, higherband, lowerband] = ta.kc(close, 10, 2, true)
Hi,
you see the blue arrow near the long green candle in the ...
0
votes
1
answer
20
views
Pine Script history reference (e.g. [1])
How does the history reference (e.g. [1]) work on UDTs defined with the var keyword in the new Pine Script version 6?
It works fine when it's defined without the var keyword, but I cannot get it to ...
-1
votes
0
answers
20
views
How to Auto select Multi notification & Store the previous alert Trigger condition's price/time Data
I have some doubts :
1:- suppose NSE: NIFTY is at 24300
my entry signal triggered and the system executed ATM CE of 12 Dec on my broker account.
after some time my exit signal was triggered and NSE: ...
-1
votes
0
answers
28
views
Trading View Pine Script Help Needed: Persistent Error Issue [closed]
Mismatched input 'end of line without line continuation' expecting ')'
I'm developing a trading strategy in Trading View's Pine Script and encountering an error I can't resolve. The error appears in ...
-2
votes
0
answers
27
views
Could somebody help make order in chaos of arrays? [closed]
I'm tracking a bunch of stuff with arrays. Not very experienced with arrays. In cooperation with wise gpt, I have managed to put this stuff together. Any suggestions how to make it easier to manage? ...
-1
votes
0
answers
29
views
I have merged RSI and VWAP to create a ChatGPT bot Strategy. VWAP on this bot is considerably different from that which is on the base VWAP code. WHY? [closed]
The VWAP code I used
//@version=3
study("VWAP", overlay=true)
// There are five steps in calculating VWAP:
//
// 1. Calculate the Typical Price for the period. [(High + Low + Close)/3)]
// ...
0
votes
0
answers
22
views
Can I get securities from a certain exchange, then filter them through loops & conditions to then list them on the chart?
I've went through the documentation & also have searched for the functions available but can't seem to find something that works for my logic. Have also tried using AI but can't be 100% sure due ...
0
votes
1
answer
38
views
EMA Cross Strategy Does Not Work In Pinescript Version 6
Using the script below, I changed the version from '5' to '6' and it no longer works. Applied to QQQ for testing. Contacted TradingView and they said there are no errors but it clearly does not work. ...
0
votes
2
answers
46
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
19
views
Chart Not Displaying Top/Bottom Logic Based on High/Low Comparisons
this is my first time coding with Pine Script. I’m encountering an issue while coding an indicator for my strategy and would really appreciate your help.
Objective of the indicator: Identify Tops and ...
0
votes
1
answer
45
views
how to get a series of all time high?
I am trying to write a Pine Script function that will take a series of data (e.g., [1, 2, 3, 4, 5, ..., 100]) and return a new series where every element is replaced by the highest value in the input ...
0
votes
1
answer
39
views
Does pinescript that allow you to hide numerical values on the Y-axis
I'm preparing an indicator whose output is relative. The actual values are not only meaningless, but distracting. Is there some pinescript code that will prevent these values from being displayed on ...
0
votes
1
answer
30
views
In pine script the code that ı copy from someone else is give an error but original code has not an error
London = time(timeframe.period, Londont)
US = time(timeframe.period, USt)
Asia = time(timeframe.period, Asiat)
var clondonhigh = 0.0
var clondonlow = close
var londontime = time
var flondonhigh = 0.0
...
0
votes
1
answer
31
views
Run code at custom duration timeout intervals
I want to execute code in a TradingView indicator at custom timeout intervals, specifically when a new bar appears for multiple custom timeframes. I'm using Pine Script and encountering strange ...
-2
votes
0
answers
46
views
spaghetti chart with customized labels [closed]
I would like to create a spaghetti chart where several assets are plotted, showing for each of them the % of price change from the first visible canlde on the left.
I would also like to customize the ...
0
votes
0
answers
50
views
Why does dynamic_requests give different values for request.security?
I have a trade plan that is based on a higher timeframe behavior of the stochastics. When I noticed it wasn't marking the trades I expected, I had to start digging in with debugging and logging. I ...
-3
votes
0
answers
56
views
Pine script security function always returns premarket open value, I want market open .using 5 minute chart [closed]
Pine script security function always returns premarket open value, I want market open .
I am using 5 minute chart.
I have gone through the pine script documentation and also many sample scripts, but ...
0
votes
0
answers
31
views
Entry and Exit on same bar. Stoploss immediately executes on Entry
I am really struggling with trying to get my stoploss at the right position. What i am simply trying to do is to get a fixed stoploss with certain amount of ticks below my entry but no matter how i ...
0
votes
1
answer
31
views
Pine Script - Is there a way to plot only the latest data?
For example, If I am using a ma indicator and a daily chart. I want it to only show the latest day ma value on the chart; If I am using a 1 min chart, I want it to only show the lastest 1 min value on ...
0
votes
0
answers
24
views
Tradingview Pine Script Close 9 Contracts and move to Break even
I have been working on a script that will take TP at 42 ticks then close 9 contracts leaving 1 contract left and move stop loss to break even. I feel like I'm close! But it's not working when I test. ...
0
votes
1
answer
38
views
Pinescript only plots a few dates
I'm trying to mark specific dates on the chart as bullish or bearish based on an external signal.
In this script I supplied 9 dates, but only 3 were plotted. Why?
All the 9 dates in script below have ...
0
votes
1
answer
21
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
63
views
How can I plot the last value in this for loop iteration?
In this function, I've initialised lastBarHigh, which is to get the last iteration value, and I am returning this value for entire function, so that i can see my value on display window, but instead, ...
0
votes
1
answer
32
views
What is the exact text string returned by ```syminfo.prefix``` for ETFs in the NYSE Arca exchange?
Question: What is the exact text string returned by syminfo.prefix for ETFs in the NYSE Arca exchange?
Context: syminfo.prefix contains the exchange of the current ticker. If you are using the free ...
0
votes
1
answer
42
views
Get high from specified date as starting point, not all time
Trying to modify code that gets high from all time for multiple tickers.
Want to add user input for specified date to start from, this year, etc.
I can't figure out how to specify the starting bar.
I ...
0
votes
0
answers
51
views
Two indicator pine-script v6
I have two indicators with the v5 update and I converted them to v6. One of the indicators is on the chart and the other is in a separate window. After the update, the two indicators appear on the ...
0
votes
1
answer
27
views
How to enter on the open of a new bar (not wait for it to close)?
I want to create a "gap" trading strategy - i.e., when the open price of a new bar is different from the close of the previous bar.
The entry should be when the new bar opens... however I am ...
0
votes
1
answer
23
views
Does an indicator lag in calculations with barstate.isrealtime when the script is laggy?
Assume you have a really big all in one indicator, and you decide to add a feature that uses realtime data with barstate.isrealtime to calculate realtime data with varip variables. Now if the ...
0
votes
1
answer
48
views
How to add an input checkbox that will only show the FIRST label
I want to add an input checkbox to either only show a label on the first candle when the RSI goes extreme and crosses the input level (when checked ON) or shows them on every candle in the extreme ...
0
votes
0
answers
20
views
Is it possible to use different scales?
How to combine left and right scales in one indicator for MACD, RSI, and Stochastic in Pine Script?
I have a script that combines MACD, RSI, and Stochastic, and I want to have the following setup:
...
0
votes
1
answer
43
views
How do I enter and exit positions in my Pine Script strategy?
Here is the code below. I created a signal and tested it with the @study feature. I am trying to selectively open a long (buy) and close the long (sell) based upon the value of signal.
It does not ...
0
votes
1
answer
45
views
How do I code an exit strategy in TradingView pine that exits pyramiding trades individually?
I am trying to write code that will close each opened trade at the close of the first bar in which that close would produce a profitable result for that particular trade. Closing on the same bar as ...
0
votes
1
answer
31
views
How can I add labels for long and short strategy entries?
The script below plots buy and sell at every bullish and bearish condition. I would like for it to only plot when a long or a short position has been entered. Kindly advise!
if inDateRange
if ...
0
votes
1
answer
38
views
Tradingview RSI signal trade execution lag question
I am trying to make an RSI trading strategy that executes an end of bar trade entry when RSI closes below a certain level on that same bar. All my entries are off (late) by exactly one bar.
Right now,...
1
vote
0
answers
40
views
How to anchor VWAP to pivot highs/lows
I am trying to anchor VWAP to pivot Highs and Lows using functions ta.pivothigh & ta.pivotlow with ta.vwap. The trouble is when ta.pivothigh/low is used as the anchor argument in the ta.vwap ...
1
vote
0
answers
38
views
The value of the two variables calculated in same way but can't match in pine script
I am trying to transfer the pine script to another programming language, so I need to figure out all the variables. Here is my code :
// Define bar structure for Heikin Ashi method
type HA
...
0
votes
1
answer
26
views
How to add values labels to the fib levels in the graphic?
l was wondering how do l add these value labels (0,0.11,0.25,0.3,0.38) to the right side of the fib lines FStyles:
f1Lvl = f1Tog?input.float(0, title = "", group = fib_group, inline = "...
-1
votes
1
answer
51
views
How can I exit on one bar and wait to enter until the next bar?
@vitruvius, thank you for advising on to use last_exit_bar_idx!
I tried to apply it but the script below keeps skipping bars before entering a new trade. Kindly advise on what could be wrong.
// ...
0
votes
0
answers
56
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
33
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', ...
0
votes
0
answers
26
views
pineScript to thinkScript - request
I want to conver the pivot point Supertrend indicator to ThinkScript- but I am unable to ;
====
I converted the pineScript to ThinkScript - but its not work; and as far as I could debug issue is with &...
0
votes
1
answer
31
views
testing multiple scripts simultaneously in pine script
I have about 30 different strategies which I've built using pine script and I want to test how they would have performed working concurrently and not just individually.
Is there any way to do this? If ...
0
votes
1
answer
55
views
Plotting at bottom of chart like basic Volume indicator
How do I plot on the bottom of the chart like the basic volume indicator does? I want to stack up some dots that will light up if certain conditions are met.
Thanks
0
votes
0
answers
72
views
Calculation Ema TRadingView & Ninjatrader different
on this page: https://www.tradingcode.net/tradingview/exponential-moving-average/ there is the formula for calculating ema in trading view:
pine_ema(src, length) =>
alpha = 2 / (length + 1)
sum = ...
1
vote
1
answer
70
views
Pinescript: How to detect a crossover and crossunder of plotted lines based of pivots support and resistance plotted by array and map function?
enter image description here
Please help guys I have not found any solution yet on how to use a ta.crossover(close,????) to detect a candle breakout off a support or resistance from these plotted ...
0
votes
1
answer
49
views
Array issues with pine script
I am writing a strategy for pine script and I keep getting the error code like the data cannot be retrieved.
I tried to find a new string to be able to retrieve the data but there's nothing that I ...
0
votes
1
answer
34
views
How to "store" the latest value from a longer timeframe?
I am trying to add a filter in a script with a 5 minutes timeframe that filters for the latest available 15 minutes MACD trend. How do I store the latest returned value from the 15 min timeframe until ...