Multiple Vertical LinesThis script allows you to have multiple vertical lines on your chart (for seeing how price action performs around certain times of interest to you.
You can adjust the code to add new lines or colours as you wish (or comment out any that are there if they don't suit you.
There is also a shaded area, so you can use that for delineating an amount of time.
The indicator is currently set to New York time, but you can adjust this to suit you.
Pine utilities
[AIO] Multi Collection Moving Averages 140 MA TypesAll In One Multi Collection Moving Averages.
Since signing up 2 years ago, I have been collecting various Сollections.
I decided to get it into a decent shape and make it one of the biggest collections on TV, and maybe the entire internet.
And now I'm sharing my collection with you.
140 Different Types of Moving Averages are waiting for you.
Specifically :
"
AARMA | Adaptive Autonomous Recursive Moving Average
ADMA | Adjusted Moving Average
ADXMA | Average Directional Moving Average
ADXVMA | Average Directional Volatility Moving Average
AHMA | Ahrens Moving Average
ALF | Ehler Adaptive Laguerre Filter
ALMA | Arnaud Legoux Moving Average
ALSMA | Adaptive Least Squares
ALXMA | Alexander Moving Average
AMA | Adaptive Moving Average
ARI | Unknown
ARSI | Adaptive RSI Moving Average
AUF | Auto Filter
AUTL | Auto-Line
BAMA | Bryant Adaptive Moving Average
BFMA | Blackman Filter Moving Average
CMA | Corrected Moving Average
CORMA | Correlation Moving Average
COVEMA | Coefficient of Variation Weighted Exponential Moving Average
COVNA | Coefficient of Variation Weighted Moving Average
CTI | Coral Trend Indicator
DEC | Ehlers Simple Decycler
DEMA | Double EMA Moving Average
DEVS | Ehlers - Deviation Scaled Moving Average
DONEMA | Donchian Extremum Moving Average
DONMA | Donchian Moving Average
DSEMA | Double Smoothed Exponential Moving Average
DSWF | Damped Sine Wave Weighted Filter
DWMA | Double Weighted Moving Average
E2PBF | Ehlers 2-Pole Butterworth Filter
E2SSF | Ehlers 2-Pole Super Smoother Filter
E3PBF | Ehlers 3-Pole Butterworth Filter
E3SSF | Ehlers 3-Pole Super Smoother Filter
EDMA | Exponentially Deviating Moving Average (MZ EDMA)
EDSMA | Ehlers Dynamic Smoothed Moving Average
EEO | Ehlers Modified Elliptic Filter Optimum
EFRAMA | Ehlers Modified Fractal Adaptive Moving Average
EHMA | Exponential Hull Moving Average
EIT | Ehlers Instantaneous Trendline
ELF | Ehler Laguerre filter
EMA | Exponential Moving Average
EMARSI | EMARSI
EPF | Edge Preserving Filter
EPMA | End Point Moving Average
EREA | Ehlers Reverse Exponential Moving Average
ESSF | Ehlers Super Smoother Filter 2-pole
ETMA | Exponential Triangular Moving Average
EVMA | Elastic Volume Weighted Moving Average
FAMA | Following Adaptive Moving Average
FEMA | Fast Exponential Moving Average
FIBWMA | Fibonacci Weighted Moving Average
FLSMA | Fisher Least Squares Moving Average
FRAMA | Ehlers - Fractal Adaptive Moving Average
FX | Fibonacci X Level
GAUS | Ehlers - Gaussian Filter
GHL | Gann High Low
GMA | Gaussian Moving Average
GMMA | Geometric Mean Moving Average
HCF | Hybrid Convolution Filter
HEMA | Holt Exponential Moving Average
HKAMA | Hilbert based Kaufman Adaptive Moving Average
HMA | Harmonic Moving Average
HSMA | Hirashima Sugita Moving Average
HULL | Hull Moving Average
HULLT | Hull Triple Moving Average
HWMA | Henderson Weighted Moving Average
IE2 | Early T3 by Tim Tilson
IIRF | Infinite Impulse Response Filter
ILRS | Integral of Linear Regression Slope
JMA | Jurik Moving Average
KA | Unknown
KAMA | Kaufman Adaptive Moving Average & Apirine Adaptive MA
KIJUN | KIJUN
KIJUN2 | Kijun v2
LAG | Ehlers - Laguerre Filter
LCLSMA | 1LC-LSMA (1 line code lsma with 3 functions)
LEMA | Leader Exponential Moving Average
LLMA | Low-Lag Moving Average
LMA | Leo Moving Average
LP | Unknown
LRL | Linear Regression Line
LSMA | Least Squares Moving Average / Linear Regression Curve
LTB | Unknown
LWMA | Linear Weighted Moving Average
MAMA | MAMA - MESA Adaptive Moving Average
MAVW | Mavilim Weighted Moving Average
MCGD | McGinley Dynamic Moving Average
MF | Modular Filter
MID | Median Moving Average / Percentile Nearest Rank
MNMA | McNicholl Moving Average
MTMA | Unknown
MVSMA | Minimum Variance SMA
NLMA | Non-lag Moving Average
NWMA | Dürschner 3rd Generation Moving Average (New WMA)
PKF | Parametric Kalman Filter
PWMA | Parabolic Weighted Moving Average
QEMA | Quadruple Exponential Moving Average
QMA | Quick Moving Average
REMA | Regularized Exponential Moving Average
REPMA | Repulsion Moving Average
RGEMA | Range Exponential Moving Average
RMA | Welles Wilders Smoothing Moving Average
RMF | Recursive Median Filter
RMTA | Recursive Moving Trend Average
RSMA | Relative Strength Moving Average - based on RSI
RSRMA | Right Sided Ricker MA
RWMA | Regressively Weighted Moving Average
SAMA | Slope Adaptive Moving Average
SFMA | Smoother Filter Moving Average
SMA | Simple Moving Average
SSB | Senkou Span B
SSF | Ehlers - Super Smoother Filter P2
SSMA | Super Smooth Moving Average
STMA | Unknown
SWMA | Self-Weighted Moving Average
SW_MA | Sine-Weighted Moving Average
TEMA | Triple Exponential Moving Average
THMA | Triple Exponential Hull Moving Average
TL | Unknown
TMA | Triangular Moving Average
TPBF | Three-pole Ehlers Butterworth
TRAMA | Trend Regularity Adaptive Moving Average
TSF | True Strength Force
TT3 | Tilson (3rd Degree) Moving Average
VAMA | Volatility Adjusted Moving Average
VAMAF | Volume Adjusted Moving Average Function
VAR | Vector Autoregression Moving Average
VBMA | Variable Moving Average
VHMA | Vertical Horizontal Moving Average
VIDYA | Variable Index Dynamic Average
VMA | Volume Moving Average
VSO | Unknown
VWMA | Volume Weighted Moving Average
WCD | Unknown
WMA | Weighted Moving Average
XEMA | Optimized Exponential Moving Average
ZEMA | Zero Lag Moving Average
ZLDEMA | Zero-Lag Double Exponential Moving Average
ZLEMA | Ehlers - Zero Lag Exponential Moving Average
ZLTEMA | Zero-Lag Triple Exponential Moving Average
ZSMA | Zero-Lag Simple Moving Average
"
Don't forget that you can use any Moving Average not only for the chart but also for any of your indicators without affecting the code as in my example.
But remember that some MAs are not designed to work with anything other than a chart.
All MA and Code lists are sorted strictly alphabetically by short name (A-Z).
Each MA has its own number (ID) by which you can display the Moving Average you need.
Next to the ID selection there are tooltips with short names and their numbers. Use them.
The panel below will help you to read the Name of the selected MA.
Because of the size of the collection I think this is the optimal and most convenient use. Correct me if this is not the case.
Unknown - Some MAs I collected so long ago that I lost the full real name and couldn't find the authors. If you recognize them, please let me know.
I have deliberately simplified all MAs to input just Source and Length.
Because the collection is so large, it would be quite inconvenient and difficult to customize all MA functions (multipliers, offset, etc.).
If you need or like any MA you will still have to take it from my collection for your code.
I tried to leave the basic MA settings inside function in first strings.
I have tried to list most of the authors, but since the bulk of the collection was created a long time ago and was not intended for public publication I could not find all of them.
Some of the features were created from scratch or may have been slightly modified, so please be careful.
If you would like to improve this collection, please write to me in PM.
Also Credits, Likes, Awards, Loves and Thanks to :
@alexgrover
@allanster
@andre_007
@auroagwei
@blackcat1402
@bsharpe
@cheatcountry
@CrackingCryptocurrency
@Duyck
@ErwinBeckers
@everget
@glaz
@gotbeatz26107
@HPotter
@io72signals
@JacobAmos
@JoshuaMcGowan
@KivancOzbilgic
@LazyBear
@loxx
@LuxAlgo
@MightyZinger
@nemozny
@NGBaltic
@peacefulLizard50262
@RicardoSantos
@StalexBot
@ThiagoSchmitz
@TradingView
— 𝐀𝐧𝐝 𝐎𝐭𝐡𝐞𝐫𝐬 !
So just a Big Thank You to everyone who has ever and anywhere shared their codes.
Risk Reward Optimiser [ChartPrime]█ CONCEPTS
In modern day strategy optimization there are few options when it comes to optimizing a risk reward ratio. Users frequently need to experiment and go through countless permutations in order to tweak, adjust and find optimal in their data.
Therefore we have created the Risk Reward Optimizer.
The Risk Reward Optimizer is a technical tool designed to provide traders with comprehensive insights into their trading strategies.
It offers a range of features and functionalities aimed at enhancing traders' decision-making process.
With a focus on comprehensive data, it is there to help traders quickly and efficiently locate Risk Reward optimums for inbuilt of custom strategies.
█ Internal and external Signals:
The script can optimize risk to reward ratio for any type of signals
You can utilize the following :
🔸Internal signals ➞ We have included a number of common indicators into the optimizer such as:
▫️ Aroon
▫️ AO (Awesome Oscillator)
▫️ RSI (Relative Strength Index)
▫️ MACD (Moving Average Convergence Divergence)
▫️ SuperTrend
▫️ Stochastic RSI
▫️ Stochastic
▫️ Moving averages
All these indicators have 3 conditions to generate signals :
Crossover
High Than
Less Than
🔸External signal
▫️ by incorporating your own indicators into the analysis. This flexibility enables you to tailor your strategy to your preferences.
◽️ How to link your signal with the optimizer:
In order to be able to analysis your signal we need to read it and to do so we would need to PLOT your signal with a defined value
plot( YOUR LONG Condition ? 100 : 0 , display = display.data_window)
█ Customizable Risk to Reward Ratios:
This tool allows you to test seven different customizable risk to reward ratios , helping you determine the most suitable risk-reward balance for your trading strategy. This data-driven approach takes the guesswork out of setting stop-loss and take-profit levels.
█ Comprehensive Data Analysis:
The tool provides a table displaying key metrics, including:
Total trades
Wins
Losses
Profit factor
Win rate
Profit and loss (PNL)
This data is essential for refining your trading strategy.
🔸 It includes a tooltip for each risk to reward ratio which gives data for the:
Most Profitable Trade USD value
Most Profitable Trade % value
Most Profitable Trade Bar Index
Most Profitable Trade Time (When it occurred)
Position and size is adjustable
█ Visual insights with histograms:
Visualize your trading performance with histograms displaying each risk to reward ratio trade space, showing total trades, wins, losses, and the ratio of profitable trades.
This visual representation helps you understand the strengths and weaknesses of your strategy.
It offers tooltips for each RR ratio with the average win and loss percentages for further analysis.
█ Dynamic Highlighting:
A drop-down menu allows you to highlight the maximum values of critical metrics such as:
Profit factor
Win rate
PNL
for quick identification of successful setups.
█ Stop Loss Flexibility:
You can adjust stop-loss levels using three different calculation methods:
ATR
Pivot
VWAP
This allows you to align risk-reward ratios with your preferred risk tolerance.
█ Chart Integration:
Visualize your trades directly on your price chart, with each trade displayed in a distinct color for easy tracking.
When your take-profit (TP) level is reached , the tool labels the corresponding risk-reward ratio for that specific TP, simplifying trade management.
█ Detailed Tooltips:
Tooltips provide deeper insights into your trading performance. They include information about the most profitable trade, such as the time it occurred, the bar index, and the percentage gain. Histogram tooltips also offer average win and loss percentages for further analysis.
█ Settings:
█ Code:
In summary, the Risk Reward Optimizer is a data-driven tool that offers traders the ability to optimize their risk-reward ratios, refine their strategies, and gain a deeper understanding of their trading performance. Whether you're a day trader, swing trader, or investor, this tool can help you make informed decisions and improve your trading outcomes.
EQ LEVELS / EquilibriumWhat is it, How to use it, How to adjust the settings? What Calculates EQ Level?
What is it?
EQ, Equilibrium, In the money market, the term "equilibrium" or "equilibrium" refers to the point at which supply and demand are equalised. At this point, money supply and money demand meet each other and interest rates stabilise at a certain level. Equilibrium in the money market reflects the overall financial balance in the economy
According to What Calculates the EQ Level?
Normally, there may be many different alternatives to this, but I have printed the result on the screen by adding the highest and lowest levels of the prices and averaging them to think of a simple solution.
How to use it?
I have added 4 timeframes for both long-term investors and traders to use. If you want to use which timeframe, you can select the timeframe you want from the settings and see it on the chart. For those who want to trade, my suggestion is to follow the daily eq levels and of course look at the weekly eq levels. The weekly eq level can give you an idea of what kind of price range the next day may be in.
How to Make Settings?
When you first add the indicator to the chart, it draws a line. You change it to a circle or plus in the settings, it will look like the picture I shared. I also share open source code and can make changes in the code.
Nedir?, Nasıl Kullanılır?, Ayarları Nasıl Yapılır? EQ Seviyesini Neye Göre Hesaplar?
Nedir?:
EQ yani Equilibrium, Para piyasasında "denge" veya "equilibrium" terimi, arz ve talebin eşitlendiği noktayı ifade eder. Bu noktada, para arzı ile para talebi birbirini karşılar ve faiz oranları belirli bir seviyede dengelenir. Para piyasasındaki denge, ekonomideki genel finansal dengeyi yansıtır
EQ Seviyesini Neye Göre Hesaplar?
Normalde bunun farlı bir çok alternatifi olabilir ama ben biraz basit bir çözüm düşünmek için fiyatların en yüksek ve en düşük seviyelerini toplayarak ve ortalamasını alarak çıka sonucu ekrana yazdırdım.
Nasıl Kullanılır?
Hem uzun vadeli yatırım yapanlar hem de trade yapanların kullanabilmesi için 4 zaman dilimi ekledim. Hangi zaman dilimini kullanmak istiyorsanız ayarlardan istediniz zaman dilimini seçip onu grafikte görebilirsiniz. Trade yapmak isteyenler için önerim günlük eq seviyelerini takip etmeleri ve tabiki haftalık eq seviyelerine bakın. Haftalık eq seviyesi size bir sonra ki günün nasıl bir fiyat aralığı içerisinde olabileceği konusunda fikir verebilir.
Ayarları Nasıl Yapılır?
Grafiğe indikatörü ilk eklediğiniz de çizgi çizdirir. Siz ayarlardan onu daire veya artı olarak değiştirin benim paylaştığım resimde ki gibi görünecektir. Ayrıca açık kaynak kodlu paylaşıyorum isteyen kod içerisinde değişiklikler yapabilir.
AMT: Gamma Levels PlotterAMT: Custom Levels Plotter Indicator
Purpose:
This indicator is designed to allow users to directly visualize custom price levels and their associated labels on a trading chart by copying and pasting data from the Gamma spreadsheet.
Features and Functionalities:
Direct Input from Gamma Spreadsheet:
Users can effortlessly copy rows of data from the Gamma spreadsheet and paste them into the indicator's input field. Each row should represent a price level followed by a tab (\t) and its associated label. There's no need for any adjustments or formatting changes; the indicator handles it all.
Label Size Selection:
A dropdown menu lets users select the desired size for the labels. Options include "Tiny", "Small", "Normal", and "Large".
Merge Levels Option:
A checkbox determines if labels for identical price levels should be merged. When activated, labels for the same price will consolidate; otherwise, they'll display individually.
Dynamic Visualization:
A horizontal line represents the specified price level on the chart.
An adjacent label displays the associated text.
If the "Merge Levels" option is active and there are multiple labels for the same price, they merge into one.
Automatic Cleanup:
The script automatically removes all previously plotted lines and labels before drawing the new set. This ensures the chart only displays the most recent set of levels and remains uncluttered.
Efficient Data Handling:
The indicator uses the levels and counts arrays to track unique price levels and their counts. This aids in accurately positioning labels, especially when merging is enabled.
Debugging Feature:
For diagnostic purposes, the indicator plots the size of the levels array. This helps monitor the array's growth and ensures it remains within expected limits.
Earnings LevelsI am proud to announce that the formerly secret "Key Earnings Levels" graphing tool will be freely available to TradingView users whereas before it was only available by monthly or annual subscription since its invention here at TradingView many years ago by Tim West. TradingView code writers wrote the original code for using this powerful tool and then Johannes Falkenburg re-wrote the code several years ago.
The most important FOUR days a year in a stock chart are the days that the company gives its quarterly update. Since the GRAND majority of companies have earnings, the indicator is called the "Key Earnings Level", or KEL for short. The unique part of the release of the quarterly update is that it can be "before the open" or "after the close" and the price action leading up to the earnings and immediately after the earnings are useful for future reference, as you'll see shortly.
The Key Earnings indicator plots a triangle for the range around the day before and the day after earnings and draws a mid-point line to capture the over/under level for that report. That mid-point line is then extended into the future for a minimum of one quarter until the next earnings report and as long as a year with the current code.
This triangle plot allows you to see how a stock is trading RELATIVE TO where it was trading when earnings were announced and when a glimpse into the current quarter along with projections for the upcoming year.
Simply put: Key Earnings Levels are the easiest way to see how a stock is doing relative to the most important four days a year.
You can devise your own trading strategies around these levels, but I want you to have this information so you can see it and know it too. I've kept this little secret of Key Hidden Levels to myself and my followers in the Key Hidden Levels Chat Room here at TradingView for far too long. I have occasionally published charts with the Key Earnings Levels but have not made the code freely available to TradingView subscribers.
If anyone has paid me for access to these indicators and wants a refund, I will be glad to do that. This is too important to keep from everyone any longer. I think it is essential to make this available to everyone to make sure we all have the most advantage we can get when investing and trading in the markets.
I hope you can all find the powerful benefit from using Key Earnings Levels and please thank Johannes Falkenburg aka @Vollchaot here at TradingView for writing the latest version of this code.
The idea itself came from using TradingView and the powerful graphing and layout features here to track our observations and to do research. Thank you TradingView for such a great product.
I look forward to answering any questions.
Sincerely,
Tim West
Paytience DistributionPaytience Distribution Indicator User Guide
Overview:
The Paytience Distribution indicator is designed to visualize the distribution of any chosen data source. By default, it visualizes the distribution of a built-in Relative Strength Index (RSI). This guide provides details on its functionality and settings.
Distribution Explanation:
A distribution in statistics and data analysis represents the way values or a set of data are spread out or distributed over a range. The distribution can show where values are concentrated, values are absent or infrequent, or any other patterns. Visualizing distributions helps users understand underlying patterns and tendencies in the data.
Settings and Parameters:
Main Settings:
Window Size
- Description: This dictates the amount of data used to calculate the distribution.
- Options: A whole number (integer).
- Tooltip: A window size of 0 means it uses all the available data.
Scale
- Description: Adjusts the height of the distribution visualization.
- Options: Any integer between 20 and 499.
Round Source
- Description: Rounds the chosen data source to a specified number of decimal places.
- Options: Any whole number (integer).
Minimum Value
- Description: Specifies the minimum value you wish to account for in the distribution.
- Options: Any integer from 0 to 100.
- Tooltip: 0 being the lowest and 100 being the highest.
Smoothing
- Description: Applies a smoothing function to the distribution visualization to simplify its appearance.
- Options: Any integer between 1 and 20.
Include 0
- Description: Dictates whether zero should be included in the distribution visualization.
- Options: True (include) or False (exclude).
Standard Deviation
- Description: Enables the visualization of standard deviation, which measures the amount of variation or dispersion in the chosen data set.
- Tooltip: This is best suited for a source that has a vaguely Gaussian (bell-curved) distribution.
- Options: True (enable) or False (disable).
Color Options
- High Color and Low Color: Specifies colors for high and low data points.
- Standard Deviation Color: Designates a color for the standard deviation lines.
Example Settings:
Example Usage RSI
- Description: Enables the use of RSI as the data source.
- Options: True (enable) or False (disable).
RSI Length
- Description: Determines the period over which the RSI is calculated.
- Options: Any integer greater than 1.
Using an External Source:
To visualize the distribution of an external source:
Select the "Move to" option in the dropdown menu for the Paytience Distribution indicator on your chart.
Set it to the existing panel where your external data source is placed.
Navigate to "Pin to Scale" and pin the indicator to the same scale as your external source.
Indicator Logic and Functions:
Sinc Function: Used in signal processing, the sinc function ensures the elimination of aliasing effects.
Sinc Filter: A filtering mechanism which uses sinc function to provide estimates on the data.
Weighted Mean & Standard Deviation: These are statistical measures used to capture the central tendency and variability in the data, respectively.
Output and Visualization:
The indicator visualizes the distribution as a series of colored boxes, with the intensity of the color indicating the frequency of the data points in that range. Additionally, lines representing the standard deviation from the mean can be displayed if the "Standard Deviation" setting is enabled.
The example RSI, if enabled, is plotted along with its common threshold lines at 70 (upper) and 30 (lower).
Understanding the Paytience Distribution Indicator
1. What is a Distribution?
A distribution represents the spread of data points across different values, showing how frequently each value occurs. For instance, if you're looking at a stock's closing prices over a month, you may find that the stock closed most frequently around $100, occasionally around $105, and rarely around $110. Graphically visualizing this distribution can help you see the central tendencies, variability, and shape of your data distribution. This visualization can be essential in determining key trading points, understanding volatility, and getting an overview of the market sentiment.
2. The Rounding Mechanism
Every asset and dataset is unique. Some assets, especially cryptocurrencies or forex pairs, might have values that go up to many decimal places. Rounding these values is essential to generate a more readable and manageable distribution.
Why is Rounding Needed? If every unique value from a high-precision dataset was treated distinctly, the resulting distribution would be sparse and less informative. By rounding off, the values are grouped, making the distribution more consolidated and understandable.
Adjusting Rounding: The `Round Source` input allows users to determine the number of decimal places they'd like to consider. If you're working with an asset with many decimal places, adjust this setting to get a meaningful distribution. If the rounding is set too low for high precision assets, the distribution could lose its utility.
3. Standard Deviation and Oscillators
Standard deviation is a measure of the amount of variation or dispersion of a set of values. In the context of this indicator:
Use with Oscillators: When using oscillators like RSI, the standard deviation can provide insights into the oscillator's range. This means you can determine how much the oscillator typically deviates from its average value.
Setting Bounds: By understanding this deviation, traders can better set reasonable upper and lower bounds, identifying overbought or oversold conditions in relation to the oscillator's historical behavior.
4. Resampling
Resampling is the process of adjusting the time frame or value buckets of your data. In the context of this indicator, resampling ensures that the distribution is manageable and visually informative.
Resample Size vs. Window Size: The `Resample Resolution` dictates the number of bins or buckets the distribution will be divided into. On the other hand, the `Window Size` determines how much of the recent data will be considered. It's crucial to ensure that the resample size is smaller than the window size, or else the distribution will not accurately reflect the data's behavior.
Why Use Resampling? Especially for price-based sources, setting the window size around 500 (instead of 0) ensures that the distribution doesn't become too overloaded with data. When set to 0, the window size uses all available data, which may not always provide an actionable insight.
5. Uneven Sample Bins and Gaps
You might notice that the width of sample bins in the distribution is not uniform, and there can be gaps.
Reason for Uneven Widths: This happens because the indicator uses a 'resampled' distribution. The width represents the range of values in each bin, which might not be constant across bins. Some value ranges might have more data points, while others might have fewer.
Gaps in Distribution: Sometimes, there might be no data points in certain value ranges, leading to gaps in the distribution. These gaps are not flaws but indicate ranges where no values were observed.
In conclusion, the Paytience Distribution indicator offers a robust mechanism to visualize the distribution of data from various sources. By understanding its intricacies, users can make better-informed trading decisions based on the distribution and behavior of their chosen data source.
Signal ComposerThis Signal Composer script can compose existing signals from other "Signal Indicators" into one and can forward it to the "Template Trailing Strategy".
It allows the user to combine the logic of two signals and define the conditions that will trigger the start, end, cancel start, and cancel end deals of the produced signal. A signal will be composed from those user-defined conditions.
For example, one signal indicator may have the main logic and the other the filter logic. If you want to combine more signals you may add two Signal Composer scripts and pipe the output of the first composer to the second one.
This is the "main building block" of creating a bit more complex strategies without writing any code.
The "indicator on indicator" feature is needed so you can forward the resulting signal to the "Template Trailing Strategy" so that you can set take profits, stop losses, custom alerts, and all other nifty features this framework provides.
Thus, you should be a Plus or Premium user to get its full potential. It is very convenient for those who want to create a strategy without coding their own signal indicator and for those who want to fast-prototype various ideas based on simple but composable conditions.
It can nicely be combined with the "Signal Adapter" which combines simple (non-signal) indicators and produces a signal. This is a recipe to build fast and backtest more complex strategy logic.
This approach has a fail-fast mentality! Keep, in mind that you can code a single signal indicator with your composed logic later on only if the idea turns out to be "good enough".
Signal AdapterThis Signal Adapter script can compose a signal based on inputs from other simple (non-signal) indicators and can forwards it to the "Template Trailing Strategy".
It allows the user to combine up to eight external inputs and define the conditions that will trigger the start, end, cancel start and cancel end deals.
A signal will be composed from those user-defined conditions. The "indicator on indicator" feature is needed so you can forward the resulted signal to the "Template Trailing Strategy".
Thus you should be Plus or Premium user to get it's full potential. It is very convenient for those who want to create a strategy without coding their own signal indicator and for those
who want to fast prototype various ideas based on simple conditions.
[TTI] MarketSmith & IBD Style Model Stock Quarters 📜 ––––HISTORY & CREDITS––––
The MarketSmith & IBD Style Model Stock Quarters another Utility indicator is an original creation by TintinTrading inspired by Investor's Business Daily and William O'Neil style of presenting information. While going through the Model Stocks that IBD has been publishing, I realized that I wanted to see the exam same Quarterly presentation on the time axis in order to compare William O'Neil notes better with my own notes from Tradingview. The script is simple and could help you if you study the CANSLIM methodology.
🦄 –––UNIQUENESS–––
The distinctiveness of this indicator lies in its ability to visually delineate stock quarters directly on the price chart. It serves as a handy tool for traders who adopt a quarterly review of stock performance, in line with MarketSmith and IBD's analysis frameworks.
🛠️ ––––WHAT IT DOES––––
Quarter Marking : Draws a black line at the beginning of each financial quarter (January, April, July, and October).
Quarter Labeling : Places a label at the close of the last month in a quarter, indicating the upcoming quarter with its abbreviation and the last two digits of the year.
💡 ––––HOW TO USE IT––––
👉Installation: Add the indicator to your TradingView chart by searching for " MarketSmith & IBD Style Model Stock Quarters" in the indicator library.
👉Add to New Pane and squash the Pane Length: I add the indicator to a new pane under the price and volume charts and squash the height of the pane so that it looks exactly like the MarketSmith visuals.
👉Visual Cues:
Look for the black lines marking the start of a new quarter.
Observe the labels indicating the upcoming quarter and year, positioned at the close of the last month in a quarter.
👉Interpretation: Use these quarterly markers to align your trading strategies with quarterly performance metrics or to conduct seasonal analysis.
👉Settings: The indicator does not require any user-defined settings, making it straightforward to use.
[TTI] Closing Range Indicator📜 ––––HISTORY & CREDITS––––
This Pine Script Utility indicator, titled " Closing Range Indicator," is designed and developed by TintinTrading but inspired by the teaching of Investor's Business Daily (IBD) and William O'Neil. It aims to help traders identify the closing range of a given timeframe, either daily or weekly.
🦄 –––UNIQUENESS–––
The unique feature of this indicator lies in its ability to simulate a functionality of Closing Range calculation based on hovering of the mouse over the close. It employs a conditional display that allows the user to set the indicator as 'invisible' without removing it from the chart and hence provides a numerical closing range value when hovering over the indicator.
🛠️ ––––WHAT IT DOES––––
The Closing Range Indicator calculates the closing range of a trading bar in terms of percentages. It computes the difference between the closing price and the low price of the bar, and then divides it by the range of the bar.
A stock that closes on the high would display 100%
A stock that closes on the low would display 0%
Generally, the higher the percentage the more bullish the close but there are exceptions to this rule.
The indicator can operate on two timeframes:
Daily : Computes the closing range based on the daily high, low, and closing prices.
Weekly : Computes the closing range based on the weekly high, low, and closing prices. If you enable the weekly it will show the weekly close on all daily timeframes. Meaning that if the week Closing range is 54.15% on Friday, it will show the value 54.15% for all days prior to Friday from the same week.
The indicator places a label at the close of each bar, with the label's tooltip showing the calculated closing range percentage. I generally hide the label and just reference the tooltip calculation with a a hoover on top of the bar.
💡 ––––HOW TO USE IT––––
Installation: Add the indicator to your TradingView chart by searching for " Closing Range Indicator" in the indicator library.
Reorder: Reorder the indicator so that it sits as the first indicator (even above the price) on the Pane. This will make sure that you always trigger the tooltip functionality.
Go to Settings:
Timeframe: Choose between daily ('D') and weekly ('W') timeframes from the settings.
Visibility: Enable the 'Make Invisible' option if you want the indicator to be hidden.
Interpretation:
A higher percentage indicates that the closing price is closer to the high of the range, signaling bullish sentiment.
A lower percentage indicates bearish sentiment.
Tooltip: Hover over the label to view the closing range in percentage terms.
Map exampleUsing Maps collections:
This code manipulates support and resistance lines using maps collection.
We normally maintain array/udt of lines and related properties to segregate lines as support and or resistance.
With introduction of maps the same can be achieved without creating lines array/udt.
What does this code do:
1. Plot support and resistance lines based on ta.pivothigh() and ta.pivotlow()
2. When price crosses support line, the line is marked as resistance and color is changed to resistance line color and style is changed to dotted line (support turned resistance). Also the width of the line is set based on number of crosses. Finally the support/resistance line is removed when number of times price crossing the line reaches max allowed crosses (input parameter)
Where maps are used:
1. map_sr_cross - Number of times the support/resistance lines has been crossed by price
2. map_sr_type - R=resistance, S=support
3. color_map - color for support and resistance lines
4. style_map - line styles. Support/resistance lines as solid style and support turned resistance/resistance turned support lines as dotted style.
HTF Oscillators RSI/ROC/MFI/CCI/AO - Dynamic SmoothingThe Interplay of Time Frames: A Balanced View
Navigating the markets often involves interpreting trends from multiple angles. The HTF Oscillators with Dynamic Smoothing indicator enables you to do just that. This tool provides the option to integrate smoothed oscillator readings from Higher Time Frames (HTF) into lower time frame charts, such as a 1-minute chart. By doing so, the indicator offers a balanced viewpoint that bridges the gap between micro and macro perspectives, helping you make informed decisions without losing sight of the broader market context.
Features
Multi-Oscillator Support
Choose from a range of popular oscillators like the Relative Strength Index (RSI), Rate of Change (ROC), Money Flow Index (MFI), Commodity Channel Index (CCI), and Awesome Oscillator (AO). These oscillators are commonly used as foundational building blocks in trading strategy scripts by traders worldwide. Switch effortlessly between them, depending on your trading strategy and requirements. To maintain consistency and a familiar user experience, our script adopts the same visual aesthetics that you'll find in Pine Script indicators on TradingView: a sleek purple line for the oscillator and a transparent band filling. These visual elements are not only pleasing to the eye but also widely appreciated by the trading community.
Dynamic Smoothing
The unique dynamic smoothing feature calculates a smoothing factor based on the ratio of minutes between the Higher Time Frame (HTF) and your current time frame. This provides a sleek and responsive oscillator line that still holds the weight of the longer trend. One of the significant advantages of this feature is user experience; when you change your time frame, the HTF-values in your settings will remain consistent. This ensures that you can easily switch between different time frames without losing the insights provided by your selected HTF.
Visual Aids
Visual cues are an essential part of any trading strategy. The indicator not only plots signals to mark overbought and oversold conditions based on the dynamically smoothed oscillator but also provides you with the flexibility to customize your visual experience. You have the option to toggle on/off the display of these signals depending on your specific needs. Additionally, bands can be displayed at overbought and oversold levels, along with a reference middle line. If you switch between different oscillators (available in the parameter settings), remember to manually adjust the bands in the input settings to ensure signals matches with the type of oscillator to your liking.
User-Friendly Settings
We've grouped related settings together, making it easier for you to find what you're looking for. Adjust the oscillator type, length of bars, smoothing settings, and more with just a few clicks.
Information Table
A standout feature of this indicator is the real-time information table, which displays the values of all selected oscillators based on your specified Higher Time Frame (HTF) settings. This can be particularly useful for traders who depend on multiple indicators for their decision-making process. The data presented in the table is synchronized with the HTF options you've configured in the input settings, allowing for a more efficient and quick scan of values from higher time frames.
Educational Corner: The Power of the Information Table and Customization
The table incorporated into this indicator isn't just eye-candy; it's a practical tool designed to elevate your trading strategy. It dynamically displays real-time values of various oscillators for the HTF you've chosen. This is an exemplary use of TradingView's scripting capabilities to blend multiple indicators into a single visual panel, streamlining your analysis and decision-making process.
But here's the best part: You're not limited to what we've created. With some basic understanding of TradingView's scripting language, Pine Script, you can easily adapt this table to include different indicators that suit your unique trading style. The logic in the script is modular and can serve as a foundation for your own customized trading dashboard. So, go ahead, get creative and explore new combinations of indicators that will help you excel in your trading endeavors!
You no longer have to toggle between different charts or indicators to get the information you need; it's all there in one neatly organized table. We encourage you to tap into this feature and make it your own, empowering your trading like never before.
By doing so, you not only gain a more comprehensive toolset, but you also engage more deeply with your trading strategy, understanding its nuances and, ultimately, making more informed decisions.
Conclusion
The HTF Oscillators with Dynamic Smoothing is a versatile and powerful tool that brings together the best of both worlds: the perspective of higher time frames and the granularity of shorter ones. Its feature-rich setting options and real-time information table make it a potential useful addition to your trading toolkit.
Remember, while this indicator offers a comprehensive and smarter way to look at the markets, it is not a foolproof method for predicting market movements. Always use it in conjunction with other analysis methods and risk management strategies.
OrderBlock [kyleAlgo]The principle of this indicator
ATR (Average True Range) Setting: The code uses ATR to help calculate the Supertrend indicator.
Supertrend Trend Direction: Identify bullish and bearish trends with the Supertrend method.
Order Block Recognition: This part of the code recognizes and creates order blocks, visualizing them as boxes on the chart. If the number of blocks exceeds the maximum limit, old blocks will be deleted.
Function to prevent overlapping: check whether the new order block overlaps with the existing order block through the isOverlapping function.
Order block color setting: The code sets the color according to whether the block is bullish or bearish, and whether it breaks above or below. Afterwards the color of the existing order blocks will be updated.
Sensitivity settings: Through the input settings of factor and atrPeriod, the sensitivity of Supertrend and the detection of order blocks can be affected.
Visualization: Use TradingView's box.new function to draw and visualize order blocks on the chart.
Practicality:
Support and Resistance Levels: Order blocks may represent areas of support and resistance in the market. By visualizing these areas, traders can better understand when price reversals are likely to occur.
Trading Signals: Traders may be able to identify trading signals based on the color changes of blocks and price breakouts. For example, if the price breaks above a bullish block, this could be a signal to buy.
Risk Management: By using ATR to adjust the sensitivity of Supertrend, the symbol helps traders to adjust their strategies according to market volatility. This can be used as a risk management tool to help identify stop loss and take profit points.
Multi-timeframe analysis: Although the code itself does not implement multi-timeframe analysis directly, it can be done by applying this indicator on different timeframes. This helps to analyze the market from different angles.
Flexibility and Customization: Through sensitivity settings, traders can customize the indicator according to their needs and trading style.
Reduced screen clutter: By removing overlapping order blocks and limiting the maximum number of order blocks, this code helps reduce clutter on charts, allowing traders to analyze the market more clearly.
Overall, this "Pine Script" can be a powerful analytical tool for trend traders and those looking to improve their trading decisions by visualizing key market areas. It can be used alone or combined with other indicators and trading systems for enhanced functionality.
White NoiseThe "White Noise" indicator is designed to visualize the dispersion of price movements around a moving average, providing insights into market noise and potential trend changes. It highlights periods of increased volatility or noise compared to the underlying trend.
Code Explanation:
Inputs:
mlen: Input for the length of the noise calculation.
hlen: Input for the length of the Hull moving average.
col_up: Input for the color of the up movement.
col_dn: Input for the color of the down movement.
Calculations:
ma: Calculate the simple moving average of the high, low, and close prices (hlc3) over the specified mlen period.
dist: Calculate the percentage distance between the hlc3 and the moving average ma, then scale it by 850. This quantifies the deviation from the moving average as a value.
sm: Smooth the calculated dist values using a weighted moving average (WMA) twice, with different weights, and subtract one from the other. This provides a smoothed representation of the dispersion.
Coloring:
col_wn: Determine the color of the bars based on whether dist is positive or negative and whether it's greater or less than the smoothed sm value. This creates color-coded columns indicating upward or downward movements with varying opacity.
col_switch: Define the color for the current trend state. It switches color when the smoothed sm crosses above or below its previous value, indicating potential trend changes.
col_switch2: Define the color for the horizontal line that separates the two trend states. It switches color based on the same crossover and crossunder conditions as col_switch.
Plots:
plot(dist): Plot the dispersion values as columns with color defined by col_wn.
plot(sm): Plot the smoothed dispersion line with a white color and thicker linewidth.
plot(sm ): Plot the previous smoothed dispersion value with a lighter white color to create a visual distinction.
Usage:
This indicator can help traders identify periods of increased market noise, visualize potential trend reversals, and assess the strength of price movements around the moving average. The colored columns and smoothed line offer insights into the ebb and flow of market sentiment, aiding in decision-making.
ps. This can be used as a long-term TPI component if you dabble in Modern Portfolio Theory (MPT)
Recommended for timeframes on the 1D or above:
NQ 7 IndexThis is a simple index-like script that adds up the market value of the magnificent 7 (AAPL, MSFT, NVDA, TSLA, META, AMZN, GOOG) and divided by a constant.
The way this works is similar to SPX and NDX, except that it doesn't have any special weighting mechanism.
Random Market «NoaTrader»This is a simple script for generating random data shown as candles. The purpose of it is the following:
1- To see what works here. If everything is random and something is working, is there really any reason behind it?
2- To see what NOT works here! this is probably the most interesting part. Human behaviors are more likely to generate bubbles so theories like Elliot waves don't work here but do work on real charts! that is an interesting thing!
3- To find out the exact parameters defining a market which is a bit more complicated and deeper. If you look closely to candles you can say that it is not natural like other candle charts. If you have watched different timeframes enough, you have a sense of the difference between them. Why? What is natural? The volume? The wicks? The seasonality? The amount of randomness? The cycle of momentum change? ... If you can generate candles more similar to real ones it means you know the details of market much better!
P.S: the random function of trading view works differently on different symbols and timeframes..
Normalized Adaptive Trend Lines [MAMA and FAMA]These indicators was originally developed by John F. Ehlers (Stocks & Commodities V. 19:10: MESA Adaptive Moving Averages). Everget wrote the initial functions for these in pine script. I have simply normalized the indicators and chosen to use the Laplace transformation instead of the hilbert transformation
How the Indicator Works:
The indicator employs a series of complex calculations, but we'll break it down into key steps to understand its functionality:
LaplaceTransform: Calculates the Laplace distribution for the given src input. The Laplace distribution is a continuous probability distribution, also known as the double exponential distribution. I use this because of the assymetrical return profile
MESA Period: The indicator calculates a MESA period, which represents the dominant cycle length in the price data. This period is continuously adjusted to adapt to market changes.
InPhase and Quadrature Components: The InPhase and Quadrature components are derived from the Hilbert Transform output. These components represent different aspects of the price's cyclical behavior.
Homodyne Discriminator: The Homodyne Discriminator is a phase-sensitive technique used to determine the phase and amplitude of a signal. It helps in detecting trend changes.
Alpha Calculation: Alpha represents the adaptive factor that adjusts the sensitivity of the indicator. It is based on the MESA period and the phase of the InPhase component. Alpha helps in dynamically adjusting the indicator's responsiveness to changes in market conditions.
MAMA and FAMA Calculation: The MAMA and FAMA values are calculated using the adaptive factor (alpha) and the input price data. These values are essentially adaptive moving averages that aim to capture the current trend more effectively than traditional moving averages.
But Omar, why would anyone want to use this?
The MAMA and FAMA lines offer benefits:
The indicator offers a distinct advantage over conventional moving averages due to its adaptive nature, which allows it to adjust to changing market conditions. This adaptability ensures that investors can stay on the right side of the trend, as the indicator becomes more responsive during trending periods and less sensitive in choppy or sideways markets.
One of the key strengths of this indicator lies in its ability to identify trends effectively by combining the MESA and MAMA techniques. By doing so, it efficiently filters out market noise, making it highly valuable for trend-following strategies. Investors can rely on this feature to gain clearer insights into the prevailing trends and make well-informed trading decisions.
This indicator is primarily suppoest to be used on the big timeframes to see which trend is prevailing, however I am not against someone using it on a timeframe below the 1D, just be careful if you are using this for modern portfolio theory, this is not suppoest to be a mid-term component, but rather a long term component that works well with proper use of detrended fluctuation analysis.
Dont hesitate to ask me if you have any questions
Again, I want to give credit to Everget and ChartPrime!
Normal Distribution CurveThis Normal Distribution Curve is designed to overlay a simple normal distribution curve on top of any TradingView indicator. This curve represents a probability distribution for a given dataset and can be used to gain insights into the likelihood of various data levels occurring within a specified range, providing traders and investors with a clear visualization of the distribution of values within a specific dataset. With the only inputs being the variable source and plot colour, I think this is by far the simplest and most intuitive iteration of any statistical analysis based indicator I've seen here!
Traders can quickly assess how data clusters around the mean in a bell curve and easily see the percentile frequency of the data; or perhaps with both and upper and lower peaks identify likely periods of upcoming volatility or mean reversion. Facilitating the identification of outliers was my main purpose when creating this tool, I believed fixed values for upper/lower bounds within most indicators are too static and do not dynamically fit the vastly different movements of all assets and timeframes - and being able to easily understand the spread of information simplifies the process of identifying key regions to take action.
The curve's tails, representing the extreme percentiles, can help identify outliers and potential areas of price reversal or trend acceleration. For example using the RSI which typically has static levels of 70 and 30, which will be breached considerably more on a less liquid or more volatile asset and therefore reduce the actionable effectiveness of the indicator, likewise for an asset with little to no directional volatility failing to ever reach this overbought/oversold areas. It makes considerably more sense to look for the top/bottom 5% or 10% levels of outlying data which are automatically calculated with this indicator, and may be a noticeable distance from the 70 and 30 values, as regions to be observing for your investing.
This normal distribution curve employs percentile linear interpolation to calculate the distribution. This interpolation technique considers the nearest data points and calculates the price values between them. This process ensures a smooth curve that accurately represents the probability distribution, even for percentiles not directly present in the original dataset; and applicable to any asset regardless of timeframe. The lookback period is set to a value of 5000 which should ensure ample data is taken into calculation and consideration without surpassing any TradingView constraints and limitations, for datasets smaller than this the indicator will adjust the length to just include all data. The labels providing the percentile and average levels can also be removed in the style tab if preferred.
Additionally, as an unplanned benefit is its applicability to the underlying price data as well as any derived indicators. Turning it into something comparable to a volume profile indicator but based on the time an assets price was within a specific range as opposed to the volume. This can therefore be used as a tool for identifying potential support and resistance zones, as well as areas that mark market inefficiencies as price rapidly accelerated through. This may then give a cleaner outlook as it eliminates the potential drawbacks of volume based profiles that maybe don't collate all exchange data or are misrepresented due to large unforeseen increases/decreases underlying capital inflows/outflows.
Thanks to @ALifeToMake, @Bjorgum, vgladkov on stackoverflow (and possibly some chatGPT!) for all the assistance in bringing this indicator to life. I really hope every user can find some use from this and help bring a unique and data driven perspective to their decision making. And make sure to please share any original implementaions of this tool too! If you've managed to apply this to the average price change once you've entered your position to better manage your trade management, or maybe overlaying on an implied volatility indicator to identify potential options arbitrage opportunities; let me know! And of course if anyone has any issues, questions, queries or requests please feel free to reach out! Thanks and enjoy.
PineConnector newsfilterThis script can send an eaoff message to the pineconnector-EA at a preset time, and an eaon message for when the EA should be reenabled.
Handy for temporarily disabling pineconnector during news events.
Can be adjusted according to the local timezone.
PineConnector newsfilterScript can send an eaoff message to the pineconnector-EA at a preset time, and an eaon message for when the EA should be reenabled.
Handy for temporarily disabling pineconnector during news events.
This version works for timezone UTC+2
Stock Open % ChangeWhile the percentage change in price from yesterday's close is important, wouldn't it be more interesting to see how much a stock price changes from the Market Open? Furthermore, you could track multiple indices to see which one has moment based on the percentage change in open, informing trading decisions.
This grid allows you to select 5 different ticker symbols, and display the change% from open, and from the close. Colors, rows, and grid placement may be customized as well.