Stock vs Custom Symbol OutperformanceStock vs Custom Symbol Outperformance" is a powerful technical analysis indicator designed to help traders and investors gauge the relative performance of a stock against a selected benchmark symbol. This tool enables users to easily visualize how a stock is performing in comparison to another asset, such as an index or another stock.
Key Features:
Custom Symbol Comparison: Input any symbol to compare against the stock of interest, allowing for flexible analysis tailored to specific market conditions.
Outperformance Calculation: The indicator calculates the percentage change in price for both the stock and the selected benchmark, providing a clear view of relative performance.
Moving Average Smoothing: A customizable moving average smooths the outperformance data, helping to identify trends and reduce noise in the signals.
Threshold Lines: Set upper and lower threshold lines to visualize significant levels of outperformance or underperformance, aiding in decision-making.
Dynamic Color Coding: The outperformance bars are color-coded—green indicates that the stock is outperforming the benchmark, while red indicates underperformance.
How to Use:
Select a Benchmark: Use the input field to choose the symbol against which you want to compare the stock.
Adjust Parameters: Modify the moving average length and set your desired thresholds for easier identification of performance metrics.
Interpret Results: Analyze the plot for insights into the stock's performance relative to the benchmark, with the moving average providing additional context for trends.
This indicator is ideal for traders looking to refine their strategies by understanding how individual stocks measure up against key benchmarks in the market.
Custom
[-_-] DictionaryThe script shows an example implementation of dictionary-like data type which can store key:value pairs (Python style). Both keys and values can have any of the following type:
• string
• integer
• float
• boolean
• color
You can add items of different types to the same dictionary (e.g. key = 12 and value = "value" stored in the same dictionary with key = "key" and value = 0.23).
Under the hood dictionary is a custom Object (see www.tradingview.com), that has two array fields (one for storing keys, another for storing values). Keys and values of different types are converted into a string representation when adding a new item to the dictionary. The value is then converted back to certain type (bool/color/etc.) from that string representation when being retrieved. Script also utilises the new Methods (see www.tradingview.com).
The following methods are implemented:
• init() -> initialises the array fields of dictionary (without this the script throws an error "Array methods can't be called when ID of array is na"
• set(key, value) -> add a new item to dictionary; if an item for given key already exists - change it to new value
• getS(key) -> get value of string type
• getI(key) -> get value of integer type
• getF(key) -> get value of float type
• getB(key) -> get value of boolean type
• getC(key) -> get value of color type
• remove(key) -> removes item from dictionary
• len() -> get length of dictionary (the number of keys)
I could not make just one "get" function that returns any type of value (color/string/etc.), so instead I created a get function for each value type. Example usage:
• you add a string item: dictionary.set(2, "string here")
• you add a float item: dictionary.set(3, 24.56)
• to retrieve first value (key=2) do this: dictionary.getS(2)
• to retrieve second value (key=3) do this: dictionary.getF(3)
TICK - Custom Tickers [Pt]Traditionally, the TICK index is a technical analysis indicator that shows the difference in the number of stocks that are trading on an uptick vs a downtick in a particular period of time. This indicator allows user to choose up to 40 tickers to calculate TICK.
By default, it uses the SPY Top 40 stocks, but can be changed to any tickers.
There are options to show:
- Top 7 , ie. can be used for just showing TICK for FAANGMT => $FB + $AMZN + $AAPL + $NFLX + $GOOG + $MSFT + $TSLA
- Top 10
- Top 20
- Top 30
- Top 40
Data can be displayed in candle bars, line, or both.
Enjoy~
Simple OHLC Custom Range Interactive█ OVERVIEW
This indicator show lines of OHLC which can be commonly used as support and resistance zones.
OHLC can be shown table with candlestick visual.
Color of candlestick depends on direction of bullish / bearish of the chosen candlestick.
█ INSPIRATION
Inspired by design, code and usage of CAGR . Basic usage of custom range / interactive, pretty much explained here . Credits to TradingView .
█ FEATURES
Table can positioned by any position and font size can be resized.
OHLC can be in full or simple name.
Lines can be extend either right, left, both or none.
█ HOW TO USE
Only 1 point is required.
Dont worry about magnet, point will attached depends on High or Low of the candle.
█ USAGE / TIPS EXAMPLES (Description explained in each image)
Custom IndexEnables users to create their own custom Stock Index with up to 29 tickers! Has included optionality to include/exclude certain sectors, plot sectors individually and measure in gold. Good for having a look at how your favorite tickers have performed (with your modification of course). Also has option to show Moving Averages for your convenience.
Volume Spread for VSA CustomHey everyone, I have been using volume a lot more lately as price action can sometimes get manipulated but volume shows us the truth!
Anyways, I have enjoyed the Volume Spread for VSA indicator but wished I had the code to change a few settings. This volume indicator includes spread analysis with the ability to customize input values and I'm making it open source so you can do with it as you please.
I have made notes all throughout the code to give suggestions on a few changes or why I have written it in such a way. I have also tried to section everything off to make it easier to see where each piece of the code is used. Overall I think it is a good example of how to code cleanly and how to add useful notes when you are learning Pine for yourself :D
The indicator on the price chart is my Donchian Channel indicator, which you can also find on my profile. This is the one I use every day.
[FR]WmThis a water mark that uses a table to allow placement at 9 different locations on the screen
you can either pick on of the given Date and time formats or you can choose custom and build your own
One of the reasons for this project I wanted to be able to add the "s,m,h" to the water marks timeframe not have i.e. "240" and have it say 4h..
you can select what format for the dates from in the settings if the user selects custom it will make it so you can input what ever format
string into the input box "Custom Format input'"
Hope You Enjoy!
FFriZz
Custom Price LineThis indicator lets you freely customize your price line. Choose between static or dynamic colors for falling/rising prices. In addition you can adjust the following:
Line style
Thickness
Length
Direction
It is also possible to mix different designs by using a single indicator.
Customized Multi EMAPlot several EMA with only one script.
Default EMA: 20、50、100、200.
All of these are adjustable.
Also, Vegas tunnel and filter line can be presented or not according to your needs.
HighLow Box Highlight between EarningsHighLow Box Highlight between Earnings
This is an indicator to highlight area between two earning periods and their highest and lowest points.
It also alternates the highlight color in each subsequent block.
Tested to work in 1D charts and 1M charts
Just drop a message, if you want this further developed with more features.
Note: This was requested by user Meatpye on a forum.
%-[Guz] Vortex Indicator Custom// Custom Vortex Strategy (backtester)
// Custom version of the Vortex indicators that adds many features:
// -Triggers trades after a threshold is reached instead of the normal vortex lines cross (once the difference between the 2 lines is important enough)
// -Smooths the Vortex lines with an EMA
// -Adds Take Profit and Stop Loss selection
// -Adds the possibility to go Long only, Short only or both of them
// ! notice that it uses 10% position size and 0.04% trade fee, found on some crypto exchanges futures contracts
// Allows testing leverage with position size modification (values above 100% position size, to be done with caution)
// Not an investment advice
Simple Watchlist with % Change Screener & AlertsHi fellow traders..
TV has generously increased the number of alerts!!
A Simple Watchlist with heatmap based on % change on daily timeframe.
Gives % change and RSI
you can set the percentage in the input box and then set alerts on your favorite watchlist.
Alerts also include days high and low..
Simple Table and array based code.
set for scrip close >10 can be easily changed in line 43..
Hope you Like it!
Custom Date Buy/Sell StrategyThis strategy allows you to back test longing or shorting during a period of time between two dates.
Make sure you are in the daily time frame while viewing the performance and trade history to ensure you have the most historical data as possible from Trading View.
Finally, due to the way Trading View enters trades at the end of a candle, you must subtract one day from your starting and your end dates.
SuperTrend - Custom Screener and Dynamic AlertsTrading View today published a desktop Bad Internet connection indicator ?! which set me thinking…
Despite recently introduced Dynamic Alerts many scripts do not leverage the information available for active traders and traders on the GO!
So decided to share this script totally ALERT focused on one of the most popular DAY trading indicators.
Of course no more BAD internet problem as long your TV APP is configured , you will have enough data for a mental picture of the chart..
The Alerts give you the BAR Close , %percent gain or loss over previous day CLOSE ++ Previous Day High and Low to effectively plan your trade without a chart!(just in case)
2 additions in the way Alerts are delivered over the last script :
1. You get SUMMARY alerts or concatenated alerts by default , however if you uncomment or activate code lines 48 and 55 you will get individual Stock alerts Too!
2. Summary Alerts will come only if there is some Buy or Sell signal NO more empty Alerts!
Few useful EXTRAS in the code :
1. Flexible code can convert any indicator to screener or Alert function.
2. You will NOT get Mutable Variable error while converting any indicator to screener as long as the function is in "GLOBAL" scope..
3. Many Custom Screeners are available but few give OHLC data in output so easily…and very difficult for traders to MODIFY hundreds of lines of code..
4. For UP or DOWN on SCREEN Stock monitoring copy /paste functions in line 41 and 42 in lieu of CROSS functions in 44 and 51 respectively..
5. You can also uncomment/activate lines 66 and 67 for labels in monitoring.
6. The default mode of the scripts is set to Alerts!
Max Stocks only 20!
Finally idea is to help traders to use the great features that TV works so hard to create and constantly improvise.
Enjoy Profitable Trading on the Fly !!
Example - Custom Defined Dual-State SessionThis script example aims to cover the following:
defining custom timeframe / session windows
gather a price range from the custom period ( high/low values )
create a secondary "holding" period through which to display the data collected from the initial session
simple method to shift times to re-align to preferred timezone
Articles and further reading:
www.investopedia.com - trading session
Reason for Study:
Educational purposes only.
Before considering writing this example I had seen multiple similar questions
asking how to go about creating custom timeframes or sessions, so it seemed
this might be a good topic to attempt to create a relatively generic example.
Nifty Pharma VolumeThis indicator plots volume for the index Nifty Pharma using data from it's constituent stocks.
Code taken from @daytraderph 's script called Custom Volume.
[SK] Custom Klinger OscillatorThis Custom Klinger Oscillator allows you to change the time frames for the Force Volume and Signal calculations to use instead of it's default values. Although the default Fibonacci values ( 34, 55 and 13 ) provide exceptional signals, you can now explore using lower Fibonacci numbers and get faster signals for your own adventures in the market.
This indicator adds conditional coloring of the Klinger line when over / under the signal along with a transparent fill cloud between both lines colored by the same condition. You can change colors to your preference on the style configurations.
--
Below is more information on the KIinger Oscillator from investopedia:
Interpretations for Price Direction
The Klinger Oscillator is fairly complex to calculate, but it's based on the idea of force volume, which accounts for volume, trend (positive or negative), and temp (based on multiple inputs and if/then statements). Using this data, the oscillator is created by looking at the difference between two exponential moving averages of force volume involving different time frames (typically 34 and 55). The idea is to show how the volume flowing through the securities is impacting its long-term and short-term price direction.
The Signal Line
A signal line (13-period moving average) is used to trigger buy or sell signals. This technique is very similar to signals that are created with other indicators such as the moving average convergence divergence (MACD). While these are the basic signals generated by these indicators, it's important to note that these techniques may generate a lot of trading signals that may not be as effective in sideways markets.
The Uptrend
When an asset is in an overall uptrend—such as when it is above its 100-period moving average and the Klinger is above zero or moving above zero—traders could buy when the Klinger oscillator moves above the signal line from below.
Klinger noted that when a stock was in an uptrend, and then dropped to unusually low levels below zero, and then moved above its signal line, this was a favorable long position to take.
The Downtrend
When an asset is in an overall downtrend, traders could sell or short-sell when the Klinger oscillator moves below the signal line from above. Klinger noted this was especially noteworthy when the indicator had seen an uncharacteristic spike above zero.
The zero line is also used by some traders to mark the transition from an uptrend to downtrend, or vice versa. While such signals won't always agree with price movements, a move above zero helps confirm a rising price, while a drop below zero helps confirm a falling price.
Klinger Oscillator and Divergence
The Klinger oscillator also uses divergence to identify when the indicator's inputs are not confirming the direction of the price move. It's a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. It is a bearish signal when the price is rising but the indicator is falling. Divergence can be coupled with signal line crossovers to generate trades. For example, if a bearish divergence forms, a sell or short-sell could be initiated the next time the Klinger crosses below the signal line.
[SK] Double MACDThe Double MACD indicator is precisely two different MACD indicators plotted on the same axis for precise visual correlation between each other.
This correlation provides more information than a single regular MACD by allowing you to compare the signals of a shorter timeframe to the default or longer timeframe,
showing the strength of the change in momentum and the peak of the momentum between both configurations.
The indicator has cloud options by default if you toggle on the MACD / Signal lines for better readability.
The cloud will change color to the line on top of it's set. This is to help you not get lost in the 4 different lines.
Customize the indicator to your preference and make it your own
If you'd like a candle like visualization, change the short MACD plot style to a histogram.
For a beautiful double bars style, select bars on both configurations and set the transparency to 30 - 40
For a dynamic moving average style, go with the line plot style ( default )
All MACD/Signal lines are toggled off by default, toggle them on in the inputs section.
On the styles panel, you can turn off the cloud fills or the lines.
Change all the colors you'd like!
High/Low X Bars AgoThis indicator will plot a line on your chart that shows the highest high point between two previous points on the chart. It does this by reporting the highest point of X number of candles, and begins the look-back X number of candles ago.
Default candle group size is 50, and default look-back begins 50 candles back.
With these settings, the script will essentially plot the highest high point between the candle that printed 100 candles ago, and the candle that printed 50 candles ago.
Options are available for looking for the highest point, or lowest point, with configurable distances in the look-back and candle group ranges.
This script was custom built by Pine-Labs for a user who requested it.
Growth Producer
Applicable to FTX:ETHPERP 15 min
Relative volatility index (RVI) that will determine the entry and exit points only when the volatility will start to increase and Money Flow index as an additional point for entry.
IMPORTANT
• Input Partial take profits in your Bot settings
• This is a trend strategy and works better in the trending market
• We added the trend identifier using the EMA and SMA interaction
• We added Take profit and stop loss levels
• We added inputs for the period selection, so you could see how the strategy is performing on a monthly basis.
• RVI for the entry conditions
• MFI was added for the additional entries.
• Partial Take-profits
CustomScreenerTo apply your indicator with screener , please modify the section which i mention "Start your indicator pine script" & "End your indicator pine script"
At the pinescript section you will able to change the ticket symbol .
I only able to show screener result with 10 item in 1 times . To view more result, please go to setting and change stock list "1-10">"11,20">"21-30".....
Able to screener 100 items with this indicator.
Kindly change the exchange and stock in the pinescript according your watchlist.
As examples, my indicator is to determine the stock in which trend, i want to find out all stock with aqua color trend
The screener result show only 9 of 10 are in aqua color trend.
Nifty VolumeWhy this Script : Nifty 50 does not provide volume and some time it is really useful to understand the volume .
This is the pine script which calculate the nifty 50 volume .
Logic :
Take each stock contribute to nifty 50 and find it's volume .
Multiply the same with contribution percentage of the same on Nifty 50
Add up all of them and find the total volume .
There is a similar script by @daytraderph which is built for Bank Nifty (custom volume) . I took the same and built for Nfity.
Nifty has 50 stocks and you cant call security method more than 40 times from one Pine script, so this is the limitation of this script. It consider top 40 stocks and find the volume (which contribute pretty much around 95% of the volume) and convert the same to 100 %
Bank Nifty VolumeWhy this Script : Nifty 50 does not provide volume and some time it is really useful to understand the volume .
This is the pine script which calculate the nifty 50 volume .
Logic :
Take each stock contribute to nifty 50 and find it's volume .
Multiply the same with contribution percentage of the same on Nifty 50
Add up all of them and find the total volume .
I took the open source code from @daytraderph script called, Custom Volume
I will make sure I will update the contribution percentage of all stocks my self instead o you update using input methods. This is the difference. Some people don't know where to look at this to update the value, so for them this script might be useful. And this is the only difference comparing to Custom Volume script.