US Composite Leading Indicator (CLI)The US Composite Leading Indicator (CLI), normalized for the United States, closely mirrors the Conference Board "Leading Economic Index" (LEI). It offers unique insights into economic and financial dynamics.
The Composite Leading Indicator (CLI) is an economic tool designed to anticipate economic developments. It is created by aggregating and normalizing a wide range of economic and financial data from various sources.
The normalized data is then aggregated, and a composite indicator is calculated by taking a weighted average of individual indicators.
The CLI is used to provide early insights into the state of the economy and to anticipate future economic trends. It is particularly valuable for predicting economic downturns, including recessions.
The CLI is an essential tool for economists, governments, businesses, and investors seeking to understand economic trends and make informed decisions.
Key Features:
1. Early Warning: Just like its counterpart, the CLI indicator excels at offering early warnings about significant economic events, particularly economic crises. This makes it an indispensable asset for analysts and investors.
2. Recession Indicators: The moving average serves as an early warning system for potential economic recessions. When it crosses the indicator line from the bottom to the top while surpassing a predefined threshold (e.g., 101), it signals a potential crisis.
3. Market Impact: The CLI indicator provides valuable insights into the performance of financial markets, offering cues about indices such as the S&P 500, Nasdaq, Dow Jones, and more.
Why It Matters:
Understanding the US Composite Leading Indicator (CLI) indicator, normalized for the United States, is crucial for anticipating economic shifts and preparing for changes in financial markets. By analyzing a diverse array of economic factors, it provides a holistic view of economic well-being. Whether you're an investor or economist, this indicator can be an invaluable resource for staying informed about market trends and major economic developments.
Source:
www.data.oecd.org
Forecasting
Supertrend Multiasset Correlation - vanAmsen Hello traders!
I am elated to introduce the "Supertrend Multiasset Correlation" , a groundbreaking fusion of the trusted Supertrend with multi-asset correlation insights. This approach offers traders a nuanced, multi-layered perspective of the market.
The Underlying Concept:
Ever pondered over the term Multiasset Correlation?
In the intricate tapestry of financial markets, assets do not operate in silos. Their movements are frequently intertwined, sometimes palpably so, and at other times more covertly. Understanding these correlations can unlock deeper insights into overarching market narratives and directional trends.
By melding the Supertrend with multi-asset correlations, we craft a holistic narrative. This allows traders to fathom not merely the trend of a lone asset but to appreciate its dynamics within a broader market tableau.
Strategy Insights:
At the core of this indicator is its strategic approach. For every asset, a signal is generated based on the Supertrend parameters you've configured. Subsequently, the correlation of daily price changes is assessed. The ultimate signal on the selected asset emerges from the average of the squared correlations, factoring in their direction. This indicator not only accounts for the asset under scrutiny (hence a correlation of 1) but also integrates 12 additional assets. By default, these span U.S. growth ETFs, value ETFs, sector ETFs, bonds, and gold.
Indicator Highlights:
The "Supertrend Multiasset Correlation" isn't your run-of-the-mill Supertrend adaptation. It's a bespoke concoction, tailored to arm traders with an all-encompassing view of market intricacies, fortified with robust correlation metrics.
Key Features:
- Supertrend Line : A crystal-clear visual depiction of the prevailing market trajectory.
- Multiasset Correlation : Delve into the intricate interplay of various assets and their correlation with your primary instrument.
- Interactive Correlation Table : Nestled at the top right, this table offers a succinct overview of correlation metrics.
- Predictive Insights : Leveraging correlations to proffer predictive pointers, adding another layer of conviction to your trades.
Usage Nuances:
- The bullish Supertrend line radiates in a rejuvenating green hue, indicative of potential upward swings.
- On the flip side, the bearish trajectory stands out in a striking red, signaling possible downtrends.
- A rich suite of customization tools ensures that the chart resonates with your trading ethos.
Parting Words:
While the "Supertrend Multiasset Correlation" bestows traders with a rejuvenated perspective, it's paramount to embed it within a comprehensive trading blueprint. This would include blending it with other technical tools and adhering to stringent risk management practices. And remember, before plunging into live trades, always backtest to fine-tune your strategies.
Supertrend Forecast - vanAmsenHello everyone!
I am thrilled to present the "vanAmsen - Supertrend Forecast", an advanced tool that marries the simplicity of the Supertrend with comprehensive statistical insights.
Before we dive into the functionalities of this indicator, it's essential to understand its foundation and theory.
The Theory:
What exactly is the Supertrend?
The Supertrend, at its core, is a momentum oscillator. It's a tool that provides buy and sell signals based on the prevailing market trend. The underlying principle is straightforward: by analyzing average price data and volatility over a period, the Supertrend gives us a line that represents the trend direction.
However, trading isn't just about identifying trends; it's about understanding their strength, potential profitability, and historical accuracy. This is where statistics come into play. By incorporating statistical analysis into the Supertrend, we can gain deeper insights into the market's behavior.
Description:
The "vanAmsen - Supertrend Forecast" isn't just another Supertrend indicator. It's a comprehensive tool designed to offer traders a holistic view of market trends, backed by robust statistical analysis.
Key Features:
- Supertrend Line: A visual representation of the current market direction.
- Win Rate & Expected Return: Delve into the historical accuracy and profitability of the prevailing trend.
- Average Percentage Change: Understand the average price fluctuation for both winning and losing trends.
- Forecast Lines: Project future price movements based on historical data, providing a roadmap for potential scenarios.
- Interactive Table: A concise table in the top right, offering a snapshot of all vital metrics at a glance.
Usage:
- The bullish Supertrend line adopts an Aqua hue, indicating potential upward momentum.
- In contrast, the bearish line is painted in Orange, suggesting potential downtrends.
- Customize your chart by toggling labels, tables, and lines according to preference.
Recommendation:
The "vanAmsen - Supertrend Forecast" is undoubtedly a powerful tool in a trader's arsenal. However, it's imperative to combine it with other technical analysis tools and sound risk management practices. It's always prudent to backtest strategies with historical data before embarking on live trading.
Strong Pullback Indicator [Rami_LB]Strong Pullback Indicator
Description:
The Strong Pullback Indicator is designed to identify potential pullbacks or even trend reversals by utilizing a specific candlestick pattern in conjunction with the Relative Strength Index (RSI). It is advised to employ this indicator in chart intervals of 15 minutes or higher, as intervals below 15 minutes may generate excessive false signals.
Working Mechanism:
Upon detecting the designated candlestick pattern, the indicator examines whether any of the last five candles exhibit RSI values below 30 or above 70 across at least four distinct time intervals, depending on whether the pattern is bullish or bearish. The RSI calculations incorporate eight different intervals: 1 minute (1m), 5 minutes (5m), 15 minutes (15m), 30 minutes (30m), 1 hour (1h), 2 hours (2h), 4 hours (4h), and 1 day (1d). An arrow is rendered above or below the current candle only when these conditions are met.
Users have the option to adjust the number of overbought or oversold intervals, as well as the general settings for the RSI.
SL/TP Lines:
The indicator can also serve as a trade signal to initiate trades in the opposite direction. To evaluate the potential success of a trade in a backtesting scenario, SL (Stop Loss) and TP (Take Profit) lines can be displayed on the chart. The SL is calculated by taking the distance from the close of the current candle to the high/low of the previous candle and multiplying it by 2.
In the settings, you can alter the Risk Reward Ratio (RRR) of the trade. Given the pullback nature of this indicator, a RRR of 1:1 is deemed logical, thus set as the default value.
Bullish vs. Bearish Candle Counter:
An additional feature of this indicator is its ability to analyze the last 100 candles to ascertain the ratio of bullish to bearish candles. When a 60% threshold is reached, the chart background color alters accordingly. This feature was conceived after a thorough analysis of over 50,000 candles of a currency pair revealed nearly identical counts of bullish and bearish candles, suggesting a market tendency to maintain this balance.
Within the settings, you have the flexibility to modify the number of candles to be analyzed and the percentage threshold for each candle type.
Should you have any ideas on how to enhance the accuracy of this indicator, or suggestions for other indicators that could improve the signals, feel free to leave a comment.
Forex Market Fundamental indicatorsThese explanations are provided in both English and Persian languages.
You can read the description in Persian below.
این توضیحات به دو زبان انگلیسی و فارسی ارائه شده است.
در زیر می توانید توضیحات را به زبان فارسی بخوانید.
If you are looking for a fundamental indicator, We suggest you use this indicator.
It provides an advanced and leading model for fundamental market analysis.
The indexes which are used in the “Indicator” include: unemployment rates, GDP, inflation, and M1 money supply.
For the indices of this indicator, a safe range is defined by the central bank of each country.
For example, the inflation target for countries in different periods has specific limits:
United States: 2%
United Kingdom: 2%
Canada: 2%
Australia: 2%
New Zealand: 1 to 3%
Japan: 0 to 2%
Switzerland: 0 to 2%
European Union: 2%
Considering the past events of each country and the goals of each country and the long-term average of the indicators as well as what the economic officials announce, it can be recognized that there is a red line for each country. Therefore, if the value of the index reaches those red lines, it will definitely affect the monetary and financial policies of those countries.
For example, we estimate that if the monthly inflation rate in Japan, Switzerland, the United Kingdom, and the European Union is more than 0.33, the monetary policies of those countries will try to reduce the inflation. They will try to control inflation by using tools such as increasing interest rates, and from our point of view, this is a positive point in the direction of increasing the value of that country's currency.
Likewise, if the monthly inflation rate in the United States, Canada, Australia or New Zealand is below -0.1, our view is that: these countries will try to stimulate the market with policies such as interest rate cuts or liquidity increases. And these economic policies lead to a decrease in the value of the currency of these countries. As a result, we give a negative score to that country's currency.
To be more precise, the view that we have implemented in this indicator is as follows:
Let's say your symbol chart is on the USDJPY pair.
By default, the possibility of growth in the value of each of the currencies relative to each other is 50 to 50.
But suppose the monthly inflation rate in the United States is -0.15.
Our analysis is that the United States will probably try to reduce the value of its currency to control it (due to the adoption of expansionary policies).
As a result, we reduce the probability of growth in the value of the US dollar relative to the Japanese yen by 5% to 45%, and we also increase the probability of growth in the value of the yen to the dollar to 55%.
Now suppose the monthly inflation rate in Japan is 0.4. Then our analysis is: Japan will try to increase the value of its national currency to control the inflation rate (using contractionary policies).
As a result, we reduce the probability that the US dollar will appreciate against the Japanese yen to 40%. Also, we increase the probability of yen to dollar growth by 60%.
Using this indicator and according to the same symbol, based on each of the five economic indicators, we examine both currencies of the symbol. And finally, based on the surveys, we get the probability of price growth between 0 and 100 percent. And we also determine the possibility of price reduction. However, the probability of zero or one hundred is almost impossible.
If you have any questions about our view in relation to other indicators, you can comment and ask.
We will answer you.
These questions and answers will help and evolute both of us. We are trying to keep this Indicator up to date and improve it with the most logical arguments.
The important point is that this indicator never claims to always be correct. The forecast of this Indicator may not be realized or may be realized in different and longer time periods.
As a fact for any financial expert, we should know that there are many parameters that affect the price, and this Indicator cannot analyze all of them. Therefore, look at this Indicator as an auxiliary tool and do not expect miracles from it.
Head of programmers:
Mr. Mojtaba askari - Mr. Mohammad sanaei
Developers:
Mrs. Hamideh Azari
Mr. Peyman Mahdavi
Mr. Mohsen shabani
Mr. Moslem Balasi
Mr. Shahrokh Nakhaei
اگر به دنبال یک اندیکاتور بر پایه تحلیل بنیادی هستید، پیشنهاد می کنیم از این اندیکاتور استفاده کنید.
این یک مدل پیشرفته و پیشرو برای تحلیل بنیادی بازار ارائه می دهد.
شاخص هایی که در این «اندیکاتور» بررسی شده، عبارتند از: نرخ بیکاری، تولید ناخالص داخلی، تورم، نرخ بهره و حجم نقدینگی M1.
برای شاخص های این اندیکاتور، یک محدوده امن توسط بانک مرکزی هر کشور تعریف شده است.
به عنوان مثال، هر کشور، در دوره های مختلف، هدف تورمی خاصی تعیین میکند:
ایالات متحده: 2%
بریتانیا: 2%
کانادا: 2%
استرالیا: 2%
نیوزلند: 1 تا 3 درصد
ژاپن: 0 تا 2 درصد
سوئیس: 0 تا 2 درصد
اتحادیه اروپا: 2%
با توجه به اتفاقات گذشته هر کشور و اهداف هر کشور و میانگین بلندمدت شاخصها و همچنین آنچه مسئولان اقتصادی اعلام میکنند، میتوان تشخیص داد که برای هر کشور یک خط قرمز وجود دارد. بنابراین اگر مقدار شاخص به آن خطوط قرمز برسد، قطعا بر سیاست های پولی و مالی آن کشورها تأثیر خواهد گذاشت.
به عنوان مثال، ما تخمین می زنیم که اگر نرخ تورم ماهانه در ژاپن، سوئیس، انگلستان و اتحادیه اروپا بیش از 0.33 باشد، سیاست های پولی آن کشورها سعی در کاهش تورم خواهد داشت. آنها سعی خواهند کرد با استفاده از ابزارهایی مانند افزایش نرخ بهره، تورم را کنترل کنند و از نظر ما این نکته مثبتی در جهت افزایش ارزش پول آن کشور است.
به همین ترتیب، اگر نرخ تورم ماهانه در ایالات متحده، کانادا، استرالیا یا نیوزلند زیر 0.1- باشد، نظر ما این است که: این کشورها با سیاست هایی مانند کاهش نرخ بهره یا افزایش نقدینگی سعی در تحریک بازار خواهند داشت. و این سیاست های اقتصادی منجر به کاهش ارزش پول این کشورها می شود. در نتیجه به واحد پول آن کشور نمره منفی می دهیم.
به بیان دقیق تر، دیدگاهی که در این اندیکاتور پیاده سازی کرده ایم به شرح زیر است:
فرض کنید نماد نمودار شما روی جفت ارز "USDJPY" است.
به طور پیش فرض امکان رشد ارزش هر یک از ارزها نسبت به یکدیگر 50 تا 50 در نظر گرفته شده.
اما فرض کنید نرخ تورم ماهانه در ایالات متحده 0.15- باشد.
تحلیل ما این است که احتمالا ایالات متحده برای کنترل آن (با استفاده از سیاست های انبساطی) سعی در کاهش ارزش پول خود خواهد داشت.
در نتیجه احتمال رشد ارزش دلار آمریکا نسبت به ین ژاپن را با 5 درصد کاهش به 45 درصد و همچنین احتمال رشد ارزش ین به دلار را به 55 درصد افزایش می دهیم.
حال فرض کنید نرخ تورم ماهانه در ژاپن 0.4 باشد. سپس تحلیل ما این است: ژاپن سعی خواهد کرد ارزش پول ملی خود را افزایش دهد تا نرخ تورم را کنترل کند (با استفاده از سیاست های انقباضی).
در نتیجه، احتمال افزایش ارزش دلار آمریکا در برابر ین ژاپن را به 40 درصد کاهش می دهیم. همچنین، احتمال رشد ین ژاپن به دلار آمریکا را به 60 درصد افزایش می دهیم.
با استفاده از این شاخص و با توجه به همین نماد، بر اساس هر یک از پنج شاخص اقتصادی، هر دو ارز نماد را بررسی می کنیم. و در نهایت بر اساس بررسی های انجام شده احتمال رشد قیمت بین 0 تا 100 درصد را به دست می آوریم و امکان کاهش قیمت را نیز تعیین می کنیم. با این حال، احتمال صفر یا صد تقریبا غیرممکن است.
اگر در مورد دیدگاه ما در ارتباط با سایر شاخص ها سوالی دارید می توانید در قسمت کامنت ها از ما بپرسید.
ما به شما پاسخ خواهیم داد.
این پرسش ها و پاسخ ها به هر دوی ما کمک می کند و باعث رشد و تکامل همه ما می شود. ما سعی میکنیم این اندیکاتور را به روز نگه داریم و با منطقی ترین استدلال ها آن را بهبود ببخشیم.
نکته مهم این است که این اندیکاتور هرگز ادعا نمیکند همیشه درست است. پیش بینی این شاخص ممکن است محقق نشود یا در دوره های زمانی مختلف و طولانی تر محقق شود.
به عنوان یک واقعیت ، هر کارشناس و فعال حوزه مالی میداند که پارامترهای زیادی وجود دارد که بر قیمت تاثیر میگذارد و این اندیکاتور نمیتواند همه آنها را تحلیل کند. بنابراین به این اندیکاتور به عنوان یک ابزار کمکی نگاه کنید و از آن انتظار معجزه نداشته باشید.
سرپرست برنامه نویسان:
آقای محمد ثنائی - آقای مجتبی عسکری
توسعه دهندگان:
خانم حمیده آذری
آقای پیمان مهدوی
آقای محسن شعبانی
آقای مسلم بلاسی
آقای شاهرخ نخعی
Open, Open +/- EMA ATR Lines with LabelsThis indicator provides traders with a clear visualization of the opening price and its potential movement range for a specific timeframe, based on the Exponential Moving Average (EMA) of the Average True Range (ATR).
Features:
Opening Price Line: A green line representing the opening price for the chosen timeframe.
EMA ATR Lines:
An upper blue line, calculated as the opening price plus the EMA of the ATR.
A lower blue line, calculated as the opening price minus the EMA of the ATR.
Labels: Each line comes with a label on its right side, displaying the price level and, for the EMA ATR lines, the distance in pips from the opening price.
Custom Timeframes: Users can select their desired timeframe for calculations, making this tool versatile for different trading strategies.
Usage:
The EMA-smoothed ATR provides a measure of volatility. By plotting this value above and below the opening price, traders get a sense of potential price movement for the selected timeframe. This can be particularly useful for setting stop losses, take profit levels, or identifying breakout points.
For instance, if the price breaks above the upper EMA ATR line, it might indicate a potential upward move, especially if other market conditions align.
Customization:
Timeframe: Choose from various timeframes like 1-minute, 5-minutes, daily, weekly, and more.
ATR Length: Adjust the length of the ATR for more or less sensitivity.
This indicator is designed to offer traders a quick way to gauge potential price movement for their chosen timeframe. By combining the principles of the opening price and volatility measured by the EMA-smoothed ATR, it provides a straightforward yet powerful tool for various trading scenarios.
Liquidity Depth [Pro+]Description:
Liquidity Depth Pro+ is a trading tool with a remarkable adaptability and perfectly aligned with the intricate demands of the futures, forex, and bond markets. This indicator is based on a concept taught by the Inner Circle Trader (ICT), who explains that institutions tend to dig deeper into Liquidity Pools above highs and below lows. Specifically, ICT mentions how in Forex these Liquidity Depths are classically manifested as 10-20-30 pips respectively.
This tool allows the Analyst to adapt this concept based on their understanding of price. It delves into the essence of institutional trading, exposing deeper liquidity depth pursued by institutional giants and astute bank traders that lay further than the mere extremities of price.
CME_MINI:NQ1! Example (Tuesday):
Price raids Monday's low
Price raids Friday's low
Price digs deeper into one of Friday's Deep Liquidity Pools
Low of the Day Reversal
Note: the Depths used in this example are 30-60-90 points.
Key Features:
Versatility Across Assets: Liquidity Depth Pro+ is finely tailored for futures, forex, and bond markets, making it an all-encompassing solution suitable for a broad range of financial instruments.
Timeframe Customization: Liquidity Depth Pro+ allows users to decide Timeframe Liquidity empowering the analyst with flexibility.
Historical Pools: Choose up to the last 20 highs and lows to mark liquidity pools from the User Selected Timeframe.
Universal Trading Style: Regardless of your trading approach, be it trend-following or reversal models, this indicator embraces all styles. It offers a holistic perspective to navigating liquidity zones above highs and below lows of the chosen Timeframe.
Visual Precision: This indicator visualizes the liquidity depth with a customizable style, allowing the analyst to frame the position of deeper liquidity pools above highs and below lows.
Liquidity Table: Keep track of liquidity levels and unlock faster decision making by taking advantage of the visual Liquidity Table cues.
Adaptive Table Colors: When price is above your desired liquidity pool high, the table will match the liquidity high color to indicate a current liquidity raid or deeper pool being attacked. Vice versa, when price is below your desired liquidity pool low, the table will match the liquidity low color.
Real-Time Alerts: Save Time with live alerts that provide valuable insights into potential opportunities and liquidity purges at your desired liquidity levels.
Other Features:
Choose the Depth Type ("Auto", "Value", "Ticks", "Pips"). The “Auto” feature will select the best unit of measurement for the depths based on the current market on chart.
Choose to show up to Three Liquidity Depths.
Customize the Liquidity Line Style.
Customize the Liquidity Line Color.
Customize the Liquidity Line Width.
Customize Table Size and Location
Usage Guidance:
Add Liquidity Depth to your Tradingview chart.
Customize your desired Timeframe and Liquidity Depths to align with your personal preference.
Observe where the Liquidity Lines manifest above and below your chosen Timeframe’s highs and lows respectively, once they are raided.
Leverage this invaluable information to frame the narrative, whether you opt to pursue liquidity or capitalize on post-purge reversals.
These tools are available ONLY on the TradingView platform.
Terms and Conditions
Our charting tools are products provided for informational and educational purposes only and do not constitute financial, investment, or trading advice. Our charting tools are not designed to predict market movements or provide specific recommendations. Users should be aware that past performance is not indicative of future results and should not be relied upon for making financial decisions. By using our charting tools, the purchaser agrees that the seller and the creator are not responsible for any decisions made based on the information provided by these charting tools. The purchaser assumes full responsibility and liability for any actions taken and the consequences thereof, including any loss of money or investments that may occur as a result of using these products. Hence, by purchasing these charting tools, the customer accepts and acknowledges that the seller and the creator are not liable nor responsible for any unwanted outcome that arises from the development, the sale, or the use of these products.
Finally, the purchaser indemnifies the seller from any and all liability. If the purchaser was invited through the Friends and Family Program, they acknowledge that the provided discount code only applies to the first initial purchase of the Toodegrees Premium Suite subscription. The purchaser is therefore responsible for cancelling – or requesting to cancel – their subscription in the event that they do not wish to continue using the product at full retail price. If the purchaser no longer wishes to use the products, they must unsubscribe from the membership service, if applicable. We hold no reimbursement, refund, or chargeback policy. Once these Terms and Conditions are accepted by the Customer, before purchase, no reimbursements, refunds or chargebacks will be provided under any circumstances.
By continuing to use these charting tools, the user acknowledges and agrees to the Terms and Conditions outlined in this legal disclaimer.
Machine Learning: SuperTrend Strategy TP/SL [YinYangAlgorithms]The SuperTrend is a very useful Indicator to display when trends have shifted based on the Average True Range (ATR). Its underlying ideology is to calculate the ATR using a fixed length and then multiply it by a factor to calculate the SuperTrend +/-. When the close crosses the SuperTrend it changes direction.
This Strategy features the Traditional SuperTrend Calculations with Machine Learning (ML) and Take Profit / Stop Loss applied to it. Using ML on the SuperTrend allows for the ability to sort data from previous SuperTrend calculations. We can filter the data so only previous SuperTrends that follow the same direction and are within the distance bounds of our k-Nearest Neighbour (KNN) will be added and then averaged. This average can either be achieved using a Mean or with an Exponential calculation which puts added weight on the initial source. Take Profits and Stop Losses are then added to the ML SuperTrend so it may capitalize on Momentum changes meanwhile remaining in the Trend during consolidation.
By applying Machine Learning logic and adding a Take Profit and Stop Loss to the Traditional SuperTrend, we may enhance its underlying calculations with potential to withhold the trend better. The main purpose of this Strategy is to minimize losses and false trend changes while maximizing gains. This may be achieved by quick reversals of trends where strategic small losses are taken before a large trend occurs with hopes of potentially occurring large gain. Due to this logic, the Win/Loss ratio of this Strategy may be quite poor as it may take many small marginal losses where there is consolidation. However, it may also take large gains and capitalize on strong momentum movements.
Tutorial:
In this example above, we can get an idea of what the default settings may achieve when there is momentum. It focuses on attempting to hit the Trailing Take Profit which moves in accord with the SuperTrend just with a multiplier added. When momentum occurs it helps push the SuperTrend within it, which on its own may act as a smaller Trailing Take Profit of its own accord.
We’ve highlighted some key points from the last example to better emphasize how it works. As you can see, the White Circle is where profit was taken from the ML SuperTrend simply from it attempting to switch to a Bullish (Buy) Trend. However, that was rejected almost immediately and we went back to our Bearish (Sell) Trend that ended up resulting in our Take Profit being hit (Yellow Circle). This Strategy aims to not only capitalize on the small profits from SuperTrend to SuperTrend but to also capitalize when the Momentum is so strong that the price moves X% away from the SuperTrend and is able to hit the Take Profit location. This Take Profit addition to this Strategy is crucial as momentum may change state shortly after such drastic price movements; and if we were to simply wait for it to come back to the SuperTrend, we may lose out on lots of potential profit.
If you refer to the Yellow Circle in this example, you’ll notice what was talked about in the Summary/Overview above. During periods of consolidation when there is little momentum and price movement and we don’t have any Stop Loss activated, you may see ‘Signal Flashing’. Signal Flashing is when there are Buy and Sell signals that keep switching back and forth. During this time you may be taking small losses. This is a normal part of this Strategy. When a signal has finally been confirmed by Momentum, is when this Strategy shines and may produce the profit you desire.
You may be wondering, what causes these jagged like patterns in the SuperTrend? It's due to the ML logic, and it may be a little confusing, but essentially what is happening is the Fast Moving SuperTrend and the Slow Moving SuperTrend are creating KNN Min and Max distances that are extreme due to (usually) parabolic movement. This causes fewer values to be added to and averaged within the ML and causes less smooth and more exponential drastic movements. This is completely normal, and one of the perks of using k-Nearest Neighbor for ML calculations. If you don’t know, the Min and Max Distance allowed is derived from the most recent(0 index of data array) to KNN Length. So only SuperTrend values that exhibit distances within these Min/Max will be allowed into the average.
Since the KNN ML logic can cause these exponential movements in the SuperTrend, they likewise affect its Take Profit. The Take Profit may benefit from this movement like displayed in the example above which helped it claim profit before then exhibiting upwards movement.
By default our Stop Loss Multiplier is kept quite low at 0.0000025. Keeping it low may help to reduce some Signal Flashing while not taking extra losses more so than not using it at all. However, if we increase it even more to say 0.005 like is shown in the example above. It can really help the trend keep momentum. Please note, although previous results don’t imply future results, at 0.0000025 Stop Loss we are currently exhibiting 69.27% profit while at 0.005 Stop Loss we are exhibiting 33.54% profit. This just goes to show that although there may be less Signal Flashing, it may not result in more profit.
We will conclude our Tutorial here. Hopefully this has given you some insight as to how Machine Learning, combined with Trailing Take Profit and Stop Loss may have positive effects on the SuperTrend when turned into a Strategy.
Settings:
SuperTrend:
ATR Length: ATR Length used to create the Original Supertrend.
Factor: Multiplier used to create the Original Supertrend.
Stop Loss Multiplier: 0 = Don't use Stop Loss. Stop loss can be useful for helping to prevent false signals but also may result in more loss when hit and less profit when switching trends.
Take Profit Multiplier: Take Profits can be useful within the Supertrend Strategy to stop the price reverting all the way to the Stop Loss once it's been profitable.
Machine Learning:
Only Factor Same Trend Direction: Very useful for ensuring that data used in KNN is not manipulated by different SuperTrend Directional data. Please note, it doesn't affect KNN Exponential.
Rationalized Source Type: Should we Rationalize only a specific source, All or None?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Smoothing Type: How should we smooth our Fast and Slow ML Datas to be used in our KNN Distance calculation? SMA, EMA or VWMA?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Euclidean Distance Predictive Candles [SS]Finally releasing this, its been in the works for the past 2 weeks and has undergone many iterations.
I am not sure if I am 100% happy with it yet, but I guess its best to release and get feedback to make improvements.
So this is the Euclidean distance predictive candle indicator and what it does is exactly what it sounds like, it uses Euclidean distance to identify similar candles and then plot the candles and range that immediately proceeded like candles.
While this is using a general machine learning/data science approach (Euclidean distance), I do not employ the KNN (Nearest Neighbors) algo into this. The reason being is it simply offered no predictive advantage than isolating for the last case. I tried it, I didn't like it, the results were not improve and, at times, acutally hindered so I ditched it. Perhaps it was my approach but using some other KNN indicators, I just don't really find them all that more advantageous to simply relying on the Law of Large Numbers and collecting more data rather than less data (which we will get into later in this explanation).
So using this indicator:
There is a lot of customizability here. And the reason is, not all settings are going to work the same for all tickers. To help you narrow down your parameters, I have included various backtest results that show you how the model is performing. You see in the AMZN chart above, with the current settings, it is performing optimally, with a cumulative range pass of 99% (meaning that, of all the cases, the indicator accurately predicted the next day high OR low range 99% of the time), and the ability to predict the candle slightly over 52%.
The recommended settings, from me, are as follows:
So these are generally my recommended settings.
Euclidian Tolerance: This will determine the parameters to look for similar candles. In general, the lower the tolerance, the greater the precision. I recommend keeping it between 0.5, for tickers with larger prices (like ES1! futures or NQ1!) or 0.05 for tickers with lower TPs, like SPY or QQQ.
If the ED Tolerance is too extreme that the indicator cannot find identical setups, it will alert you:
But in general, the more precise you can get it, the better.
Anchor Type: You will see the option to anchor by "Predicted Open" or by "Previous Close". I suggest sticking with anchoring by predicted open. All this means is, it is going to anchor your range, candle, high and low targets by the predicted open price. Anchoring by previous close will anchor by the close of yesterday. Both work okay, but in general the results from anchoring to predicted open have higher pass rates and more accurately depict the candle.
Euclidean Distance Measurement Type: You can choose to measure by candle body or from high to low wicks. I haven't played around with measuring from high to low wicks all that much, because candle body tends to do the job. But remember, ED is a neutral measurement. Which means, its not going to distinguish between a red or green candle, just the formation of the candle. Thus, I tend to recommend, pragmatically, not to necessarily rely on the candle being red or green, but one the formation of the candle (where are the wicks going, are there more bearish wicks or bullish wicks) etc. Examples will follow.
Range Prediction Type: You can filter the range prediction type by last instance (in which, it will pull the previous identical candle and plot the next candle that followed it, adjusted for the current ranges) or "Average of All Cases". So this is where we need to talk a little bit about the law of large numbers.
In general, in statistics, when you have a huge amount of random data, the law of large numbers stipulates that, within this randomness should be repeated events. This is why sometimes chart patterns work, sometimes they don't. When we filter by the average of all cases, we are relying on the law of large numbers. In general, if you are getting good Backtest readings from Last Instance, then you don't need to use this function. But it provides an alternative insight into potential candle formations next day. Its not a bad idea to compare between the two and look for similarities and differences.
So now that we have covered the boring details, let's get into how to use the indicator and some examples.
So the indicator is plotting the range and candle for the next day. As such, we are not looking at the current candle being plotted, but we are looking at the previous candle (see image below for example):
The green arrow shows the prediction for Friday, along with the corresponding result. The purple arrow shows the prediction for Monday which we have yet to realize.
So remember when you are using this, you need to look at the previous candle, and not the candle that it is currently plotting with realtime data, because it is plotting for the next candle.
If you are plotting by last instance, the indicator will tell you which day it is pulling its data from if you have opted to toggle on the demographic data:
You can see the green arrow pointing to the date where it is pulling from. This data serves as the example candle with the candle proceeding this date being the anchored candle (or the predicted candle).
Price Targets and Probability:
In the chart, you can see the green arrow pointing to the green portion of the table. In this table, it will give you the current TPs. These represent the current time target price, which means, the TPs shown here are for Friday. On Monday, the table will update with the TPs for Monday, etc. If you want to view the TPs in advance, you can view them from the actual candle itself.
Below the TPs, you see a bullish 7:6. It means, in a total of 13 cases, the next candle was bullish 7 times and bearish 6 times. Where do we see the number of cases? In the demographic table as well:
Auxiliary functions
Because you are using the previous candle, if you want to avoid confusion, you can have the indicator plot the price targets over the predicted candle, to anchor your attention so to speak. Simply select "Label" in the "Show Price Targets" section, which will look like this:
You can also ask the indicator to plot the demographic data of Higher High, Low, etc. information. What this does is simply looks at all the cases and plots how many times higher highs, lows, lower lows, highs etc. were made:
This will just count all of the cases identified and plot the number of times higher highs, lows, etc. were made.
Concluding Remarks
This is a kind of complex indicator and I can appreciate it may take some getting used to.
I will try to post a tutorial video at some point next week for it, so stay tuned for that.
But this isn't designed to make your life more complicated, just to help give you insights into potential outcomes for the next day or hour or 5 minute (it can be used on all timeframes).
If you find it helpful, great! If not, that's okay, too :-).
Please be aware, this is not my forte of indicators. I am not a data scientist or programmer. My background is in Epi and we don't use these types of data science approaches, so if you have any suggestions or critiques, feel free to share them below.
Otherwise, I hope you enjoy!
Take care everyone and safe trades!
Bullish vs. Bearish Candle CounterFollowing an exhaustive analysis of the most recent 50,000 candles within a given currency pair, a notable equilibrium between bearish and bullish candles has emerged as a persistent market phenomenon. This equilibrium, indicative of the market's continuous endeavor to establish parity, has spurred the development of the following indicator.
The indicator meticulously scrutinizes the preceding 100 candles, promptly triggering an on-chart marker when either bullish or bearish candle counts surpass the threshold of 60%. This marker serves as an invaluable tool, providing traders with a potential signal for the initiation of a trend reversal.
As such, this indicator serves as a valuable asset in a trader's toolkit, offering insights into shifts in market sentiment and the prospect of emerging trends.
Key Features:
- Customizable Candle Count: Traders can set the number of candlesticks to be analyzed in the input parameters, allowing flexibility in their analysis.
- Bullish and Bearish Percentage: Users can define their desired percentage for both bullish and bearish candles in the indicator's settings. The indicator calculates the percentage of each candle type within the specified range.
- Arrow Signals: The indicator plots arrows above or below the current candle, indicating bullish or bearish conditions based on the defined percentage thresholds. A green arrow signifies bullish sentiment, while a red arrow denotes bearish sentiment.
How to Use:
- Adjust Parameters: In the indicator settings, users can customize the number of candlesticks to be analyzed, as well as set their preferred percentages for both bullish and bearish conditions.
- Interpret Arrows: The indicator generates arrows above or below the current candle, reflecting the prevailing market sentiment. A green arrow suggests a bullish bias, while a red arrow indicates a bearish bias.
- Trade with Confidence: Traders can use this indicator as a tool to gauge market sentiment and make informed trading decisions. It helps identify potential entry and exit points based on the chosen percentage thresholds.
MAutoFloorCeiling* MAutoFloorCeiling Indicator *
The MAutoFloorCeiling indicator is a powerful algorithm utilizing Wyckoffian concepts of Supply, Demand, and Volume Climaxes to determine and draw Support / Resistance levels automatically. It is the culmination of over 2 years of research. Drawing Support / Resistance lines automatically is a tremendous benefit to the trader as this provides structure to price and exposes market movement as well as which areas price is likely to respect or break out of.
* WHAT THE SCRIPT DOES *
The MAutoFloorCeiling algorithm draws Floor and Ceiling lines automatically. The price points at which these lines are drawn at are areas of increasing Supply, Demand, or Volume Climax respective to their Price Levels. Areas of Volume Climaxes are often respected by price, since price tends to return to them or break out of them, and hence form powerful Support / Resistance levels.
* HOW TO USE IT *
Floor and Ceiling lines correspond to Support and Resistance lines. When a line is draw consider the following questions
Is it a top / bottom?
Is it support / resistance?
Is it a breakout / breakdown?
Is it a pullback?
* HOW IT WORKS *
1. There are 2 types of lines: Floors and Ceilings
2. A Floor Line is drawn when there is a "Selling Volume Bias" (Volume Climaxes on downward price movement)
More Floor Lines get drawn if market continues to go lower combined with a "Selling Volume Bias"
3. A ceiling line is drawn when there is a "Buying Volume Bias" (Volume Climaxes on upward price movement)
More ceiling lines get drawn if market continues to go higher combined with a "Buying Volume Bias"
4. There is a 1 bar delay to confirm the creation of a new floor / ceiling line.
Once the new floor / ceiling is created, it draws forward with no delay.
* EXAMPLE AND USE CASES *
MAutoFloorCeiling draws lines that can be used as effective Support / Resistance Levels, Breakout Lines, and Pullback areas. Studying the Volume at these levels can provide insight as to where price is likely to go.
You can scan for Trend Like behavior such as
More Demand on Higher High = Increase in Volume on a Higher Ceiling
More Supply on Lower Low = Increase in Volume on a Lower Floor
You can scan for divergences such as
Less Demand on Higher High = Lower volume on a Higher Ceiling
Less Supply on on Lower Low = Lower volume on a Lower Floor
Pullbacks
A lower ceiling is representative of a pullback when price is going down.
A higher floor is representative of a pullback when price is going up.
You can inspect instances where the thrust of price is shortened, which means the distance between Ceiling or Floor lines becomes less as price struggles to continue in the direction it was moving. Or conversely the thrust of price as shown by the Floor / Ceiling lines can expand, which is indicative of a trend forming.
* AUTHOR *
This script is published by MBoxWave LLC
Multiperiod Volume Pressure Indicator
Description:
The Volume Pressure Indicator is a powerful tool designed to assess market sentiment based on a combination of price and volume data. By analyzing buy and sell pressure within specific lookback periods, this indicator provides valuable insights into the intensity of market buying and selling activities. Traders can use this information to make informed decisions, especially during periods of price consolidation or trend reversal.
Key Features:
- **Multi-Period Analysis:** Utilizes multiple lookback periods (1, 2, and 4) to calculate buy and sell pressures, offering a nuanced view of market dynamics over different timeframes.
- **Pressure Calculation:** Computes buy and sell pressures based on price range and closing values, providing a comprehensive understanding of market participant behavior.
- **Color-Coded Bars:** Visualizes market sentiment by coloring bars according to the number of positive (buy pressure > sell pressure) periods observed within the specified lookback periods.
How to Use:
- **Color Coding:** Green bars represent periods where buy pressure dominates, indicating potential buying interest. Yellow bars suggest a balance between buy and sell pressures. Red bars signal periods dominated by sell pressure, indicating potential selling interest.
- **Lookback Periods:** Shorter lookback periods (e.g., 1) offer insights into immediate market sentiment, while longer periods (e.g., 4) provide a broader perspective. Analyzing multiple periods can help traders confirm trends and anticipate reversals.
Customization:
- **Lookback Periods:** Adjust the length of the lookback periods (1, 2, and 4) to match your trading style and timeframe preferences.
Disclaimer:
Trading involves risk, and past performance is not indicative of future results. Always conduct thorough analysis and apply proper risk management techniques before making trading decisions.
Usage Scenarios:
- **Trend Confirmation:** Use the indicator to confirm the strength of an ongoing trend. Consistent green bars can validate a bullish trend, while red bars may confirm a bearish trend.
- **Reversal Signals:** Look for transitions in bar colors to identify potential trend reversals. A shift from green to yellow/red or vice versa can indicate changing market sentiment.
- **Divergence Analysis:** Compare price movements with the indicator's bar colors. Divergence between price trends and bar colors may signal upcoming price movements.
Machine Learning using Neural Networks | EducationalThe script provided is a comprehensive illustration of how to implement and execute a simplistic Neural Network (NN) on TradingView using PineScript.
It encompasses the entire workflow from data input, weight initialization, implicit neuron calculation, feedforward computation, backpropagation for weight adjustments, generating predictions, to visualizing the Mean Squared Error (MSE) Loss Curve for monitoring the training phase.
In the visual example above, you can see that the prediction is not aligned with the actual value. This is intentional for demonstrative purposes, and by incrementing the Epochs or Learning Rate, you will see these two values converge as the accuracy increases.
Hyperparameters:
Learning Rate, Epochs, and the choice between Simple Backpropagation and a verbose version are declared as script inputs, allowing users to tailor the training process.
Initialization:
Random initialization of weight matrices (w1, w2) is performed to ensure asymmetry, promoting effective gradient updates. A seed is added for reproducibility.
Utility Functions:
Functions for matrix randomization, sigmoid activation, MSE loss calculation, data normalization, and standardization are defined to streamline the computation process.
Neural Network Computation:
The feedforward function computes the hidden and output layer values given the input.
Two variants of the backpropagation function are provided for weight adjustment, with one offering a more verbose step-by-step computation of gradients.
A wrapper train_nn function iterates through epochs, performing feedforward, loss computation, and backpropagation in each epoch while logging and collecting loss values.
Training Invocation:
The input data is prepared by normalizing it to a value between 0 and 1 using the maximum standardized value, and the training process is invoked only on the last confirmed bar to preserve computational resources.
Output Forecasting and Visualization:
Post training, the NN's output (predicted price) is computed, standardized and visualized alongside the actual price on the chart.
The MSE loss between the predicted and actual prices is visualized, providing insight into the prediction accuracy.
Optionally, the MSE Loss Curve is plotted on the chart, illustrating the loss trajectory through epochs, assisting in understanding the training performance.
Customizable Visualization:
Various inputs control visualization aspects like Chart Scaling, Chart Horizontal Offset, and Chart Vertical Offset, allowing users to adapt the visualization to their preference.
-------------------------------------------------------
The following is this Neural Network structure, consisting of one hidden layer, with two hidden neurons.
Through understanding the steps outlined in my code, one should be able to scale the NN in any way they like, such as changing the input / output data and layers to fit their strategy ideas.
Additionally, one could forgo the backpropagation function, and load their own trained weights into the w1 and w2 matrices, to have this code run purely for inference.
-------------------------------------------------------
While this demonstration does create a “prediction”, it is on historical data. The purpose here is educational, rather than providing a ready tool for non-programmer consumers.
Normally in Machine Learning projects, the training process would be split into two segments, the Training and the Validation parts. For the purpose of conveying the core concept in a concise and non-repetitive way, I have foregone the Validation part. However, it is merely the application of your trained network on new data (feedforward), and monitoring the loss curve.
Essentially, checking the accuracy on “unseen” data, while training it on “seen” data.
-------------------------------------------------------
I hope that this code will help developers create interesting machine learning applications within the Tradingview ecosystem.
@tk · spectral█ OVERVIEW
This script is an indicator that helps traders to identify the price difference between spot and futures of the current crypto plotted into the chart. It works in both types of markets, when the chart is plotting the crypto in spot market, it will compare with its respective futures ticker and vice-versa. If the current asset isn't a crypt ticker, the indicator will not be plotted into the chart.
█ MOTIVATION
Since crypto's derivative market is based on spot market asset's price, to calculate the arbitrage mechanisms that attempts to balance the asset price, this indicator can help traders to identify some spot and futures price divergence that can create an anomaly of funding rate and can push it to an extreme negative — or positive — rate. So, easing to track the price difference between both markets will bring more evidences to identify an artificial price move, specially in crypto assets with low market cap.
█ CONCEPT
The trading concept to use this indicator is the concept of the arbitrage machamism created by exchanges that calculates the funding rate based on spot and futures price difference that will vary from exchange to exchange. This strategy don't works alone. It needs to be aligned together with others indicators like Exponential Moving Averages, Chart Patterns, Support and Resistance, and so on... Even more confluences that you have, bigger are your chances to increase the probability for a successful trade. So, don't use this indicator alone. Compose a trading strategy and use it to improve your analysis.
█ CUSTOMIZATION
This indicator allows the trader to customize the following settings:
GENERAL
Text size
Changes the font size of price difference table to improve accessibility.
Type: string
Options: `tiny`, `small`, `normal`, `large`.
Default: `small`
Position
Changes the position of price difference table.
Type: string
Options: `top_left`, `top_center`, `top_right`, `middle_left`, `middle_center`, `middle_right`, `bottom_left`, `bottom_center`, `bottom_right`.
Default: `bottom_right`
Pair Quote
The ticker quote symbol that will be used to base the ticker comparison from spot to futures (e.g. BTCUSDT which `USDT` is the quote. ETHBTC which `BTC` is the quote).
Type: string
Default: USDT
Spectrum Color
The color of the spectrum candles. Spectrum candles are the candles of the opposite market. If the current ticker is in the spot market, the spectrum candles will be the price of the futures market.
Type: color
Default: #434651
█ FUNCTIONS
The indicator contains the following functions:
stripStarts(src, str)
Strips a defined pattern from a string.
Parameters:
src: (string) Source string
str: (string) String pattern to be stripped from start of source string.
Returns: (string) Stripped string with matched regex pattern.
Golden Level Predictions v1.0Golden Level Predictions (GLP) Trading Indicator
This script introduces a custom trading indicator named "GLP" tailored for the TradingView platform. It offers various price levels derived from Fibonacci calculations and other mathematical models, assisting traders in pinpointing potential overpriced and discounted price levels.
Key Features:
User Inputs : Users have the flexibility to select their desired timeframe, with options ranging from Weekly, Daily, Monthly, and more. Additionally, they can opt to showcase Fibonacci lines and the associated prices within these levels.
Price Level Calculations :
- Employs constants such as the Golden Ratio (PHI) and Pi (PI) to extract various multipliers and factors.
- Assesses if the current asset is a cryptocurrency and tweaks calculations accordingly.
- Determines overpriced and discounted price levels, drawing from the current open price and past data.
Fibonacci Levels :
- For each overpriced and discounted level, the script computes intermediary Fibonacci levels, including 23.6%, 38.2%, 50%, 61.8%, and 78.6% (the 3rd level is excluded due to plot limitations).
- These levels are illustrated on the chart, granting traders a more detailed view of price targets.
Visual Elements :
- Projects horizontal lines to the subsequent selected indicator interval for every calculated price level.
- Exhibits potential percentage gains or losses at each tier, indicating the prospective price alteration upon reaching that level.
- Differentiates overpriced (green) and discounted (red) levels using color codes. A neutral price is depicted in yellow.
Anticipated Close Calculation : Offers a projected closing price for the current timeframe, based on a myriad of factors.
This indicator is particularly effective with cryptocurrencies due to their inherent volatility. It's also compatible with stocks and is most efficient with tickers that provide volume data.
Highlight BarHighlight bars in the past. I use this to show the start of moving average calculations - very helpful to anticipate the change in slope of moving averages. You can change color as well as how far back in time to highlight. The defaults are 20, 50 and 200.
I learned of the idea from Brian Shannon - thanks!
Machine Learning: Donchian DCA Grid Strategy [YinYangAlgorithms]This strategy uses a Machine Learning approach on the Donchian Channels with a DCA and Grid purchase/sell Strategy. Not only that, but it uses a custom Bollinger calculation to determine its Basis which is used as a mild sell location. This strategy is a pure DCA strategy in the sense that no shorts are used and theoretically it can be used in webhooks on most exchanges as it’s only using Spot Orders. The idea behind this strategy is we utilize both the Highest Highs and Lowest Lows within a Machine Learning standpoint to create Buy and Sell zones. We then fraction these zones off into pieces to create Grids. This allows us to ‘micro’ purchase as it enters these zones and likewise ‘micro’ sell as it goes up into the upper (sell) zones.
You have the option to set how many grids are used, by default we use 100 with max 1000. These grids can be ‘stacked’ together if a single bar is to go through multiple at the same time. For instance, if a bar goes through 30 grids in one bar, it will have a buy/sell power of 30x. Stacking Grid Buy and (sometimes) Sells is a very crucial part of this strategy that allows it to purchase multitudes during crashes and capitalize on sales during massive pumps.
With the grids, you’ll notice there is a middle line within the upper and lower part that makes the grid. As a Purchase Type within our Settings this is identified as ‘Middle of Zone Purchase Amount In USDT’. The middle of the grid may act as the strongest grid location (aside from maybe the bottom). Therefore there is a specific purchase amount for this Grid location.
This DCA Strategy also features two other purchase methods. Most importantly is its ‘Purchase More’ type. Essentially it will attempt to purchase when the Highest High or Lowest Low moves outside of the Outer band. For instance, the Lowest Low becomes Lower or the Higher High becomes Higher. When this happens may be a good time to buy as it is featuring a new High or Low over an extended period.
The last but not least Purchase type within this Strategy is what we call a ‘Strong Buy’. The reason for this is its verified by the following:
The outer bounds have been pushed (what causes a ‘Purchase More’)
The Price has crossed over the EMA 21
It has been verified through MACD, RSI or MACD Historical (Delta) using Regular and Hidden Divergence (Note, only 1 of these verifications is required and it can be any).
By default we don’t have Purchase Amount for ‘Strong Buy’ set, but that doesn’t mean it can’t be viable, it simply means we have only seen a few pairs where it actually proved more profitable allocating money there rather than just increasing the purchase amount for ‘Purchase More’ or ‘Grids’.
Now that you understand where we BUY, we should discuss when we SELL.
This Strategy features 3 crucial sell locations, and we will discuss each individually as they are very important.
1. ‘Sell Some At’: Here there are 4 different options, by default its set to ‘Both’ but you can change it around if you want. Your options are:
‘Both’ - You will sell some at both locations. The amount sold is the % used at ‘Sell Some %’.
‘Basis Line’ - You will sell some when the price crosses over the Basis Line. The amount sold is the % used at ‘Sell Some %’.
‘Percent’ - You will sell some when the Close is >= X% between the Lower Inner and Upper Inner Zone.
‘None’ - This simply means don’t ever Sell Some.
2. Sell Grids. Sell Grids are exactly like purchase grids and feature the same amount of grids. You also have the ability to ‘Stack Grid Sells’, which basically means if a bar moves multiple grids, it will stack the amount % wise you will sell, rather than just selling the default amount. Sell Grids use a DCA logic but for selling, which we deem may help adjust risk/reward ratio for selling, especially if there is slow but consistent bullish movement. It causes these grids to constantly push up and therefore when the close is greater than them, accrue more profit.
3. Take Profit. Take profit occurs when the close first goes above the Take Profit location (Teal Line) and then Closes below it. When Take Profit occurs, ALL POSITIONS WILL BE SOLD. What may happen is the price enters the Sell Grid, doesn’t go all the way to the top ‘Exiting it’ and then crashes back down and closes below the Take Profit. Take Profit is a strong location which generally represents a strong profit location, and that a strong momentum has changed which may cause the price to revert back to the buy grid zone.
Keep in mind, if you have (by default) ‘Only Sell If Profit’ toggled, all sell locations will only create sell orders when it is profitable to do so. Just cause it may be a good time to sell, doesn’t mean based on your DCA it is. In our opinion, only selling when it is profitable to do so is a key part of the DCA purchase strategy.
You likewise have the ability to ‘Only Buy If Lower than DCA’, which is likewise by default. These two help keep the Yin and Yang by balancing each other out where you’re only purchasing and selling when it makes logical sense too, even if that involves ignoring a signal and waiting for a better opportunity.
Tutorial:
Like most of our Strategies, we try to capitalize on lower Time Frames, generally the 15 minutes so we may find optimal entry and exit locations while still maintaining a strong correlation to trend patterns.
First off, let’s discuss examples of how this Strategy works prior to applying Machine Learning (enabled by default).
In this example above we have disabled the showing of ‘Potential Buy and Sell Signals’ so as to declutter the example. In here you can see where actual trades had gone through for both buying and selling and get an idea of how the strategy works. We also have disabled Machine Learning for this example so you can see the hard lines created by the Donchian Channel. You can also see how the Basis line ‘white line’ may act as a good location to ‘Sell Some’ and that it moves quite irregularly compared to the Donchian Channel. This is due to the fact that it is based on two custom Bollinger Bands to create the basis line.
Here we zoomed out even further and moved back a bit to where there were dense clusters of buy and sell orders. Sometimes when the price is rather volatile you’ll see it ‘Ping Pong’ back and forth between the buy and sell zones quite quickly. This may be very good for your trades and profit as a whole, especially if ‘Only Buy If Lower Than DCA’ and ‘Only Sell If Profit’ are both enabled; as these toggles will ensure you are:
Always lowering your Average when buying
Always making profit when selling
By default 8% commission is added to the Strategy as well, to simulate the cost effects of if these trades were taking place on an actual exchange.
In this example we also turned on the visuals for our ‘Purchase More’ (orange line) and ‘Take Profit’ (teal line) locations. These are crucial locations. The Purchase More makes purchases when the bottom of the grid has been moved (may dictate strong price movement has occurred and may be potential for correction). Our Take Profit may help secure profit when a momentum change is happening and all of the Sell Grids weren’t able to be used.
In the example above we’ve enabled Buy and Sell Signals so that you can see where the Take Profit and Purchase More signals have occurred. The white circle demonstrates that not all of the Position Size was sold within the Sell Grids, and therefore it was ALL CLOSED when the price closed below the Take Profit Line (Teal).
Then, when the bottom of the Donchian Channel was pushed further down due to the close (within the yellow circle), a Purchase More Signal was triggered.
When the close keeps pushing the bottom of the Buy Grid lower, it can cause multiple Purchase More Signals to occur. This is normal and also a crucial part of this strategy to help lower your DCA. Please note, the Purchase More won’t trigger a Buy if the Close is greater than the DCA and you have ‘Only Purchase If Lower Than DCA’ activated.
By turning on Machine Learning (default settings) the Buy and Sell Grid Zones are smoothed out more. It may cause it to look quite a bit different. Machine Learning although it looks much worse, may help increase the profit this Strategy can produce. Previous results DO NOT mean future results, but in this example, prior to turning on Machine Learning it had produced 37% Profit in ~5 months and with Machine Learning activated it is now up to 57% Profit in ~5 months.
Machine Learning causes the Strategy to focus less on Grids and more on Purchase More when it comes to getting its entries. However, if you likewise attempt to focus on Purchase More within non Machine Learning, the locations are different and therefore the results may not be as profitable.
PLEASE NOTE:
By default this strategy uses 1,000,000 as its initial capital. The amount it purchases in its Settings is relevant to this Initial capital. Considering this is a DCA Strategy, we only want to ‘Micro’ Buy and ‘Micro’ Sell whenever conditions are met.
Therefore, if you increase the Initial Capital, you’ll likewise want to increase the Purchase Amounts within the Settings and Vice Versa. For instance, if you wish to set the Initial Capital to 10,000, you should likewise can the amounts in the Settings to 1% of what they are to account for this.
We may change the Purchase Amounts to be based on %’s in a later update if it is requested.
We will conclude this Tutorial here, hopefully you can see how a DCA Grid Purchase Model applied to Machine Learning Donchian Channels may be useful for making strategic purchases in low and high zones.
Settings:
Display Data:
Show Potential Buy Locations: These locations are where 'Potentially' orders can be placed. Placement of orders is dependant on if you have 'Only Buy If Lower Than DCA' toggled and the Price is lower than DCA. It also is effected by if you actually have any money left to purchase with; you can't buy if you have no money left!
Show Potential Sell Locations: These locations are where 'Potentially' orders will be sold. If 'Only Sell If Profit' is toggled, the sell will only happen if you'll make profit from it!
Show Grid Locations: Displaying won't affect your trades but it can be useful to see where trades will be placed, as well as which have gone through and which are left to be purchased. Max 100 Grids, but visuals will only be shown if its 20 or less.
Purchase Settings:
Only Buy if its lower than DCA: Generally speaking, we want to lower our Average, and therefore it makes sense to only buy when the close is lower than our current DCA and a Purchase Condition is met.
Compound Purchases: Compounding Purchases means reinvesting profit back into your trades right away. It drastically increases profits, but it also increases risk too. It will adjust your Purchase Amounts for the Purchase Type you have set at the same % rate of strategy initial_capital to the amounts you have set.
Adjust Purchase Amount Ratio to Maintain Risk level: By adjusting purchase levels we generally help maintain a safe risk level. Basically we generally want to reserve X amount of % for each purchase type being used and relocate money when there is too much in one type. This helps balance out purchase amounts and ensure the types selected have a correct ratio to ensure they can place the right amount of orders.
Stack Grid Buys: Stacking Buy Grids is when the Close crosses multiple Buy Grids within the same bar. Should we still only purchase the value of 1 Buy Grid OR stack the grid buys based on how many buy grids it went through.
Purchase Type: Where do you want to make Purchases? We recommend lowering your risk by combining All purchase types, but you may also customize your trading strategy however you wish.
Strong Buy Purchase Amount In USDT: How much do you want to purchase when the 'Strong Buy' signal appears? This signal only occurs after it has at least entered the Buy Zone and there have been other verifications saying it's now a good time to buy. Our Strong Buy Signal is a very strong indicator that a large price movement towards the Sell Zone will likely occur. It almost always results in it leaving the Buy Zone and usually will go to at least the White Basis line where you can 'Sell Some'.
Buy More Purchase Amount In USDT: How much should you purchase when the 'Purchase More' signal appears? This 'Purchase More' signal occurs when the lowest level of the Buy Zone moves lower. This is a great time to buy as you're buying the dip and generally there is a correction that will allow you to 'Sell Some' for some profit.
Amount of Grid Buy and Sells: How many Grid Purchases do you want to make? We recommend having it at the max of 10, as it will essentially get you a better Average Purchase Price, but you may adjust it to whatever you wish. This amount also only matters if your Purchase Type above incorporates Grid Purchases. Max 100 Grids, but visuals will only be shown if it's 20 or less.
Each Grid Purchase Amount In USDT: How much should you purchase after closing under a grid location? Keep in mind, if you have 10 grids and it goes through each, it will be this amount * 10. Grid purchasing is a great way to get a good entry, lower risk and also lower your average.
Middle Of Zone Purchase Amount In USDT: The Middle Of Zone is the strongest grid location within the Buy Zone. This is why we have a unique Purchase Amount for this Grid specifically. Please note you need to have 'Middle of Zone is a Grid' enabled for this Purchase Amount to be used.
Sell:
Only Sell if its Profit: There is a chance that during a dump, all your grid buys when through, and a few Purchase More Signals have appeared. You likely got a good entry. A Strong Buy may also appear before it starts to pump to the Sell Zone. The issue that may occur is your Average Purchase Price is greater than the 'Sell Some' price and/or the Grids in the Sell Zone and/or the Strong Sell Signal. When this happens, you can either take a loss and sell it, or you can hold on to it and wait for more purchase signals to therefore lower your average more so you can take profit at the next sell location. Please backtest this yourself within our YinYang Purchase Strategy on the pair and timeframe you are wanting to trade on. Please also note, that previous results will not always reflect future results. Please assess the risk yourself. Don't trade what you can't afford to lose. Sometimes it is better to strategically take a loss and continue on making profit than to stay in a bad trade for a long period of time.
Stack Grid Sells: Stacking Sell Grids is when the Close crosses multiple Sell Grids within the same bar. Should we still only sell the value of 1 Sell Grid OR stack the grid sells based on how many sell grids it went through.
Stop Loss Type: This is when the Close has pushed the Bottom of the Buy Grid More. Do we Stop Loss or Purchase More?? By default we recommend you stay true to the DCA part of this strategy by Purchasing More, but this is up to you.
Sell Some At: Where if selected should we 'Sell Some', this may be an important way to sell a little bit at a good time before the price may correct. Also, we don't want to sell too much incase it doesn't correct though, so its a 'Sell Some' location. Basis Line refers to our Moving Basis Line created from 2 Bollinger Bands and Percent refers to a Percent difference between the Lower Inner and Upper Inner bands.
Sell Some At Percent Amount: This refers to how much % between the Lower Inner and Upper Inner bands we should well at if we chose to 'Sell Some'.
Sell Some Min %: This refers to the Minimum amount between the Lower Inner band and Close that qualifies a 'Sell Some'. This acts as a failsafe so we don't 'Sell Some' for too little.
Sell % At Strong Sell Signal: How much do we sell at the 'Strong Sell' Signal? It may act as a strong location to sell, but likewise Grid Sells could be better.
Grid and Donchian Settings:
Donchian Channel Length: How far back are we looking back to determine our Donchian Channel.
Extra Outer Buy Width %: How much extra should we push the Outer Buy (Low) Width by?
Extra Inner Buy Width %: How much extra should we push the Inner Buy (Low) Width by?
Extra Inner Sell Width %: How much extra should we push the Inner Sell (High) Width by?
Extra Outer Sell Width %: How much extra should we push the Outer Sell (High) Width by?
Machine Learning:
Rationalized Source Type: Donchians usually use High/Low. What Source is our Rationalized Source using?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Seasonality and Presidential cycleAn incredibly useful indicator that shows seasonality and presidential cycles by indices, stocks and industries. Just type in a ticker and trade according to seasonal patterns
Blue line - seasonality excluding presidential cycles
Green line - seasonality taking into account presidential cycles
*Seasonal patterns over the last 10 years
This indicator uses the request.seed() function.
Requests data from a GitHub repository maintained by our team and returns it as a series.
Pine Seeds is a service to import custom data and access it via TradingView.
Use TradingView as frontend and use a GitHub repository as backend.
github.com
...
Rus: Невероятно полезный индикатор, который показывает сезонность и президентские циклы по индексам, акциям и отраслям. Просто вбейте тикер и торгуйте согласно сезонным паттернам
Синяя линия - сезонность без учета президентских циклов
Зеленая линия - сезонность с учетом президентских циклов
*Сезонные паттерны за последние 10 лет
Machine Learning: Gaussian Process Regression [LuxAlgo]We provide an implementation of the Gaussian Process Regression (GPR), a popular machine-learning method capable of estimating underlying trends in prices as well as forecasting them.
While this implementation is adapted to real-time usage, do remember that forecasting trends in the market is challenging, do not use this tool as a standalone for your trading decisions.
🔶 USAGE
The main goal of our implementation of GPR is to forecast trends. The method is applied to a subset of the most recent prices, with the Training Window determining the size of this subset.
Two user settings controlling the trend estimate are available, Smooth and Sigma . Smooth determines the smoothness of our estimate, with higher values returning smoother results suitable for longer-term trend estimates.
Sigma controls the amplitude of the forecast, with values closer to 0 returning results with a higher amplitude. Do note that due to the calculation of the method, lower values of sigma can return errors with higher values of the training window.
🔹 Updating Mechanisms
The script includes three methods to update a forecast. By default a forecast will not update for new bars (Lock Forecast).
The forecast can be re-estimated once the price reaches the end of the forecasting window when using the "Update Once Reached" method.
Finally "Continuously Update" will update the whole forecast on any new bar.
🔹 Estimating Trends
Gaussian Process Regression can be used to estimate past underlying local trends in the price, allowing for a noise-free interpretation of trends.
This can be useful for performing descriptive analysis, such as highlighting patterns more easily.
🔶 SETTINGS
Training Window: Number of most recent price observations used to fit the model
Forecasting Length: Forecasting horizon, determines how many bars in the future are forecasted.
Smooth: Controls the degree of smoothness of the model fit.
Sigma: Noise variance. Controls the amplitude of the forecast, lower values will make it more sensitive to outliers.
Update: Determines when the forecast is updated, by default the forecast is not updated for new bars.
Rug Pull DetectorOverview
Have you ever wondered why tickers have such erratic movements that seemingly come from nowhere? These "rug pull" events happen quite often and can catch even the most seasoned traders off-guard.
Unlike most other indicators which rely on historical data to make inferences about future price movements, the Rug Pull Detector (RPD) enables you to take a glimpse into market makers' delta-neutral hedging in real-time.
Market makers by nature must be delta-neutral which means that they cannot position themselves to profit from providing liquidity (either long or short). Liquidity provided to the short or long side must end up in a stock purchase or sale to neutralize the trade.
Volatile movements in a ticker's price movement most often result directly after a period of extremely low volatility. These volatile movements are very often "rug pulled" which ends up reverting the ticker back to the price at which the event first occurred. RPD shows these events in real-time. This knowledge can be used to help determine the most probable near-future direction a ticker will gravitate towards after a rug pull event occurs.
Usage
RPD works on any ticker and on any timeframe and can be used as a tool in determining an exit price for a trade. Vertical shading on the chart indicates a warning signal that a rug pull event may be about to kick-off. Once a rug pull event has occurred and is confirmed, a blue label will appear on the chart with a price. A line is then drawn from the bar at which the event occurred and is extended to each subsequent bar until the price is reached once more; thus concluding the event. Furthermore, red or green shading will be present to easily visually identify rug pull events on the chart and whether they are risks to the downside (red) or upside (green). RPD is broken down into 2 main types of events:
Active Event - These events are characterized by a red or green shading and a blue price line.
Dormant Event - These events do not have shading but are still identifiable via a blue price line. Active events that are superseded by newer events will become dormant.
Active events tend to have a higher chance to return to the initial price point and tend to arrive there quicker.
Dormant events have a slightly lower chance to return to the initial price point and may take longer to arrive there.
Please note:
This indicator has no way of telling the exact amount of time that will pass before the ticker returns to the identified price; however, in more cases than not - the ticker will return to that price within a reasonable amount of time relative to the timeframe you are viewing.
There is a small chance any single event will never conclude. These are anomalies and do occur on occasion.
Using RPD alongside tools such as the RSI, Anchored VWAP, or other trend-based indicators will help determine when the ticker's price might be about to pivot and head back towards the identified price point.
Seeing is Believing:
SPY 1D downside rug-pull
----------------------------------------------
AAPL 15s downside and upside rug-pulls
----------------------------------------------
AMD 2D downside rug-pull
----------------------------------------------
VIX 1h downside and upside rug-pulls
Want to see more? Check out my recent Ideas for more examples of the Rug Pull Detector in action.
Disclaimer:
Any information in relation to the Rug Pull Detector does not constitute any financial, investment, or trading advice. Trade or invest at your own risk.
Intraday Volatility Bands [Honestcowboy]The Intraday Volatility Bands aims to provide a better alternative to ATR in the calculation of targets or reversal points.
How are they different from ATR based bands?
While ATR and other measures of volatility base their calculations on the previous bars on the chart (for example bars 1954 to 1968). The volatility used in these bands measure expected volatility during that time of the day.
Why would you take this approach?
Markets behave different during certain times of the day, also called sessions.
Here are a couple examples.
Asian Session (generally low volatility)
London Session (bigger volatility starts)
New York Session (overlap of New York with London creates huge volatility)
Generally when using bands or channel type indicators intraday they do not account for the upcoming sessions. On London open price will quickly spike through a bollinger band and it will take some time for the bands to adjust to new volatility.
This script will show expected volatility targets at the start of each new bar and will not adjust during the bar. It already knows what price is expected to do at this time of day.
Script also plots arrows when price breaches either the top or bottom of the bands. You can also set alerts for when this occurs. These are non repainting as the script knows the level at start of the bar and does not change.
🔷 CALCULATION
Think of this script like an ATR but instead it uses past days data instead of previous bars data. Charts below should visualise this more clearly:
The scripts measure of volatility is based on a simple high-low.
The script also counts the number of bars that exist in a day on your current timeframe chart. After knowing that number it creates the matrix used in it's calculations and data storage.
See how it works perfectly on a lower timeframe chart below:
Getting this right was the hardest part, check the coding if you are interested in this type of stuff. I commented every step in the coding process.
🔷 SETTINGS
Every setting of the script has a tooltip but I provided a breakdown here:
Some more examples of different charts:
Machine Learning: Trend Lines [YinYangAlgorithms]Trend lines have always been a key indicator that may help predict many different types of price movements. They have been well known to create different types of formations such as: Pennants, Channels, Flags and Wedges. The type of formation they create is based on how the formation was created and the angle it was created. For instance, if there was a strong price increase and then there is a Wedge where both end points meet, this is considered a Bull Pennant. The formations Trend Lines create may be powerful tools that can help predict current Support and Resistance and also Future Momentum changes. However, not all Trend Lines will create formations, and alone they may stand as strong Support and Resistance locations on the Vertical.
The purpose of this Indicator is to apply Machine Learning logic to a Traditional Trend Line Calculation, and therefore allowing a new approach to a modern indicator of high usage. The results of such are quite interesting and goes to show the impacts a simple KNN Machine Learning model can have on Traditional Indicators.
Tutorial:
There are a few different settings within this Indicator. Many will greatly impact the results and if any are changed, lots will need ‘Fine Tuning’. So let's discuss the main toggles that have great effects and what they do before discussing the lengths. Currently in this example above we have the Indicator at its Default Settings. In this example, you can see how the Trend Lines act as key Support and Resistance locations. Due note, Support and Resistance are a relative term, as is their color. What starts off as Support or Resistance may change when the price crosses over / under them.
In the example above we have zoomed in and circled locations that exhibited markers of Support and Resistance along the Trend Lines. These Trend Lines are all created using the Default Settings. As you can see from the example above; just because it is a Green Upwards Trend Line, doesn’t mean it’s a Support Line. Support and Resistance is always shifting on Trend Lines based on the prices location relative to them.
We won’t go through all the Formations Trend Lines make, but the example above, we can see the Trend Lines formed a Downward Channel. Channels are when there are two parallel downwards Trend Lines that are at a relatively similar angle. This means that they won’t ever meet. What may happen when the price is within these channels, is it may bounce between the upper and lower bounds. These Channels may drive the price upwards or downwards, depending on if it is in an Upwards or Downwards Channel.
If you refer to the example above, you’ll notice that the Trend Lines are formed like traditional Trend Lines. They don’t stem from current Highs and Lows but rather Machine Learning Highs and Lows. More often than not, the Machine Learning approach to Trend Lines cause their start point and angle to be quite different than a Traditional Trend Line. Due to this, it may help predict Support and Resistance locations at are more uncommon and therefore can be quite useful.
In the example above we have turned off the toggle in Settings ‘Use Exponential Data Average’. This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN. By Default it is enabled, but as you can see when it is disabled it may create some pretty strong lasting Trend Lines. This is why we advise you ZOOM OUT AS FAR AS YOU CAN. Trend Lines are only displayed when you’ve zoomed out far enough that their Start Point is visible.
As you can see in this example above, there were 3 major Upward Trend Lines created in 2020 that have had a major impact on Support and Resistance Locations within the last year. Lets zoom in and get a closer look.
We have zoomed in for this example above, and circled some of the major Support and Resistance locations that these Upward Trend Lines may have had a major impact on.
Please note, these Machine Learning Trend Lines aren’t a ‘One Size Fits All’ kind of thing. They are completely customizable within the Settings, so that you can get a tailored experience based on what Pair and Time Frame you are trading on.
When any values are changed within the Settings, you’ll likely need to ‘Fine Tune’ the rest of the settings until your desired result is met. By default the modifiable lengths within the Settings are:
Machine Learning Length: 50
KNN Length:5
Fast ML Data Length: 5
Slow ML Data Length: 30
For example, let's toggle ‘Use Exponential Data Averages’ back on and change ‘Fast ML Data Length’ from 5 to 20 and ‘Slow ML Data Length’ from 30 to 50.
As you can in the example above, all of the lines have changed. Although there are still some strong Support Locations created by the Upwards Trend Lines.
We will conclude our Tutorial here. Hopefully you’ve learned how to use Machine Learning Trend Lines and will be able to now see some more unorthodox Support and Resistance locations on the Vertical.
Settings:
Use Machine Learning Sources: If disabled Traditional Trend line sources (High and Low) will be used rather than Rational Quadratics.
Use KNN Distance Sorting: You can disable this if you wish to not have the Machine Learning Data sorted using KNN. If disabled trend line logic will be Traditional.
Use Exponential Data Average: This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN.
Machine Learning Length: How strong is our Machine Learning Memory? Please note, when this value is too high the data is almost 'too' much and can lead to poor results.
K-Nearest Neighbour (KNN) Length: How many K-Nearest Neighbours are allowed with our Distance Clustering? Please note, too high or too low may lead to poor results.
Fast ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 3/5/7 all seem to work well for Fast.
Slow ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 20 - 50 all seem to work well for Slow.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!