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.
Сферы применения Pine
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".
Time Session Filter - MACD exampleTime Session Filter in TradingView Strategy: A Comprehensive Guide
Welcome to this educational TradingView blog where we dive deep into the functionality and utility of the time session filter in trading strategies. It's interesting to note that the time session filter is a commonly overlooked feature in Pine Script, often not integrated into overall trading strategies. Yet, when used wisely, this tool can significantly enhance your trading approach. In essence, the session filter ensures that trades are only made within a specific, user-defined time frame. By incorporating this often-neglected building block, you can make your strategy more adaptable to various market conditions and trading preferences.
What is a Time Session Filter?
A time session filter is designed to:
Select Times of the Day to Trade: The filter allows you to choose specific hours during the day in which trades are allowed to be excecuted.
Toggle Days to Trade: You can decide which days of the week you want to trade, giving you the flexibility to avoid days that are historically not profitable for your strategy.
Close Trade When Session Ends: The filter can automatically close any open trade once the specified time session concludes, reducing the risk associated with holding positions outside your chosen time frame.
The user interface is streamlined, taking minimal space for the input sections, making it convenient to integrate with other indicators in your overall strategy script. In addition the script colors the background of the chart green when the timesession filter is on and makes the background red when the filter doesn't allow any trades. This helps you to visualise the selected timeframes in relation to chart patterns.
Best Practices for Time Selection
From my personal trading experience I share some input settings you can try to play around with:
Stocks: Trading stocks sometimes yield better results if you only trade in the mornings until lunchtime. This is the period when markets are generally more active, and traders are keenly participating.
Cryptocurrencies: For cryptocurrencies, it sometimes makes sense to avoid trading on Fridays, a day when futures contracts often expire. Various other market-moving events also typically occur on Fridays.
Random Selection: Interestingly, sometimes choosing a random selection of times and days can improve the script's performance, adding an element of unpredictability that might outperform more systematic approaches.
Strategy Overview
This strategy script incorporates various elements, including risk position size and MACD indicator, to provide a comprehensive trading strategy. For a detailed explanation of risk position sizing, please refer to this article:
For a complete understanding of the MACD indicator utilized, visit the following explanation:
Additionally, for high time frame trend filters, consult this resource for more info:
Educational Purposes and Risks
Please note that this script is for educational purposes and serves merely as an example of how to incorporate a time session filter into a trading strategy for pinescript. It is a simplified strategy without a fixed stop-loss, which can result in higher exposure to significant losses. The time session filter can be a powerful addition to your trading strategy, providing you with the tools to tailor your approach according to time-specific market conditions. By understanding its functionalities and best practices, you can make more informed trading decisions, but always remember that trading carries inherent risks.
Happy trading!
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.
Share CalculatorThis is a simple grid box that will calculate the number of total shares you can trade on two different stocks based on a principal amount you enter in the settings. The indicator updates throughout the trading day as price changes. The 25% column tells you the number of shares you can "scale into" the trade, 1/4 at a time, up to the total number of shares below.
The reason I built this indicator, is that I trade on a platform that isn't as flexible as some other platforms in terms of entering monetary amounts I want to trade in a stock. I have to enter the number of shares I want to purchase. Additionally, in some of the accounts I trade, I need to monitor both the Bull ETF and the Bear ETF, so it's helpful to have them side by side.
I was tired of going back and forth to excel and my trading platform! To use this, simply update the principal amount you have to trade, and update the Ticker symbols you want to use. Colors and grid placement are customizable.
Risk to Reward - FIXED SL BacktesterDon't know how to code? No problem! TradingView is an excellent platform for you. ✅ ✅
If you have an indicator that you want to backtest using a risk-to-reward ratio or fixed take profit/stop loss levels, then the Risk to Reward - FIXED SL Backtester script is the perfect solution for you.
introducing Risk to Reward - FIXED SL Backtester Script which will allow you to test any indicator / Signal with RR or Fixed SL system
How does it work ?!
Once you connect the script to your indicator, it will analyze your entry points and perform calculations based on them. It will then open trades for you according to the specified inputs in the script settings.
HOW TO CONNECT IT to your indicator?
simply open your indicator code and add the below line of code to it
plot(Signal ? 100 : 0,"Signal",display = display.data_window)
Replace Signal with the long condition from your own indicator. You can also modify the value 100 to any number you prefer. After that, open the settings.
Once the script is connected to your indicator, you can choose from two options:
Risk To Reward Ratio System
Fixed TP/ SL System
🔸if you select the Risk to Reward System ⤵️
The Risk-to-Reward System requires the calculation of a stop loss. That's why I have included three different types of stop-loss calculations for you to choose from:
ATR Based SL
Pivot Low SL
VWAP Based SL
Your stop loss and take profit levels will be automatically calculated based on the selected stop loss method and your risk-to-reward ratio.
You can also adjust their values to match your desired risk level. The trades will be displayed on the chart.
with the ability to change their values to match your risk.
once this is done, trades will be displayed on the chart
🔸if you select the Fixed system ⤵️
You have 2 inputs, which are FIXED TP & Fixed SL
input the values you want, and trades will be on your chart...
I have also added a Breakeven feature for you.
with this Breakeven feature the trade will not just move SL to Entry ?! NO NO, it will place it above entry by a % you input yourself, so you always win! 🚀
Here is an example
Enjoy, and have fun, if you have any questions do not hesitate to ask