Strategy without indicators v11. General Script Strategy
The objective of this strategy is to open buy or sell orders every new hour based on:
Whether the previous candle closed high (buy) or low (sell).
The presence of tops and bottoms to avoid opening orders at times of possible reversals.
The strategy also allows the user to set a date range (start date and end date) to calculate profit, loss, percentage of gain and percentage of loss only in that period.
2. Initial Settings and Parameters
Start Date and End Date: The start_date and end_date variables define the date range to account for profits and losses. These dates can be adjusted by the user to view results in specific periods.
3. Conditions for Order Entry
At each time change, the script checks the conditions for buying or selling, using the following variables and logic:
Detection of Bullish or Bearish Candle:
bullish_candle: True if the previous candle closed high.
bearish_candle: True if the previous candle closed lower.
Analysis of Tops and Bottoms:
To avoid opening orders close to tops and bottoms, the script uses the function find_top_and_bottom(period), which analyzes the last 500 candles and identifies the highest value (top) and the lowest value (bottom).
The variables current_top and current_bottom store these values.
next_top and next_bottom indicate whether the current candle is close to a top (prevents buying) or a bottom (prevents selling).
4. Opening Orders (Buy and Sell)
At each time change, the script checks the conditions to open buy or sell orders:
Condition for Sell:
The sell order is opened if the previous candle was bullish (bullish_candle) and is not close to a top (not next_top).
If there is an open buy order, it is closed before the new sell order.
Buy Condition:
The buy order is opened if the previous candle was bearish (bearish_candle) and is not near a bottom (not_near_bottom).
If there is an open sell order, it is closed before the new buy order.
5. Calculating Profit and Loss
The profit and loss calculation is only done within the configured date range (start_date and end_date):
Profit and Loss:
total_profit and total_loss accumulate the profit and loss values of all operations during the defined period.
percentage_gain and percentage_loss calculate the percentage of gain and loss in relation to the initial capital.
6. Displaying Results on the Chart
The script displays on the chart, next to the candles, the information on Total Profit, Total Loss, % Gain and % Loss:
Strategy Summary
Setting the Date Range: Allows you to set the period for calculating profit and loss.
Previous Candlestick Analysis: Decide whether to buy or sell based on the previous candlestick.
Preventing Entries at Tops and Bottoms: Avoids buying at tops and selling at bottoms to reduce false signals.
Result Calculation: Accumulates profits, losses and percentages within the configured date range.
Results Display on Chart: Displays the configured statistics directly on the chart, next to the candlesticks.
1. Estratégia Geral do Script
O objetivo dessa estratégia é abrir ordens de compra ou venda a cada nova hora com base em:
Se a vela anterior fechou em alta (compra) ou em baixa (venda).
A presença de topos e fundos para evitar abrir ordens em momentos de possíveis reversões.
A estratégia também permite que o usuário configure um intervalo de datas (data inicial e data final) para calcular o lucro, perda, percentual de ganho e percentual de perda apenas nesse período.
2. Configurações e Parâmetros Iniciais
Data Inicial e Data Final: As variáveis data_inicial e data_final definem o intervalo de datas para contabilizar os lucros e perdas. Essas datas podem ser ajustadas pelo usuário para visualizar resultados em períodos específicos.
3. Condições para Entrada de Ordens
A cada mudança de hora, o script verifica as condições de compra ou venda, usando as seguintes variáveis e lógicas:
Detecção de Vela de Alta ou Baixa:
vela_de_alta: Verdadeiro se a vela anterior fechou em alta.
vela_de_baixa: Verdadeiro se a vela anterior fechou em baixa.
Análise de Topos e Fundos:
Para evitar abrir ordens próximas de topos e fundos, o script utiliza a função find_top_and_bottom(periodo), que analisa as últimas 500 velas e identifica o valor mais alto (topo) e o valor mais baixo (fundo).
As variáveis topo_atual e fundo_atual armazenam esses valores.
topo_proximo e fundo_proximo indicam se a vela atual está perto de um topo (evita compra) ou de um fundo (evita venda).
4. Abertura de Ordens (Compra e Venda)
A cada mudança de hora, o script verifica as condições para abrir ordens de compra ou venda:
Condição para Venda:
A ordem de venda é aberta se a vela anterior foi de alta (vela_de_alta) e não está perto de um topo (not topo_proximo).
Se houver uma ordem de compra aberta, ela é fechada antes da nova ordem de venda.
Condição para Compra:
A ordem de compra é aberta se a vela anterior foi de baixa (vela_de_baixa) e não está perto de um fundo (not fundo_proximo).
Se houver uma ordem de venda aberta, ela é fechada antes da nova ordem de compra.
5. Cálculo de Lucros e Perdas
O cálculo de lucro e perda só é feito dentro do intervalo de datas configurado (data_inicial e data_final):
Lucro e Perda:
lucro_total e perca_total acumulam os valores de lucro e perda de todas as operações durante o período definido.
percentual_ganho e percentual_perca calculam o percentual de ganho e perda em relação ao capital inicial.
6. Exibição dos Resultados no Gráfico
O script exibe no gráfico, próximo das velas, as informações de Lucro Total, Perda Total, % de Ganho e % de Perda:
Resumo da Estratégia
Configuração de Intervalo de Datas: Permite configurar o período para cálculo do lucro e da perda.
Análise de Vela Anterior: Decide se a ordem é de compra ou venda com base na vela anterior.
Prevenção de Entradas em Topos e Fundos: Evita compras em topos e vendas em fundos para reduzir sinais falsos.
Cálculo de Resultados: Acumula lucros, perdas e percentuais dentro do período de datas configurado.
Exibição dos Resultados no Gráfico: Exibe as estatísticas configuradas diretamente no gráfico, próximo das velas.
Forecasting
CCI Threshold StrategyThe CCI Threshold Strategy is a trading approach that utilizes the Commodity Channel Index (CCI) as a momentum indicator to identify potential buy and sell signals in financial markets. The CCI is particularly effective in detecting overbought and oversold conditions, providing traders with insights into possible price reversals. This strategy is designed for use in various financial instruments, including stocks, commodities, and forex, and aims to capitalize on price movements driven by market sentiment.
Commodity Channel Index (CCI)
The CCI was developed by Donald Lambert in the 1980s and is primarily used to measure the deviation of a security's price from its average price over a specified period.
The formula for CCI is as follows:
CCI=(TypicalPrice−SMA)×0.015MeanDeviation
CCI=MeanDeviation(TypicalPrice−SMA)×0.015
where:
Typical Price = (High + Low + Close) / 3
SMA = Simple Moving Average of the Typical Price
Mean Deviation = Average of the absolute deviations from the SMA
The CCI oscillates around a zero line, with values above +100 indicating overbought conditions and values below -100 indicating oversold conditions (Lambert, 1980).
Strategy Logic
The CCI Threshold Strategy operates on the following principles:
Input Parameters:
Lookback Period: The number of periods used to calculate the CCI. A common choice is 9, as it balances responsiveness and noise.
Buy Threshold: Typically set at -90, indicating a potential oversold condition where a price reversal is likely.
Stop Loss and Take Profit: The strategy allows for risk management through customizable stop loss and take profit points.
Entry Conditions:
A long position is initiated when the CCI falls below the buy threshold of -90, indicating potential oversold levels. This condition suggests that the asset may be undervalued and due for a price increase.
Exit Conditions:
The long position is closed when the closing price exceeds the highest price of the previous day, indicating a bullish reversal. Additionally, if the stop loss or take profit thresholds are hit, the position will be exited accordingly.
Risk Management:
The strategy incorporates optional stop loss and take profit mechanisms, which can be toggled on or off based on trader preference. This allows for flexibility in risk management, aligning with individual risk tolerances and trading styles.
Benefits of the CCI Threshold Strategy
Flexibility: The CCI Threshold Strategy can be applied across different asset classes, making it versatile for various market conditions.
Objective Signals: The use of quantitative thresholds for entry and exit reduces emotional bias in trading decisions (Tversky & Kahneman, 1974).
Enhanced Risk Management: By allowing traders to set stop loss and take profit levels, the strategy aids in preserving capital and managing risk effectively.
Limitations
Market Noise: The CCI can produce false signals, especially in highly volatile markets, leading to potential losses (Bollinger, 2001).
Lagging Indicator: As a lagging indicator, the CCI may not always capture rapid market movements, resulting in missed opportunities (Pring, 2002).
Conclusion
The CCI Threshold Strategy offers a systematic approach to trading based on well-established momentum principles. By focusing on overbought and oversold conditions, traders can make informed decisions while managing risk effectively. As with any trading strategy, it is crucial to backtest the approach and adapt it to individual trading styles and market conditions.
References
Bollinger, J. (2001). Bollinger on Bollinger Bands. New York: McGraw-Hill.
Lambert, D. (1980). Commodity Channel Index. Technical Analysis of Stocks & Commodities, 2, 3-5.
Pring, M. J. (2002). Technical Analysis Explained. New York: McGraw-Hill.
Tversky, A., & Kahneman, D. (1974). Judgment under uncertainty: Heuristics and biases. Science, 185(4157), 1124-1131.
Dual Momentum StrategyThis Pine Script™ strategy implements the "Dual Momentum" approach developed by Gary Antonacci, as presented in his book Dual Momentum Investing: An Innovative Strategy for Higher Returns with Lower Risk (McGraw Hill Professional, 2014). Dual momentum investing combines relative momentum and absolute momentum to maximize returns while minimizing risk. Relative momentum involves selecting the asset with the highest recent performance between two options (a risky asset and a safe asset), while absolute momentum considers whether the chosen asset has a positive return over a specified lookback period.
In this strategy:
Risky Asset (SPY): Represents a stock index fund, typically more volatile but with higher potential returns.
Safe Asset (TLT): Represents a bond index fund, which generally has lower volatility and acts as a hedge during market downturns.
Monthly Momentum Calculation: The momentum for each asset is calculated based on its price change over the last 12 months. Only assets with a positive momentum (absolute momentum) are considered for investment.
Decision Rules:
Invest in the risky asset if its momentum is positive and greater than that of the safe asset.
If the risky asset’s momentum is negative or lower than the safe asset's, the strategy shifts the allocation to the safe asset.
Scientific Reference
Antonacci's work on dual momentum investing has shown the strategy's ability to outperform traditional buy-and-hold methods while reducing downside risk. This approach has been reviewed and discussed in both academic and investment publications, highlighting its strong risk-adjusted returns (Antonacci, 2014).
Reference: Antonacci, G. (2014). Dual Momentum Investing: An Innovative Strategy for Higher Returns with Lower Risk. McGraw Hill Professional.
MT Enhanced Trend Reversal StrategyThis strategy, called **"Enhanced Trend Reversal Strategy with Take Profit,"** is designed to identify trend reversal points based on several indicators: **Exponential Moving Averages (EMA), MACD**, and **RSI**. The strategy also includes **take-profit levels** to provide traders with suggested profit-taking points.
Key Components of the Strategy
1. **Exponential Moving Averages (EMA)**:
- The strategy uses **20 and 50-period EMAs** to determine trend direction. The shorter period (EMA 20) reacts more quickly to price changes, while the longer period (EMA 50) smooths out fluctuations.
- An **uptrend** (bullish market) is indicated when the EMA 20 is above the EMA 50. In this case, the main trend line is colored green.
- A **downtrend** (bearish market) is indicated when the EMA 20 is below the EMA 50, in which case the trend line is colored red.
- This visual indication simplifies analysis and allows traders to quickly assess the market condition.
2. **MACD (Moving Average Convergence Divergence)**:
- MACD is an oscillator that shows the difference between two EMAs (with periods 6 and 13) and a **signal line** with a period of 5.
- A **buy signal** is generated when the MACD line crosses above the signal line, indicating a potential bullish trend.
- A **sell signal** is generated when the MACD line crosses below the signal line, indicating a possible bearish trend.
- Shorter MACD periods make the strategy more sensitive to price changes, allowing for more frequent trading signals.
3. **RSI (Relative Strength Index)**:
- RSI measures the speed and magnitude of directional price movements to determine if an asset is overbought or oversold.
- The strategy uses a standard RSI period of 14, but with relaxed levels for more signals.
- **For buy entries**, RSI should be above 40, signaling the start of a bullish impulse without indicating overbought conditions.
- **For sell entries**, RSI should be below 60, signaling potential bearish movement without being oversold.
Entry Conditions
- **Buy Signal**:
- The MACD line crosses above the signal line.
- EMA 20 is above EMA 50 (uptrend).
- RSI is above 40, indicating a potential rise without overbought conditions.
- When these conditions are met, the strategy enters a **long position**.
- **Sell Signal**:
- The MACD line crosses below the signal line.
- EMA 20 is below EMA 50 (downtrend).
- RSI is below 60, indicating a possible decline without being oversold.
- When these conditions are met, the strategy enters a **short position**.
Take-Profit Levels
- **Take Profit** is calculated at 1.5% of the entry price:
- **For long positions**, take profit is set at a level 1.5% above the entry price.
- **For short positions**, take profit is set at a level 1.5% below the entry price.
- This take-profit level is displayed as a blue line on the chart, giving traders a clear idea of the target profit point for each trade.
Visualization and Colors
- The main trend line (EMA 20) changes to green in an uptrend and red in a downtrend. This provides a clear visual indicator of the current trend direction.
- Take-profit levels are displayed as blue lines, helping traders follow targets and lock in profits at recommended levels.
Usage Recommendations
- **Timeframe**: The strategy is optimized for a 30-minute timeframe. At this interval, signals are frequent enough without being overly sensitive to noise.
- **Applicability**: The strategy works well for assets with moderate to high volatility, such as stocks, cryptocurrencies, and currency pairs.
- **Risk Management**: In addition to take profit, a stop loss at around 1-2% is recommended to minimize losses in case of sudden trend reversals.
Conclusion
This strategy is designed for more frequent signals by using faster indicators and relaxed RSI conditions. It is suitable for traders seeking quick trade opportunities and clearly defined take-profit levels.
ICT Master Suite [Trading IQ]Hello Traders!
We’re excited to introduce the ICT Master Suite by TradingIQ, a new tool designed to bring together several ICT concepts and strategies in one place.
The Purpose Behind the ICT Master Suite
There are a few challenges traders often face when using ICT-related indicators:
Many available indicators focus on one or two ICT methods, which can limit traders who apply a broader range of ICT related techniques on their charts.
There aren't many indicators for ICT strategy models, and we couldn't find ICT indicators that allow for testing the strategy models and setting alerts.
Many ICT related concepts exist in the public domain as indicators, not strategies! This makes it difficult to verify that the ICT concept has some utility in the market you're trading and if it's worth trading - it's difficult to know if it's working!
Some users might not have enough chart space to apply numerous ICT related indicators, which can be restrictive for those wanting to use multiple ICT techniques simultaneously.
The ICT Master Suite is designed to offer a comprehensive option for traders who want to apply a variety of ICT methods. By combining several ICT techniques and strategy models into one indicator, it helps users maximize their chart space while accessing multiple tools in a single slot.
Additionally, the ICT Master Suite was developed as a strategy . This means users can backtest various ICT strategy models - including deep backtesting. A primary goal of this indicator is to let traders decide for themselves what markets to trade ICT concepts in and give them the capability to figure out if the strategy models are worth trading!
What Makes the ICT Master Suite Different
There are many ICT-related indicators available on TradingView, each offering valuable insights. What the ICT Master Suite aims to do is bring together a wider selection of these techniques into one tool. This includes both key ICT methods and strategy models, allowing traders to test and activate strategies all within one indicator.
Features
The ICT Master Suite offers:
Multiple ICT strategy models, including the 2022 Strategy Model and Unicorn Model, which can be built, tested, and used for live trading.
Calculation and display of key price areas like Breaker Blocks, Rejection Blocks, Order Blocks, Fair Value Gaps, Equal Levels, and more.
The ability to set alerts based on these ICT strategies and key price areas.
A comprehensive, yet practical, all-inclusive ICT indicator for traders.
Customizable Timeframe - Calculate ICT concepts on off-chart timeframes
Unicorn Strategy Model
2022 Strategy Model
Liquidity Raid Strategy Model
OTE (Optimal Trade Entry) Strategy Model
Silver Bullet Strategy Model
Order blocks
Breaker blocks
Rejection blocks
FVG
Strong highs and lows
Displacements
Liquidity sweeps
Power of 3
ICT Macros
HTF previous bar high and low
Break of Structure indications
Market Structure Shift indications
Equal highs and lows
Swings highs and swing lows
Fibonacci TPs and SLs
Swing level TPs and SLs
Previous day high and low TPs and SLs
And much more! An ongoing project!
How To Use
Many traders will already be familiar with the ICT related concepts listed above, and will find using the ICT Master Suite quite intuitive!
Despite this, let's go over the features of the tool in-depth and how to use the tool!
The image above shows the ICT Master Suite with almost all techniques activated.
ICT 2022 Strategy Model
The ICT Master suite provides the ability to test, set alerts for, and live trade the ICT 2022 Strategy Model.
The image above shows an example of a long position being entered following a complete setup for the 2022 ICT model.
A liquidity sweep occurs prior to an upside breakout. During the upside breakout the model looks for the FVG that is nearest 50% of the setup range. A limit order is placed at this FVG for entry.
The target entry percentage for the range is customizable in the settings. For instance, you can select to enter at an FVG nearest 33% of the range, 20%, 66%, etc.
The profit target for the model generally uses the highest high of the range (100%) for longs and the lowest low of the range (100%) for shorts. Stop losses are generally set at 0% of the range.
The image above shows the short model in action!
Whether you decide to follow the 2022 model diligently or not, you can still set alerts when the entry condition is met.
ICT Unicorn Model
The image above shows an example of a long position being entered following a complete setup for the ICT Unicorn model.
A lower swing low followed by a higher swing high precedes the overlap of an FVG and breaker block formed during the sequence.
During the upside breakout the model looks for an FVG and breaker block that formed during the sequence and overlap each other. A limit order is placed at the nearest overlap point to current price.
The profit target for this example trade is set at the swing high and the stop loss at the swing low. However, both the profit target and stop loss for this model are configurable in the settings.
For Longs, the selectable profit targets are:
Swing High
Fib -0.5
Fib -1
Fib -2
For Longs, the selectable stop losses are:
Swing Low
Bottom of FVG or breaker block
The image above shows the short version of the Unicorn Model in action!
For Shorts, the selectable profit targets are:
Swing Low
Fib -0.5
Fib -1
Fib -2
For Shorts, the selectable stop losses are:
Swing High
Top of FVG or breaker block
The image above shows the profit target and stop loss options in the settings for the Unicorn Model.
Optimal Trade Entry (OTE) Model
The image above shows an example of a long position being entered following a complete setup for the OTE model.
Price retraces either 0.62, 0.705, or 0.79 of an upside move and a trade is entered.
The profit target for this example trade is set at the -0.5 fib level. This is also adjustable in the settings.
For Longs, the selectable profit targets are:
Swing High
Fib -0.5
Fib -1
Fib -2
The image above shows the short version of the OTE Model in action!
For Shorts, the selectable profit targets are:
Swing Low
Fib -0.5
Fib -1
Fib -2
Liquidity Raid Model
The image above shows an example of a long position being entered following a complete setup for the Liquidity Raid Modell.
The user must define the session in the settings (for this example it is 13:30-16:00 NY time).
During the session, the indicator will calculate the session high and session low. Following a “raid” of either the session high or session low (after the session has completed) the script will look for an entry at a recently formed breaker block.
If the session high is raided the script will look for short entries at a bearish breaker block. If the session low is raided the script will look for long entries at a bullish breaker block.
For Longs, the profit target options are:
Swing high
User inputted Lib level
For Longs, the stop loss options are:
Swing low
User inputted Lib level
Breaker block bottom
The image above shows the short version of the Liquidity Raid Model in action!
For Shorts, the profit target options are:
Swing Low
User inputted Lib level
For Shorts, the stop loss options are:
Swing High
User inputted Lib level
Breaker block top
Silver Bullet Model
The image above shows an example of a long position being entered following a complete setup for the Silver Bullet Modell.
During the session, the indicator will determine the higher timeframe bias. If the higher timeframe bias is bullish the strategy will look to enter long at an FVG that forms during the session. If the higher timeframe bias is bearish the indicator will look to enter short at an FVG that forms during the session.
For Longs, the profit target options are:
Nearest Swing High Above Entry
Previous Day High
For Longs, the stop loss options are:
Nearest Swing Low
Previous Day Low
The image above shows the short version of the Silver Bullet Model in action!
For Shorts, the profit target options are:
Nearest Swing Low Below Entry
Previous Day Low
For Shorts, the stop loss options are:
Nearest Swing High
Previous Day High
Order blocks
The image above shows indicator identifying and labeling order blocks.
The color of the order blocks, and how many should be shown, are configurable in the settings!
Breaker Blocks
The image above shows indicator identifying and labeling order blocks.
The color of the breaker blocks, and how many should be shown, are configurable in the settings!
Rejection Blocks
The image above shows indicator identifying and labeling rejection blocks.
The color of the rejection blocks, and how many should be shown, are configurable in the settings!
Fair Value Gaps
The image above shows indicator identifying and labeling fair value gaps.
The color of the fair value gaps, and how many should be shown, are configurable in the settings!
Additionally, you can select to only show fair values gaps that form after a liquidity sweep. Doing so reduces "noisy" FVGs and focuses on identifying FVGs that form after a significant trading event.
The image above shows the feature enabled. A fair value gap that occurred after a liquidity sweep is shown.
Market Structure
The image above shows the ICT Master Suite calculating market structure shots and break of structures!
The color of MSS and BoS, and whether they should be displayed, are configurable in the settings.
Displacements
The images above show indicator identifying and labeling displacements.
The color of the displacements, and how many should be shown, are configurable in the settings!
Equal Price Points
The image above shows the indicator identifying and labeling equal highs and equal lows.
The color of the equal levels, and how many should be shown, are configurable in the settings!
Previous Custom TF High/Low
The image above shows the ICT Master Suite calculating the high and low price for a user-defined timeframe. In this case the previous day’s high and low are calculated.
To illustrate the customizable timeframe function, the image above shows the indicator calculating the previous 4 hour high and low.
Liquidity Sweeps
The image above shows the indicator identifying a liquidity sweep prior to an upside breakout.
The image above shows the indicator identifying a liquidity sweep prior to a downside breakout.
The color and aggressiveness of liquidity sweep identification are adjustable in the settings!
Power Of Three
The image above shows the indicator calculating Po3 for two user-defined higher timeframes!
Macros
The image above shows the ICT Master Suite identifying the ICT macros!
ICT Macros are only displayable on the 5 minute timeframe or less.
Strategy Performance Table
In addition to a full-fledged TradingView backtest for any of the ICT strategy models the indicator offers, a quick-and-easy strategy table exists for the indicator!
The image above shows the strategy performance table in action.
Keep in mind that, because the ICT Master Suite is a strategy script, you can perform fully automatic backtests, deep backtests, easily add commission and portfolio balance and look at pertinent metrics for the ICT strategies you are testing!
Lite Mode
Traders who want the cleanest chart possible can toggle on “Lite Mode”!
In Lite Mode, any neon or “glow” like effects are removed and key levels are marked as strict border boxes. You can also select to remove box borders if that’s what you prefer!
Settings Used For Backtest
For the displayed backtest, a starting balance of $1000 USD was used. A commission of 0.02%, slippage of 2 ticks, a verify price for limit orders of 2 ticks, and 5% of capital investment per order.
A commission of 0.02% was used due to the backtested asset being a perpetual future contract for a crypto currency. The highest commission (lowest-tier VIP) for maker orders on many exchanges is 0.02%. All entered positions take place as maker orders and so do profit target exits. Stop orders exist as stop-market orders.
A slippage of 2 ticks was used to simulate more realistic stop-market orders. A verify limit order settings of 2 ticks was also used. Even though BTCUSDT.P on Binance is liquid, we just want the backtest to be on the safe side. Additionally, the backtest traded 100+ trades over the period. The higher the sample size the better; however, this example test can serve as a starting point for traders interested in ICT concepts.
Community Assistance And Feedback
Given the complexity and idiosyncratic applications of ICT concepts amongst its proponents, the ICT Master Suite’s built-in strategies and level identification methods might not align with everyone's interpretation.
That said, the best we can do is precisely define ICT strategy rules and concepts to a repeatable process, test, and apply them! Whether or not an ICT strategy is trading precisely how you would trade it, seeing the model in action, taking trades, and with performance statistics is immensely helpful in assessing predictive utility.
If you think we missed something, you notice a bug, have an idea for strategy model improvement, please let us know! The ICT Master Suite is an ongoing project that will, ideally, be shaped by the community.
A big thank you to the @PineCoders for their Time Library!
Thank you!
ML Supply Zone Strategy - ETHOverview
The ML (Machine Learning) Supply Zone Strategy for ETH is an advanced trading tool designed for traders looking to capitalize market movements in Ethereum (ETH). This strategy employs sophisticated machine learning techniques to identify supply zones by analyzing historical price data and calculating the statistical likelihood of price movements in specific directions. Our proprietary Python scripts perform monthly analyses to update these probabilities, ensuring the strategy adapts to evolving market conditions.
Key Features
Machine Learning-Derived Supply Zones-
Data-Driven Identification: Utilizes ML algorithms to process extensive historical price data of ETH, pinpointing supply zones where significant price reversals or continuations are statistically probable.
Probability Assessment: Breaks down the percentage chance of the price moving up or down upon reaching these zones, based on patterns recognized by the ML (machine learning) models.
Monthly Updates: Refreshes supply zones and probabilities every month through new data analysis, keeping the strategy current with market trends.
Proprietary Python Script Integration-
Advanced Algorithms: Our custom Python scripts employ clustering algorithms (e.g., K-means, DBSCAN) and statistical analysis to detect meaningful patterns in ETH price action.
Seamless Strategy Integration: The outputs from the Python analysis are directly incorporated into the trading script, providing actionable insights without the need for external tools.
Comprehensive Risk Management-
Precise Entry and Exit Points: Based on ML-derived supply zones and associated probabilities, the strategy sets exact entry and exit points to optimize trade outcomes.
Risk-to-Reward Optimization: Implements stop-loss and take-profit levels designed to achieve a favorable risk-to-reward ratio, typically aiming for 1:3 (0.7% SL / 2.1% TP).
Versatility Across Timeframes: While the strategy works well across various timeframes, it performs particularly effectively on the 1-minute timeframe, capturing short-term market movements.
How the Strategy Works
Data Collection and ML Analysis-
Historical Price Data Processing: The proprietary Python scripts analyze large datasets of historical ETH price movements, focusing on identifying zones where supply exceeds demand, leading to potential price drops.
Feature Extraction: ML models extract features such as price levels, volume spikes, and volatility measures that influence supply zone formations.
Probability Calculation-
Statistical Modeling: Uses statistical techniques to calculate the probability of price moving in a particular direction after reaching a supply zone.
Pattern Recognition: Identifies recurring patterns and correlations that have historically led to significant price movements.
Integration into Trading Script-
Supply Zone Mapping: The identified supply zones and their associated probabilities are embedded into the trading script as key levels.
Signal Generation:
Entry Signals: Triggered when the current price approaches a supply zone with a high probability of a downward move.
Choppiness Index (CI) and Volume Filtering-
Trade Quality Enhancement: To prevent excessive trading on determined supply zones, the strategy incorporates the Choppiness Index and volume filters.
Market Condition Assessment: The CI helps determine whether the market is trending or ranging, ensuring trades are taken in optimal conditions.
Liquidity Confirmation: Volume filters ensure that trades are only executed when there is sufficient market activity, improving execution and reliability.
Setup and Configuration
Access the Strategy: Add the ML Supply Zone Probability Strategy for ETH to your TradingView chart.
Select the Correct Chart: Apply it to the Pionex ETH/USDT Perpetual chart for optimal performance.
Select Timeframe: For best results, use the 1-minute timeframe (although almost all timeframes work).
Customize Settings: Adjust parameters such as risk tolerance, position sizing, and probability thresholds to suit your trading preferences.
Backtesting Recommendations
Sufficient Trade Sample Size: To generate around 100+ trades in backtesting, it is recommended to extend the backtesting period to at least three months.
Statistical Significance: A larger number of trades provides a more reliable assessment of the strategy's performance, enhancing confidence in its effectiveness.
Indicator Test with Conditions TableOverview: The "Indicator Test with Conditions Table" is a customizable trading strategy developed using Pine Script™ for the TradingView platform. It allows users to define complex entry conditions for both long and short positions based on various technical indicators and price levels.
Key Features:
Customizable Input Conditions:
Users can configure up to three input conditions for both long and short entries, each with its own logical operator (AND/OR) for combining conditions.
Input conditions can be based on:
Price Sources: Users can select any price data (e.g., close, open, high, low) for each condition.
Comparison Operators: Users can choose from a variety of operators, including:
Greater than (>)
Greater than or equal to (>=)
Less than (<)
Less than or equal to (<=)
Equal to (=)
Not equal to (!=)
Crossover (crossover)
Crossunder (crossunder)
Logical Operators:
The strategy provides options for combining conditions using logical operators (AND/OR) for greater flexibility in defining entry criteria.
Dynamic Condition Evaluation:
The strategy evaluates the defined conditions dynamically, checking whether they are enabled before proceeding with the comparison.
Users can toggle conditions on and off using boolean inputs, allowing for quick adjustments without modifying the code.
Visual Feedback:
A table is displayed on the chart, providing real-time status updates on the conditions and whether they are enabled. This enhances user experience by allowing easy monitoring of the strategy's logic.
Order Execution:
The strategy enters long or short positions based on the combined conditions' evaluations, automatically executing trades when the criteria are met.
How to Use:
Set Up Input Conditions:
Navigate to the strategy’s input settings to configure your desired price sources, operators, and logical combinations for long and short conditions.
Monitor Conditions:
Observe the condition table displayed at the bottom right of the chart to see which conditions are enabled and their current evaluations.
Adjust Strategy Parameters:
Modify the conditions, logical operators, and input sources as needed to optimize the strategy for different market scenarios or trading styles.
Execution:
Once the conditions are met, the strategy will automatically enter trades based on the defined logic.
Conclusion: The "Indicator Test with Conditions Table" strategy is a robust tool for traders looking to implement customized trading logic based on various market conditions. Its flexibility and real-time monitoring capabilities make it suitable for both novice and experienced traders.
Reflected ema Difference (RED) This script, titled "Reflected EMA Difference (RED)," is based on the logic of evaluating the percentage of convergence and divergence between two moving averages, specifically the Hull Moving Averages (HMA), to make price-related decisions. The Hull Moving Average, created by Alan Hull, is used as the foundation of this strategy, offering a faster and more accurate way to analyze market trends. In this script, the concept is employed to measure and reflect price variations.
Script Functionality Overview:
Hull Moving Averages (HMA): The script utilizes two HMAs, one short-term and one long-term. The main idea is to compute the Delta Difference between these two moving averages, which represents how much they are converging or diverging from each other. This difference is key to identifying potential market trend changes.
Reflected HMA Value: Using the Delta Difference between the HMAs, the value of the short-term HMA is reflected, creating a visual reference point that helps traders see the relationship between price and HMAs on the chart.
Percentage Change Index: The second key parameter is the percentage change index. This determines when a trend is reversing, allowing buy or sell orders to be established based on significant changes in the relationship between the HMAs and the price.
Delta Multiplier: The script comes with a default Delta multiplier of 2 for calculating the difference between HMAs, allowing traders to adjust the sensitivity of the analysis based on the time frame being analyzed.
Trend Reversal Signals: When the price crosses the thresholds defined by the percentage change index, buy or sell signals are triggered, based on the detection of a potential trend reversal.
Visual Cues with Boxes: Boxes are drawn on the chart when the HullMA crosses the reflected HMA value, providing a visual aid to identify critical moments where risk should be evaluated.
Alerts for Receiving Signals:
This script allows you to set up buy and sell alerts via TradingView's alert system. These alerts are triggered when trend changes are detected based on the conditions coded in the script. Traders can receive instant notifications, allowing them to make decisions without needing to constantly monitor the chart.
Additional Considerations:
The percentage change parameter is adjustable and should be configured based on the time frame you are trading on. For longer time frames, it's advisable to use a larger percentage change to avoid false signals.
The use of Hull Moving Averages (HMA) provides a faster and more reactive approach to trend evaluation compared to other moving averages, making it a powerful tool for traders seeking quick reversal signals.
This approach combines the power of Hull Moving Averages with an alert system to improve the trader’s response to trend changes.
Spanish
Este script, titulado "Reflected EMA Difference (RED)", está fundamentado en la lógica de evaluar el porcentaje de acercamiento y distancia entre dos medias móviles, específicamente las medias móviles de Hull (HMA), para tomar decisiones sobre el valor del precio. El creador de la media móvil de Hull, Alan Hull, diseñó este indicador para ofrecer una forma más rápida y precisa de analizar tendencias de mercado, y en este script se utiliza su concepto como base para medir y reflejar las variaciones de precio.
Descripción del funcionamiento:
Medias Móviles de Hull (HMA): Se utilizan dos HMAs, una de corto plazo y otra de largo plazo. La idea principal es calcular la diferencia Delta entre estas dos medias móviles, que representa cuánto se están alejando o acercando entre sí. Esta diferencia es clave para identificar cambios potenciales en la tendencia del mercado.
Valor Reflejado de la HMA: Con la diferencia Delta calculada entre las HMAs, se refleja el valor de la HMA corta, creando un punto de referencia visual que ayuda a los traders a observar la relación entre el precio y las HMAs en el gráfico.
Índice de Cambio de Porcentaje: El segundo parámetro clave del script es el índice de cambio porcentual. Este define el momento en que una tendencia está revirtiendo, permitiendo establecer órdenes de compra o venta en función de un cambio significativo en la relación entre las HMAs y el precio.
Multiplicador Delta: El script tiene un multiplicador predeterminado de 2 para el cálculo de la diferencia Delta, lo que permite ajustar la sensibilidad del análisis según la temporalidad del gráfico.
Señales de Reversión de Tendencia: Cuando el precio cruza los límites definidos por el índice de cambio porcentual, se emiten señales para comprar o vender, basadas en la detección de una posible reversión de tendencia.
Visualización con Cajas: Se dibujan cajas en el gráfico cuando el indicador HullMA cruza el valor reflejado de la HMA, ayudando a identificar visualmente los momentos críticos en los que se debe evaluar el riesgo de las operaciones.
Alertas para Recibir Señales:
Este script permite configurar alertas de compra y venta desde el apartado de alertas de TradingView. Estas alertas se activan cuando se detectan cambios de tendencia en función de las condiciones establecidas en el código. El trader puede recibir notificaciones instantáneas, lo que facilita la toma de decisiones sin necesidad de estar constantemente observando el gráfico.
Consideraciones adicionales:
El porcentaje de cambio es un parámetro ajustable y debe configurarse según la temporalidad que se esté operando. En temporalidades más largas, es recomendable usar un porcentaje de cambio mayor para evitar señales falsas.
La utilización de las medias móviles de Hull (HMA) proporciona un enfoque más rápido y reactivo para evaluar tendencias en comparación con otras medias móviles, lo que lo convierte en una herramienta poderosa para traders que buscan señales rápidas de reversión.
Este enfoque combina la potencia de las medias móviles de Hull con un sistema de alertas que mejora la reactividad a cambios de tendencia.
VRS (Vegas Reversal Strategy)It is based on the reversal of the price after an accentuated volatility of the previous day. It is tested only on BTC, TF Day, and has an activation value equal to a spike of minimum 2.4% amplitude, a value that I have left in the settings free to be modified if it is found valid for other assets.
In the settings you can change how many of the latest longs or shorts I want to view in the past, colors and various aesthetics.
When the system detects a spike at the end of the day from 2.4% onwards it will signal the direction of Reversal, generating the 3 TP, dotted lines.
Entry into the market must be done at the close of the candle day, unfortunately at night time if you want to enter on the tick.
Stop above/below the spike that generated the condition.
If the Day2 candle closes FULL inside the spike, immediate and early closing of the operation.
There cannot be two consecutive Day events: if you are Long or Short and have taken a stop on the next candle, even if the latter generates another entry, this must not be activated.
TP 1 and 2 are both mandatory at 33% of the position, TP3, based on the current movement, can be considered to be left to run to the bitter end or in any case to structuring confirmations of a slowdown in the price.
Upon reaching TP1 it is mandatory to move the STOP to even.
In the event of the presence of extremely strong directional movements, for example Long direction, an opposite activation, Short, must be done but with reduced capital, on the contrary an activation in the same direction as the trend movement can be done with a surcharge. Always pay attention to Money Management and Risk Management.
Always manage Risk and Money Management in an adequate, technical and sustainable manner in relation to your capital. A fair exposure per transaction is between 1% and 2% of the capital.
Proxy Financial Stress Index StrategyThis strategy is based on a Proxy Financial Stress Index constructed using several key financial indicators. The strategy goes long when the financial stress index crosses below a user-defined threshold, signaling a potential reduction in market stress. Once a position is opened, it is held for a predetermined number of bars (periods), after which it is automatically closed.
The financial stress index is composed of several normalized indicators, each representing different market aspects:
VIX - Market volatility.
US 10-Year Treasury Yield - Bond market.
Dollar Index (DXY) - Currency market.
S&P 500 Index - Stock market.
EUR/USD - Currency exchange rate.
High-Yield Corporate Bond ETF (HYG) - Corporate bond market.
Each component is normalized using a Z-score (based on the user-defined moving average and standard deviation lengths) and weighted according to user inputs. The aggregated index reflects overall market stress.
The strategy enters a long position when the stress index crosses below a specified threshold from above, indicating reduced financial stress. The position is held for a defined holding period before being closed automatically.
Scientific References:
The concept of a financial stress index is derived from research that combines multiple financial variables to measure systemic risks in the financial markets. Key research includes:
The Financial Stress Index developed by various Federal Reserve banks, including the Cleveland Financial Stress Index (CFSI)
Bank of America Merrill Lynch Option Volatility Estimate (MOVE) Index as a measure of interest rate volatility, which correlates with financial stress
These indices are widely used in economic research to gauge financial instability and help in policy decisions. They track real-time fluctuations in various markets and are often used to anticipate economic downturns or periods of high financial risk.
BTC 5 min SHBHilalimSB A Wedding Gift 🌙
What is HilalimSB🌙?
First of all, as mentioned in the title, HilalimSB is a wedding gift.
HilalimSB - Revealing the Secrets of the Trend
HilalimSB is a powerful indicator designed to help investors analyze market trends and optimize trading strategies. Designed to uncover the secrets at the heart of the trend, HilalimSB stands out with its unique features and impressive algorithm.
Hilalim Algorithm and Fixed ATR Value:
HilalimSB is equipped with a special algorithm called "Hilalim" to detect market trends. This algorithm can delve into the depths of price movements to determine the direction of the trend and provide users with the ability to predict future price movements. Additionally, HilalimSB uses its own fixed Average True Range (ATR) value. ATR is an indicator that measures price movement volatility and is often used to determine the strength of a trend. The fixed ATR value of HilalimSB has been tested over long periods and its reliability has been proven. This allows users to interpret the signals provided by the indicator more reliably.
ATR Calculation Steps
1.True Range Calculation:
+ The True Range (TR) is the greatest of the following three values:
1. Current high minus current low
2. Current high minus previous close (absolute value)
3. Current low minus previous close (absolute value)
2.Average True Range (ATR) Calculation:
-The initial ATR value is calculated as the average of the TR values over a specified period
(typically 14 periods).
-For subsequent periods, the ATR is calculated using the following formula:
ATRt=(ATRt−1×(n−1)+TRt)/n
Where:
+ ATRt is the ATR for the current period,
+ ATRt−1 is the ATR for the previous period,
+ TRt is the True Range for the current period,
+ n is the number of periods.
Pine Script to Calculate ATR with User-Defined Length and Multiplier
Here is the Pine Script code for calculating the ATR with user-defined X length and Y multiplier:
//@version=5
indicator("Custom ATR", overlay=false)
// User-defined inputs
X = input.int(14, minval=1, title="ATR Period (X)")
Y = input.float(1.0, title="ATR Multiplier (Y)")
// True Range calculation
TR1 = high - low
TR2 = math.abs(high - close )
TR3 = math.abs(low - close )
TR = math.max(TR1, math.max(TR2, TR3))
// ATR calculation
ATR = ta.rma(TR, X)
// Apply multiplier
customATR = ATR * Y
// Plot the ATR value
plot(customATR, title="Custom ATR", color=color.blue, linewidth=2)
This code can be added as a new Pine Script indicator in TradingView, allowing users to calculate and display the ATR on the chart according to their specified parameters.
HilalimSB's Distinction from Other ATR Indicators
HilalimSB emerges with its unique Average True Range (ATR) value, presenting itself to users. Equipped with a proprietary ATR algorithm, this indicator is released in a non-editable form for users. After meticulous testing across various instruments with predetermined period and multiplier values, it is made available for use.
ATR is acknowledged as a critical calculation tool in the financial sector. The ATR calculation process of HilalimSB is conducted as a result of various research efforts and concrete data-based computations. Therefore, the HilalimSB indicator is published with its proprietary ATR values, unavailable for modification.
The ATR period and multiplier values provided by HilalimSB constitute the fundamental logic of a trading strategy. This unique feature aids investors in making informed decisions.
Visual Aesthetics and Clear Charts:
HilalimSB provides a user-friendly interface with clear and impressive graphics. Trend changes are highlighted with vibrant colors and are visually easy to understand. You can choose colors based on eye comfort, allowing you to personalize your trading screen for a more enjoyable experience. While offering a flexible approach tailored to users' needs, HilalimSB also promises an aesthetic and professional experience.
Strong Signals and Buy/Sell Indicators:
After completing test operations, HilalimSB produces data at various time intervals. However, we would like to emphasize to users that based on our studies, it provides the best signals in 1-hour chart data. HilalimSB produces strong signals to identify trend reversals. Buy or sell points are clearly indicated, allowing users to develop and implement trading strategies based on these signals.
For example, let's imagine you wanted to open a position on BTC on 2023.11.02. You are aware that you need to calculate which of the buying or selling transactions would be more profitable. You need support from various indicators to open a position. Based on the analysis and calculations it has made from the data it contains, HilalimSB would have detected that the graph is more suitable for a selling position, and by producing a sell signal at the most ideal selling point at 08:00 on 2023.11.02 (UTC+3 Istanbul), it would have informed you of the direction the graph would follow, allowing you to benefit positively from a 2.56% decline.
Technology and Innovation:
HilalimSB aims to enhance the trading experience using the latest technology. With its innovative approach, it enables users to discover market opportunities and support their decisions. Thus, investors can make more informed and successful trades. Real-Time Data Analysis: HilalimSB analyzes market data in real-time and identifies updated trends instantly. This allows users to make more informed trading decisions by staying informed of the latest market developments. Continuous Update and Improvement: HilalimSB is constantly updated and improved. New features are added and existing ones are enhanced based on user feedback and market changes. Thus, HilalimSB always aims to provide the latest technology and the best user experience.
Social Order and Intrinsic Motivation:
Negative trends such as widespread illegal gambling and uncontrolled risk-taking can have adverse financial effects on society. The primary goal of HilalimSB is to counteract these negative trends by guiding and encouraging users with data-driven analysis and calculable investment systems. This allows investors to trade more consciously and safely.
What is BTC 5 min ☆SHB Strategy🌙?
BTC 5 min ☆SHB Strategy is a strategy supported by the HilalimSB algorithm created by the creator of HilalimSB. It automatically opens trades based on the data it receives, maintaining trades with its uniquely defined take profit and stop loss levels, and automatically closes trades when necessary. It stands out in the TradingView world with its unique take profit and stop loss markings. BTC 5 min ☆SHB Strategy is close to users' initiatives and is a strategy suitable for 5-minute trades and scalp operations developed on BTC.
What does the BTC 5 min ☆SHB Strategy target?
The primary goal of BTC 5 min ☆SHB Strategy is to close trades made by traders in short timeframes as profitably as possible and to determine the most effective trading points in low time periods, considering the commission rates of various brokerage firms. BTC 5 min ☆SHB Strategy is one of the rare profitable strategies released in short timeframes, with its useful interface, in addition to existing strategies in the markets. After extensive backtesting over a long period and achieving above-average success, BTC 5 min ☆SHB Strategy was decided to be released. Following the completion of test procedures under market conditions, it was presented to users with the unique visual effects of ☆SB.
BTC 5 min ☆SHB Strategy and Heikin Ashi
BTC 5 min ☆SHB Strategy produces data in Heikin-Ashi chart types, but since Heikin-Ashi chart types have their own calculation method, BTC 5 min ☆SHB Strategy has been published in a way that cannot produce data in this chart type due to BTC 5 min ☆SHB Strategy's ideology of appealing to all types of users, and any confusion that may arise is prevented in this way. Heikin-Ashi chart types, especially in short time intervals, carry significant risks considering the unique calculation methods involved. Thus, the possibility of being misled by the coder and causing financial losses has been completely eliminated. After the necessary conditions determined by the creator of BTC 5 min ☆SHB are met, BTC 5 min ☆SHB Heikin-Ashi will be shared exclusively with invited users only, upon request, to users who request an invitation.
Key Features:
+HilalimSHB Algorithm: This algorithm uses a dynamic ATR-based trend-following mechanism to identify the current market trend. The strategy detects trend reversals and takes positions accordingly.
+Heikin Ashi Compatibility: The strategy is optimized to work only with standard candlestick charts and automatically deactivates when Heikin Ashi charts are in use, preventing false signals.
+Advanced Chart Enhancements: The strategy offers clear graphical markers for buy/sell signals. Candlesticks are automatically colored based on trend direction, making market trends easier to follow.
Strategy Parameters:
+Take Profit (%): Defines the target price level for closing a position and automates profit-taking. The fixed value is set at 2%.
+Stop Loss (%): Specifies the stop-loss level to limit losses. The fixed value is set at 3%.
The shared image is a 5-minute chart of BTCUSDC.P with a fixed take profit value of 2% and a fixed stop loss value of 3%. The trades are opened with a commission rate of 0.063% set for the USDT trading pair on Binance.🌙
Fibonacci Trend Reversal StrategyIntroduction
This publication introduces the " Fibonacci Retracement Trend Reversal Strategy, " tailored for traders aiming to leverage shifts in market momentum through advanced trend analysis and risk management techniques. This strategy is designed to pinpoint potential reversal points, optimizing trading opportunities.
Overview
The strategy leverages Fibonacci retracement levels derived from @IMBA_TRADER's lance Algo to identify potential trend reversals. It's further enhanced by a method called " Trend Strength Over Time " (TSOT) (by @federalTacos5392b), which utilizes percentile rankings of price action to measure trend strength. This also has implemented Dynamic SL finder by utilizing @veryfid's ATR Stoploss Finder which works pretty well
Indicators:
Fibonacci Retracement Levels : Identifies critical reversal zones at 23.6%, 50%, and 78.6% levels.
TSOT (Trend Strength Over Time) : Employs percentile rankings across various timeframes to gauge the strength and direction of trends, aiding in the confirmation of Fibonacci-based signals.
ATR (Average True Range) : Implements dynamic stop-loss settings for both long and short positions, enhancing trade security.
Strategy Settings :
- Sensitivity: Set default at 18, adjustable for more frequent or sparse signals based on market volatility.
- ATR Stop Loss Finder: Multiplier set at 3.5, applying the ATR value to determine stop losses dynamically.
- ATR Length: Default set to 14 with RMA smoothing.
- TSOT Settings: Hard-coded to identify percentile ranks, with no user-adjustable inputs due to its intrinsic calculation method.
Trade Direction Options : Configurable to support long, short, or both directions, adaptable to the trader's market assessment.
Entry Conditions :
- Long Entry: Triggered when the price surpasses the mid Fibonacci level (50%) with a bullish TSOT signal.
- Short Entry: Activated when the price falls below the mid Fibonacci level with a bearish TSOT indication.
Exit Conditions :
- Employs ATR-based dynamic stop losses, calibrated according to current market volatility, ensuring effective risk management.
Strategy Execution :
- Risk Management: Features adjustable risk-reward settings and enables partial take profits by default to systematically secure gains.
- Position Reversal: Includes an option to reverse positions based on new TSOT signals, improving the strategy's responsiveness to evolving market conditions.
The strategy is optimized for the BYBIT:WIFUSDT.P market on a scalping (5-minute) timeframe, using the default settings outlined above.
I spent a lot of time creating the dynamic exit strategies for partially taking profits and reversing positions so please make use of those and feel free to adjust the settings, tool tips are also provided.
For Developers: this is published as open-sourced code so that developers can learn something especially on dynamic exits and partial take profits!
Good Luck!
Disclaimer
This strategy is shared for educational purposes and must be thoroughly tested under diverse market conditions. Past performance does not guarantee future results. Traders are advised to integrate this strategy with other analytical tools and tailor it to specific market scenarios. I was only sharing what I've crafted while strategizing over a Solana Meme Coin.
Bitcoin 5A Strategy@LilibtcIn our long-term strategy, we have deeply explored the key factors influencing the price of Bitcoin. By precisely calculating the correlation between these factors and the price of Bitcoin, we found that they are closely linked to the value of Bitcoin. To more effectively predict the fair price of Bitcoin, we have built a predictive model and adjusted our investment strategy accordingly based on this model. In practice, the prediction results of this model correspond quite high with actual values, fully demonstrating its reliability in predicting price fluctuations.
When the future is uncertain and the outlook is unclear, people often choose to hold back and avoid risks, or even abandon their original plans. However, the prediction of Bitcoin is full of challenges, but we have taken the first step in exploring.
Table of contents:
Usage Guide
Step 1: Identify the factors that have the greatest impact on Bitcoin price
Step 2: Build a Bitcoin price prediction model
Step 3: Find indicators for warning of bear market bottoms and bull market tops
Step 4: Predict Bitcoin Price in 2025
Step 5: Develop a Bitcoin 5A strategy
Step 6: Verify the performance of the Bitcoin 5A strategy
Usage Restrictions
🦮Usage Guide:
1. On the main interface, modify the code, find the BTCUSD trading pair, and select the BITSTAMP exchange for trading.
2. Set the time period to the daily chart.
3. Select a logarithmic chart in the chart type to better identify price trends.
4. In the strategy settings, adjust the options according to personal needs, including language, display indicators, display strategies, display performance, display optimizations, sell alerts, buy prompts, opening days, backtesting start year, backtesting start month, and backtesting start date.
🏃Step 1: Identify the factors that have the greatest impact on Bitcoin price
📖Correlation Coefficient: A mathematical concept for measuring influence
In order to predict the price trend of Bitcoin, we need to delve into the factors that have the greatest impact on its price. These factors or variables can be expressed in mathematical or statistical correlation coefficients. The correlation coefficient is an indicator of the degree of association between two variables, ranging from -1 to 1. A value of 1 indicates a perfect positive correlation, while a value of -1 indicates a perfect negative correlation.
For example, if the price of corn rises, the price of live pigs usually rises accordingly, because corn is the main feed source for pig breeding. In this case, the correlation coefficient between corn and live pig prices is approximately 0.3. This means that corn is a factor affecting the price of live pigs. On the other hand, if a shooter's performance improves while another shooter's performance deteriorates due to increased psychological pressure, we can say that the former is a factor affecting the latter's performance.
Therefore, in order to identify the factors that have the greatest impact on the price of Bitcoin, we need to find the factors with the highest correlation coefficients with the price of Bitcoin. If, through the analysis of the correlation between the price of Bitcoin and the data on the chain, we find that a certain data factor on the chain has the highest correlation coefficient with the price of Bitcoin, then this data factor on the chain can be identified as the factor that has the greatest impact on the price of Bitcoin. Through calculation, we found that the 🔵number of Bitcoin blocks is one of the factors that has the greatest impact on the price of Bitcoin. From historical data, it can be clearly seen that the growth rate of the 🔵number of Bitcoin blocks is basically consistent with the movement direction of the price of Bitcoin. By analyzing the past ten years of data, we obtained a daily correlation coefficient of 0.93 between the number of Bitcoin blocks and the price of Bitcoin.
🏃Step 2: Build a Bitcoin price prediction model
📖Predictive Model: What formula is used to predict the price of Bitcoin?
Among various prediction models, the linear function is the preferred model due to its high accuracy. Take the standard weight as an example, its linear function graph is a straight line, which is why we choose the linear function model. However, the growth rate of the price of Bitcoin and the number of blocks is extremely fast, which does not conform to the characteristics of the linear function. Therefore, in order to make them more in line with the characteristics of the linear function, we first take the logarithm of both. By observing the logarithmic graph of the price of Bitcoin and the number of blocks, we can find that after the logarithm transformation, the two are more in line with the characteristics of the linear function. Based on this feature, we choose the linear regression model to establish the prediction model.
From the graph below, we can see that the actual red and green K-line fluctuates around the predicted blue and 🟢green line. These predicted values are based on fundamental factors of Bitcoin, which support its value and reflect its reasonable value. This picture is consistent with the theory proposed by Marx in "Das Kapital" that "prices fluctuate around values."
The predicted logarithm of the market cap of Bitcoin is calculated through the model. The specific calculation formula of the Bitcoin price prediction value is as follows:
btc_predicted_marketcap = math.exp(btc_predicted_marketcap_log)
btc_predicted_price = btc_predicted_marketcap / btc_supply
🏃Step 3: Find indicators for early warning of bear market bottoms and bull market tops
📖Warning Indicator: How to Determine Whether the Bitcoin Price has Reached the Bear Market Bottom or the Bull Market Top?
By observing the Bitcoin price logarithmic prediction chart mentioned above, we notice that the actual price often falls below the predicted value at the bottom of a bear market; during the peak of a bull market, the actual price exceeds the predicted price. This pattern indicates that the deviation between the actual price and the predicted price can serve as an early warning signal. When the 🔴 Bitcoin price deviation is very low, as shown by the chart with 🟩green background, it usually means that we are at the bottom of the bear market; Conversely, when the 🔴 Bitcoin price deviation is very high, the chart with a 🟥red background indicates that we are at the peak of the bull market.
This pattern has been validated through six bull and bear markets, and the deviation value indeed serves as an early warning signal, which can be used as an important reference for us to judge market trends.
🏃Step 4:Predict Bitcoin Price in 2025
📖Price Upper Limit
According to the data calculated on February 25, 2024, the 🟠upper limit of the Bitcoin price is $194,287, which is the price ceiling of this bull market. The peak of the last bull market was on November 9, 2021, at $68,664. The bull-bear market cycle is 4 years, so the highest point of this bull market is expected in 2025. That is where you should sell the Bitcoin. and the upper limit of the Bitcoin price will exceed $190,000. The closing price of Bitcoin on February 25, 2024, was $51,729, with an expected increase of 2.7 times.
🏃Step 5: Bitcoin 5A Strategy Formulation
📖Strategy: When to buy or sell, and how many to choose?
We introduce the Bitcoin 5A strategy. This strategy requires us to generate trading signals based on the critical values of the warning indicators, simulate the trades, and collect performance data for evaluation. In the Bitcoin 5A strategy, there are three key parameters: buying warning indicator, batch trading days, and selling warning indicator. Batch trading days are set to ensure that we can make purchases in batches after the trading signal is sent, thus buying at a lower price, selling at a higher price, and reducing the trading impact cost.
In order to find the optimal warning indicator critical value and batch trading days, we need to adjust these parameters repeatedly and perform backtesting. Backtesting is a method established by observing historical data, which can help us better understand market trends and trading opportunities.
Specifically, we can find the key trading points by watching the Bitcoin price log and the Bitcoin price deviation chart. For example, on August 25, 2015, the 🔴 Bitcoin price deviation was at its lowest value of -1.11; on December 17, 2017, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.69; on March 16, 2020, the 🔴 Bitcoin price deviation was at its lowest value at the time, -0.91; on March 13, 2021, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.1; on December 31, 2022, the 🔴 Bitcoin price deviation was at its lowest value at the time, -1.
To ensure that all five key trading points generate trading signals, we set the warning indicator Bitcoin price deviation to the larger of the three lowest values, -0.9, and the smallest of the two highest values, 1. Then, we buy when the warning indicator Bitcoin price deviation is below -0.9, and sell when it is above 1.
In addition, we set the batch trading days as 25 days to implement a strategy that averages purchases and sales. Within these 25 days, we will invest all funds into the market evenly, buying once a day. At the same time, we also sell positions at the same pace, selling once a day.
📖Adjusting the threshold: a key step to optimizing trading strategy
Adjusting the threshold is an indispensable step for better performance. Here are some suggestions for adjusting the batch trading days and critical values of warning indicators:
• Batch trading days: Try different days like 25 to see how it affects overall performance.
• Buy and sell critical values for warning indicators: iteratively fine-tune the buy threshold value of -0.9 and the sell threshold value of 1 exhaustively to find the best combination of threshold values.
Through such careful adjustments, we may find an optimized approach with a lower maximum drawdown rate (e.g., 11%) and a higher cumulative return rate for closed trades (e.g., 474 times). The chart below is a backtest optimization chart for the Bitcoin 5A strategy, providing an intuitive display of strategy adjustments and optimizations.
In this way, we can better grasp market trends and trading opportunities, thereby achieving a more robust and efficient trading strategy.
🏃Step 6: Validating the performance of the Bitcoin 5A Strategy
📖Model interpretability validation: How to explain the Bitcoin price model?
The interpretability of the model is represented by the coefficient of determination R squared, which reflects the degree of match between the predicted value and the actual value. I divided all the historical data from August 18, 2015 into two groups, and used the data from August 18, 2011 to August 18, 2015 as training data to generate the model. The calculation result shows that the coefficient of determination R squared during the 2011-2015 training period is as high as 0.81, which shows that the interpretability of this model is quite high. From the Bitcoin price logarithmic prediction chart in the figure below, we can see that the deviation between the predicted value and the actual value is not far, which means that most of the predicted values can explain the actual value well.
The calculation formula for the coefficient of determination R squared is as follows:
residual = btc_close_log - btc_predicted_price_log
residual_square = residual * residual
train_residual_square_sum = math.sum(residual_square, train_days)
train_mse = train_residual_square_sum / train_days
train_r2 = 1 - train_mse / ta.variance(btc_close_log, train_days)
📖Model stability verification: How to affirm the stability of the Bitcoin price model when new data is available?
Model stability is achieved through model verification. I set the last day of the training period to February 2, 2024 as the "verification group" and used it as verification data to verify the stability of the model. This means that after generating the model if there is new data, I will use these new data together with the model for prediction, and then evaluate the interpretability of the model. If the coefficient of determination when using verification data is close to the previous training one and both remain at a high level, then we can consider this model as stability. The coefficient of determination calculated from the validation period data and model prediction results is as high as 0.83, which is close to the previous 0.81, further proving the stability of this model.
📖Performance evaluation: How to accurately evaluate historical backtesting results?
After detailed strategy testing, to ensure the accuracy and reliability of the results, we need to carry out a detailed performance evaluation on the backtest results. The key evaluation indices include:
• Net value curve: As shown in the rose line, it intuitively reflects the growth of the account net value. By observing the net value curve, we can understand the overall performance and profitability of the strategy.
The basic attributes of this strategy are as follows:
Trading range: 2015-8-19 to 2024-2-18, backtest range: 2011-8-18 to 2024-2-18
Initial capital: 1000USD, order size: 1 contract, pyramid: 50 orders, commission rate: 0.2%, slippage: 20 markers.
In the strategy tester overview chart, we also obtained the following key data:
• Net profit rate of closed trades: as high as 474 times, far exceeding the benchmark, as shown in the strategy tester performance summary chart, Bitcoin buys and holds 210 times.
• Number of closed trades and winning percentage: 100 trades were all profitable, showing the stability and reliability of the strategy.
• Drawdown rate & win-loose ratio: The maximum drawdown rate is only 11%, far lower than Bitcoin's 78%. Profit factor, or win-loose ratio, reached 500, further proving the advantage of the strategy.
Through these detailed evaluations, we can see clearly the excellent balance between risk and return of the Bitcoin 5A strategy.
⚠️Usage Restrictions: Strategy Application in Specific Situations
Please note that this strategy is designed specifically for Bitcoin and should not be applied to other assets or markets without authorization. In actual operations, we should make careful decisions according to our risk tolerance and investment goals.
CVD Divergence Strategy.1.mmThis is the matching Strategy version of Indicator of the same name.
As a member of the K1m6a Lions discussion community we often use versions of the Cumulative Volume Delta indicator
as one of our primary tools along with RSI, RSI Divergences, Open interest, Volume Profile, TPO and Fibonacci levels.
We also discuss visual interpretations of CVD Divergences across multiple time frames much like RSI divergences.
RSI Divergences can be identified as possible Bullish reversal areas when the RSI is making higher low points while
the price is making lower low points.
RSI Divergences can be identified as possible Bearish reversal areas when the RSI is making lower high points while
the price is making higher high points.
CVD Divergences can also be identified the same way on any timeframe as possible reversal signals. As with RSI, these Divergences
often occur as a trend's momentum is giving way to lower volume and areas when profits are being taken signaling a possible reversal
of the current trending price movement.
Hidden Divergences are identified as calculations that may be signaling a continuation of the current trend.
Having not found any public domain versions of a CVD Divergence indicator I have combined some public code to create this
indicator and matching strategy. The calculations for the Cumulative Volume Delta keep a running total for the differences between
the positive changes in volume in relation to the negative changes in volume. A relative upward spike in CVD is created when
there is a large increase in buying vs a low amount of selling. A relative downward spike in CVD is created when
there is a large increase in selling vs a low amount of buying.
In the settings menu, the is a drop down to be used to view the results in alternate timeframes while the chart remains on current timeframe. The Lookback settings can be adjusted so that the divs show on a more local, spontaneous level if set at 1,1,60,1. For a deeper, wider view of the divs, they can be set higher like 7,7,60,7. Adjust them all to suit your view of the divs.
To create this indicator/strategy I used a portion of the code from "Cumulative Volume Delta" by @ contrerae which calculates
the CVD from aggregate volume of many top exchanges and plots the continuous changes on a non-overlay indicator.
For the identification and plotting of the Divergences, I used similar code from the Tradingview Technical "RSI Divergence Indicator"
This indicator should not be used as a stand-alone but as an additional tool to help identify Bullish and Bearish Divergences and
also Bullish and Bearish Hidden Divergences which, as opposed to regular divergences, may indicate a continuation.
Bitcoin 5A Strategy - Price Upper & Lower Limit@LilibtcIn our long-term strategy, we have deeply explored the key factors influencing the price of Bitcoin. By precisely calculating the correlation between these factors and the price of Bitcoin, we found that they are closely linked to the value of Bitcoin. To more effectively predict the fair price of Bitcoin, we have built a predictive model and adjusted our investment strategy accordingly based on this model. In practice, the prediction results of this model correspond quite high with actual values, fully demonstrating its reliability in predicting price fluctuations.
When the future is uncertain and the outlook is unclear, people often choose to hold back and avoid risks, or even abandon their original plans. However, the prediction of Bitcoin is full of challenges, but we have taken the first step in exploring.
Table of contents:
Usage Guide
Step 1: Identify the factors that have the greatest impact on Bitcoin price
Step 2: Build a Bitcoin price prediction model
Step 3: Find indicators for warning of bear market bottoms and bull market tops
Step 4: Predict Bitcoin Price in 2025
Step 5: Develop a Bitcoin 5A strategy
Step 6: Verify the performance of the Bitcoin 5A strategy
Usage Restrictions
🦮Usage Guide:
1. On the main interface, modify the code, find the BTCUSD trading pair, and select the BITSTAMP exchange for trading.
2. Set the time period to the daily chart.
3. Select a logarithmic chart in the chart type to better identify price trends.
4. In the strategy settings, adjust the options according to personal needs, including language, display indicators, display strategies, display performance, display optimizations, sell alerts, buy prompts, opening days, backtesting start year, backtesting start month, and backtesting start date.
🏃Step 1: Identify the factors that have the greatest impact on Bitcoin price
📖Correlation Coefficient: A mathematical concept for measuring influence
In order to predict the price trend of Bitcoin, we need to delve into the factors that have the greatest impact on its price. These factors or variables can be expressed in mathematical or statistical correlation coefficients. The correlation coefficient is an indicator of the degree of association between two variables, ranging from -1 to 1. A value of 1 indicates a perfect positive correlation, while a value of -1 indicates a perfect negative correlation.
For example, if the price of corn rises, the price of live pigs usually rises accordingly, because corn is the main feed source for pig breeding. In this case, the correlation coefficient between corn and live pig prices is approximately 0.3. This means that corn is a factor affecting the price of live pigs. On the other hand, if a shooter's performance improves while another shooter's performance deteriorates due to increased psychological pressure, we can say that the former is a factor affecting the latter's performance.
Therefore, in order to identify the factors that have the greatest impact on the price of Bitcoin, we need to find the factors with the highest correlation coefficients with the price of Bitcoin. If, through the analysis of the correlation between the price of Bitcoin and the data on the chain, we find that a certain data factor on the chain has the highest correlation coefficient with the price of Bitcoin, then this data factor on the chain can be identified as the factor that has the greatest impact on the price of Bitcoin. Through calculation, we found that the 🔵 number of Bitcoin blocks is one of the factors that has the greatest impact on the price of Bitcoin. From historical data, it can be clearly seen that the growth rate of the 🔵 number of Bitcoin blocks is basically consistent with the movement direction of the price of Bitcoin. By analyzing the past ten years of data, we obtained a daily correlation coefficient of 0.93 between the number of Bitcoin blocks and the price of Bitcoin.
🏃Step 2: Build a Bitcoin price prediction model
📖Predictive Model: What formula is used to predict the price of Bitcoin?
Among various prediction models, the linear function is the preferred model due to its high accuracy. Take the standard weight as an example, its linear function graph is a straight line, which is why we choose the linear function model. However, the growth rate of the price of Bitcoin and the number of blocks is extremely fast, which does not conform to the characteristics of the linear function. Therefore, in order to make them more in line with the characteristics of the linear function, we first take the logarithm of both. By observing the logarithmic graph of the price of Bitcoin and the number of blocks, we can find that after the logarithm transformation, the two are more in line with the characteristics of the linear function. Based on this feature, we choose the linear regression model to establish the prediction model.
From the graph below, we can see that the actual red and green K-line fluctuates around the predicted blue and 🟢green line. These predicted values are based on fundamental factors of Bitcoin, which support its value and reflect its reasonable value. This picture is consistent with the theory proposed by Marx in "Das Kapital" that "prices fluctuate around values."
The predicted logarithm of the market cap of Bitcoin is calculated through the model. The specific calculation formula of the Bitcoin price prediction value is as follows:
btc_predicted_marketcap = math.exp(btc_predicted_marketcap_log)
btc_predicted_price = btc_predicted_marketcap / btc_supply
🏃Step 3: Find indicators for early warning of bear market bottoms and bull market tops
📖Warning Indicator: How to Determine Whether the Bitcoin Price has Reached the Bear Market Bottom or the Bull Market Top?
By observing the Bitcoin price logarithmic prediction chart mentioned above, we notice that the actual price often falls below the predicted value at the bottom of a bear market; during the peak of a bull market, the actual price exceeds the predicted price. This pattern indicates that the deviation between the actual price and the predicted price can serve as an early warning signal. When the 🔴 Bitcoin price deviation is very low, as shown by the chart with 🟩green background, it usually means that we are at the bottom of the bear market; Conversely, when the 🔴 Bitcoin price deviation is very high, the chart with a 🟥red background indicates that we are at the peak of the bull market.
This pattern has been validated through six bull and bear markets, and the deviation value indeed serves as an early warning signal, which can be used as an important reference for us to judge market trends.
🏃Step 4:Predict Bitcoin Price in 2025
📖Price Upper Limit
According to the data calculated on March 10, 2023(If you want to check latest data, please contact with author), the 🟠upper limit of the Bitcoin price is $132,453, which is the price ceiling of this bull market. The peak of the last bull market was on November 9, 2021, at $68,664. The bull-bear market cycle is 4 years, so the highest point of this bull market is expected in 2025, and the 🟠upper limit of the Bitcoin price will exceed $130,000. The closing price of Bitcoin on March 10, 2024, was $68,515, with an expected increase of 90%.
🏃Step 5: Bitcoin 5A Strategy Formulation
📖Strategy: When to buy or sell, and how many to choose?
We introduce the Bitcoin 5A strategy. This strategy requires us to generate trading signals based on the critical values of the warning indicators, simulate the trades, and collect performance data for evaluation. In the Bitcoin 5A strategy, there are three key parameters: buying warning indicator, batch trading days, and selling warning indicator. Batch trading days are set to ensure that we can make purchases in batches after the trading signal is sent, thus buying at a lower price, selling at a higher price, and reducing the trading impact cost.
In order to find the optimal warning indicator critical value and batch trading days, we need to adjust these parameters repeatedly and perform backtesting. Backtesting is a method established by observing historical data, which can help us better understand market trends and trading opportunities.
Specifically, we can find the key trading points by watching the Bitcoin price log and the Bitcoin price deviation chart. For example, on August 25, 2015, the 🔴 Bitcoin price deviation was at its lowest value of -1.11; on December 17, 2017, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.69; on March 16, 2020, the 🔴 Bitcoin price deviation was at its lowest value at the time, -0.91; on March 13, 2021, the 🔴 Bitcoin price deviation was at its highest value at the time, 1.1; on December 31, 2022, the 🔴 Bitcoin price deviation was at its lowest value at the time, -1.
To ensure that all five key trading points generate trading signals, we set the warning indicator Bitcoin price deviation to the larger of the three lowest values, -0.9, and the smallest of the two highest values, 1. Then, we buy when the warning indicator Bitcoin price deviation is below -0.9, and sell when it is above 1.
In addition, we set the batch trading days as 25 days to implement a strategy that averages purchases and sales. Within these 25 days, we will invest all funds into the market evenly, buying once a day. At the same time, we also sell positions at the same pace, selling once a day.
📖Adjusting the threshold: a key step to optimizing trading strategy
Adjusting the threshold is an indispensable step for better performance. Here are some suggestions for adjusting the batch trading days and critical values of warning indicators:
• Batch trading days: Try different days like 25 to see how it affects overall performance.
• Buy and sell critical values for warning indicators: iteratively fine-tune the buy threshold value of -0.9 and the sell threshold value of 1 exhaustively to find the best combination of threshold values.
Through such careful adjustments, we may find an optimized approach with a lower maximum drawdown rate (e.g., 11%) and a higher cumulative return rate for closed trades (e.g., 474 times). The chart below is a backtest optimization chart for the Bitcoin 5A strategy, providing an intuitive display of strategy adjustments and optimizations.
In this way, we can better grasp market trends and trading opportunities, thereby achieving a more robust and efficient trading strategy.
🏃Step 6: Validating the performance of the Bitcoin 5A Strategy
📖Model accuracy validation: How to judge the accuracy of the Bitcoin price model?
The accuracy of the model is represented by the coefficient of determination R square, which reflects the degree of match between the predicted value and the actual value. I divided all the historical data from August 18, 2015 into two groups, and used the data from August 18, 2011 to August 18, 2015 as training data to generate the model. The calculation result shows that the coefficient of determination R squared during the 2011-2015 training period is as high as 0.81, which shows that the accuracy of this model is quite high. From the Bitcoin price logarithmic prediction chart in the figure below, we can see that the deviation between the predicted value and the actual value is not far, which means that most of the predicted values can explain the actual value well.
The calculation formula for the coefficient of determination R square is as follows:
residual = btc_close_log - btc_predicted_price_log
residual_square = residual * residual
train_residual_square_sum = math.sum(residual_square, train_days)
train_mse = train_residual_square_sum / train_days
train_r2 = 1 - train_mse / ta.variance(btc_close_log, train_days)
📖Model reliability verification: How to affirm the reliability of the Bitcoin price model when new data is available?
Model reliability is achieved through model verification. I set the last day of the training period to February 2, 2024 as the "verification group" and used it as verification data to verify the reliability of the model. This means that after generating the model if there is new data, I will use these new data together with the model for prediction, and then evaluate the accuracy of the model. If the coefficient of determination when using verification data is close to the previous training one and both remain at a high level, then we can consider this model as reliable. The coefficient of determination calculated from the validation period data and model prediction results is as high as 0.83, which is close to the previous 0.81, further proving the reliability of this model.
📖Performance evaluation: How to accurately evaluate historical backtesting results?
After detailed strategy testing, to ensure the accuracy and reliability of the results, we need to carry out a detailed performance evaluation on the backtest results. The key evaluation indices include:
• Net value curve: As shown in the rose line, it intuitively reflects the growth of the account net value. By observing the net value curve, we can understand the overall performance and profitability of the strategy.
The basic attributes of this strategy are as follows:
Trading range: 2015-8-19 to 2024-2-18, backtest range: 2011-8-18 to 2024-2-18
Initial capital: 1000USD, order size: 1 contract, pyramid: 50 orders, commission rate: 0.2%, slippage: 20 markers.
In the strategy tester overview chart, we also obtained the following key data:
• Net profit rate of closed trades: as high as 474 times, far exceeding the benchmark, as shown in the strategy tester performance summary chart, Bitcoin buys and holds 210 times.
• Number of closed trades and winning percentage: 100 trades were all profitable, showing the stability and reliability of the strategy.
• Drawdown rate & win-loose ratio: The maximum drawdown rate is only 11%, far lower than Bitcoin's 78%. Profit factor, or win-loose ratio, reached 500, further proving the advantage of the strategy.
Through these detailed evaluations, we can see clearly the excellent balance between risk and return of the Bitcoin 5A strategy.
⚠️Usage Restrictions: Strategy Application in Specific Situations
Please note that this strategy is designed specifically for Bitcoin and should not be applied to other assets or markets without authorization. In actual operations, we should make careful decisions according to our risk tolerance and investment goals.
BigBeluga - BacktestingThe Backtesting System (SMC) is a strategy builder designed around concepts of Smart Money.
What makes this indicator unique is that users can build a wide variety of strategies thanks to the external source conditions and the built-in one that are coded around concepts of smart money.
🔶 FEATURES
🔹 Step Algorithm
Crafting Your Strategy:
You can add multiple steps to your strategy, using both internal and external (custom) conditions.
Evaluating Your Conditions:
The system evaluates your conditions sequentially.
Only after the previous step becomes true will the next one be evaluated.
This ensures your strategy only triggers when all specified conditions are met.
Executing Your Strategy:
Once all steps in your strategy are true, the backtester automatically opens a market order.
You can also configure exit conditions within the strategy builder to manage your positions effectively.
🔹 External and Internal build-in conditions
Users can choose to use external or internal conditions or just one of the two categories.
Build-in conditions:
CHoCH or BOS
CHoCH or BOS Sweep
CHoCH
BOS
CHoCH Sweep
BOS Sweep
OB Mitigated
Price Inside OB
FVG Mitigated
Raid Found
Price Inside FVG
SFP Created
Liquidity Print
Sweep Area
Breakdown of each of the options:
CHoCH: Change of Character (not Charter) is a change from bullish to bearish market or vice versa.
BOS: Break of Structure is a continuation of the current trend.
CHoCH or BOS Sweep: Liquidity taken out from the market within the structure.
OB Mitigated: An order block mitigated.
FVG Mitigated: An imbalance mitigated.
Raid Found: Liquidity taken out from an imbalance.
SFP Created: A Swing Failure Pattern detected.
Liquidity Print: A huge chunk of liquidity taken out from the market.
Sweep Area: A level regained from the structure.
Price inside OB/FVG: Price inside an order block or an imbalance.
External inputs can be anything that is plotted on the chart that has valid entry points, such as an RSI or a simple Supertrend.
Equal
Greather Than
Less Than
Crossing Over
Crossing Under
Crossing
🔹 Direction
Users can change the direction of each condition to either Bullish or Bearish. This can be useful if users want to long the market on a bearish condition or vice versa.
🔹 Build-in Stop-Loss and Take-Profit features
Tailoring Your Exits:
Similar to entry creation, the backtesting system allows you to build multi-step exit strategies.
Each step can utilize internal and external (custom) conditions.
This flexibility allows you to personalize your exit strategy based on your risk tolerance and trading goals.
Stop-Loss and Take-Profit Options:
The backtesting system offers various options for setting stop-loss and take-profit levels.
You can choose from:
Dynamic levels: These levels automatically adjust based on market movements, helping you manage risk and secure profits.
Specific price levels: You can set fixed stop-loss and take-profit levels based on your comfort level and analysis.
Price - Set x point to a specific price
Currency - Set x point away from tot Currency points
Ticks - Set x point away from tot ticks
Percent - Set x point away from a fixed %
ATR - Set x point away using the Averge True Range (200 bars)
Trailing Stop (Only for stop-loss order)
🔶 USAGE
Users can create a variety of strategies using this script, limited only by their imagination.
Long entry : Bullish CHoCH after price is inside a bullish order block
Short entry : Bearish CHoCH after price is inside a bearish order block
Stop-Loss : Trailing Stop set away from price by 0.2%
Example below using external conditions
Long entry : Bullish Liquidity Prints after bullish CHoCH
Short entry : Bearish Liquidity Prints after Bearish CHoCH
Long Exit : RSI Crossing over 70 line
Short Exit : RSI Crossing over 30 line
Stop-Loss : Trailing Stop set away from price by 0.3%
🔶 PROPERTIES
Users will need to adjust the property tabs according to their individual balance to achieve realistic results.
An important aspect to note is that past performance does not guarantee future results. This principle should always be kept in mind.
🔶 HOW TO ACCESS
You can see the Author Instructions to get access.
CryptoGraph Dynamic DCAA system to backtest and automate comprehensive trading strategies
═════════════════════════════════════════════════════════════════════════
🟣 Supporting Your Trades
CryptoGraph Dynamic DCA serves as a comprehensive tool on TradingView, designed to refine your approach to cryptocurrency trading. It utilises dynamic dollar-cost averaging (DCA), based on external indicator sources, to provide structured market entry and exit strategies. Suitable for both short-term trading and long-term portfolio management, CryptoGraph Dynamic DCA can offer a methodical way to support your trading decisions.
The tool offers an intuitive interface with inputs for strategy customisation, visualised preferences, and bot alert configurations. It can assist traders seeking precision, adaptability, and control in their trading activities. In the example on the chart above, we use the CryptoGraph Entry Builder (part of CryptoGraph Dynamic DCA package) as an external source for our initial entry (base order) and our safety orders, as well as an external source for our second take profit, which can be configured to be signal based.
🟣 Features
External Entry/Exit sources: The strategy is designed to assist with accurate market entries and exits by utilising signals from external indicators. It offers the flexibility to tailor your trading approach, providing an opportunity to leverage the analytical capabilities of various indicators available on TradingView.
Strategic Direction Control: Configure your strategy to go long, short, or both, adapting to market trends and your trading style.
Leverage Customisation: Tailor your leverage settings for isolated or cross margin to align with your risk tolerance, a liquidation estimation level is plotted on the chart, based on your input settings.
Diverse Entry Points: Utilise base orders and safety orders to diversify your entry points, reducing risk and enhancing potential returns.
Tailored Order Size: Fine-tune your order sizes using margin percentages or fixed contract sizes to fit your strategy’s requirements.
Profit Taking & Loss Prevention: Set take profit levels and stop losses with percentage or ATR-based parameters to secure profits and minimise losses. Options for moving the stop loss to entry after Take Profit 1, with an adjustable buffer, give you control over your risk management.
Max Safety Orders Count: Determine the maximum number of safety orders to manage risk effectively.
Price Deviation for DCA Orders: Specify the minimum price deviation percentage to trigger DCA orders, ensuring strategic order placement.
DCA Size Method: Choose from scaling or fixed-size DCA orders to align with your capital allocation strategy.
Visualisation & Alerts: Analyse your strategy’s performance with a backtest results table and configure bot alerts for automated trading. Auto configuration methods are integrated for multiple automated trading platforms.
🟣 Features Impression
🟣 Usage Guide
1. Strategy Configuration:
Select the appropriate cryptocurrency pair and exchange that corresponds to your trading preferences.
Choose your desired chart timeframe to align with your trading strategy’s temporal scope.
Ensure that you’re utilising the regular candle type for consistent and reliable data interpretation.
Pick an external entry source to trigger your trades based on predefined indicators or conditions.
Determine your take profit and stop loss levels to manage risks and secure earnings effectively.
Configure your DCA (Dollar-Cost Averaging) settings, including safety orders and the scaling method, to enhance entry points and manage investment distribution.
Always consult the tooltips next to each strategy input, to better understand their functions.
2. Backtest and Analysis:
Run backtests with your configured parameters to assess the strategy’s potential performance.
Review the backtest results and statistics tables to understand the strategy’s effectiveness, risk profile, and profitability.
3. Automated Trading Platform Integration:
Connect the strategy to a compatible automated trading platform to enable real-time execution of trades.
Within the trading platform, ensure the proper API setup of the bot’s configuration to align with the signals from the tool.
4. Alert Configuration in TradingView:
Set up the alert conditions in the TradingView tool to match your strategy triggers for entry, exit, take profit, and stop loss.
Configure the connection parameters within the tool to communicate effectively with your chosen automated trading platform
Activate the alerts, ensuring they are set to trigger actions such as order placement, adjustments, or closures as per your strategy’s logic.
5. Capital Management:
Confirm that your initial capital and order size are logically set, keeping in mind that the sum of all deals, especially when using pyramiding with safety orders, should not exceed your initial capital to avoid overexposure.
🟣 Trade Example
A clear example of a trade. Base order entry, safety order 1 fills, take profit 1 hits at 1%, the remainder of the position runs until the exit signal fires.
🟣 Warning
This tool has been developed to support your trading analysis, yet it’s important to acknowledge the inherent risks associated with trading. It is advisable to perform thorough research, assess your risk tolerance, and utilise this tool as one element of an overall trading strategy. Ensure that you only trade with capital that you are prepared to risk. In addition, due to the complexity of the tool, bugs may be found. Please alert us whenever you think you have found a bug in the system.
Multi-TF AI SuperTrend with ADX - Strategy [PresentTrading]
## █ Introduction and How it is Different
The trading strategy in question is an enhanced version of the SuperTrend indicator, combined with AI elements and an ADX filter. It's a multi-timeframe strategy that incorporates two SuperTrends from different timeframes and utilizes a k-nearest neighbors (KNN) algorithm for trend prediction. It's different from traditional SuperTrend indicators because of its AI-based predictive capabilities and the addition of the ADX filter for trend strength.
BTC 8hr Performance
ETH 8hr Performance
## █ Strategy, How it Works: Detailed Explanation (Revised)
### Multi-Timeframe Approach
The strategy leverages the power of multiple timeframes by incorporating two SuperTrend indicators, each calculated on a different timeframe. This multi-timeframe approach provides a holistic view of the market's trend. For example, a 8-hour timeframe might capture the medium-term trend, while a daily timeframe could capture the longer-term trend. When both SuperTrends align, the strategy confirms a more robust trend.
### K-Nearest Neighbors (KNN)
The KNN algorithm is used to classify the direction of the trend based on historical SuperTrend values. It uses weighted voting of the 'k' nearest data points. For each point, it looks at its 'k' closest neighbors and takes a weighted average of their labels to predict the current label. The KNN algorithm is applied separately to each timeframe's SuperTrend data.
### SuperTrend Indicators
Two SuperTrend indicators are used, each from a different timeframe. They are calculated using different moving averages and ATR lengths as per user settings. The SuperTrend values are then smoothed to make them suitable for KNN-based prediction.
### ADX and DMI Filters
The ADX filter is used to eliminate weak trends. Only when the ADX is above 20 and the directional movement index (DMI) confirms the trend direction, does the strategy signal a buy or sell.
### Combining Elements
A trade signal is generated only when both SuperTrends and the ADX filter confirm the trend direction. This multi-timeframe, multi-indicator approach reduces false positives and increases the robustness of the strategy.
By considering multiple timeframes and using machine learning for trend classification, the strategy aims to provide more accurate and reliable trade signals.
BTC 8hr Performance (Zoom-in)
## █ Trade Direction
The strategy allows users to specify the trade direction as 'Long', 'Short', or 'Both'. This is useful for traders who have a specific market bias. For instance, in a bullish market, one might choose to only take 'Long' trades.
## █ Usage
Parameters: Adjust the number of neighbors, data points, and moving averages according to the asset and market conditions.
Trade Direction: Choose your preferred trading direction based on your market outlook.
ADX Filter: Optionally, enable the ADX filter to avoid trading in a sideways market.
Risk Management: Use the trailing stop-loss feature to manage risks.
## █ Default Settings
Neighbors (K): 3
Data points for KNN: 12
SuperTrend Length: 10 and 5 for the two different SuperTrends
ATR Multiplier: 3.0 for both
ADX Length: 21
ADX Time Frame: 240
Default trading direction: Both
By customizing these settings, traders can tailor the strategy to fit various trading styles and assets.
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!
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!
Double AI Super Trend Trading - Strategy [PresentTrading]█ Introduction and How It is Different
The Double AI Super Trend Trading Strategy is a cutting-edge approach that leverages the power of not one, but two AI algorithms, in tandem with the SuperTrend technical indicator. The strategy aims to provide traders with enhanced precision in market entry and exit points. It is designed to adapt to market conditions dynamically, offering the flexibility to trade in both bullish and bearish markets.
*The KNN part is mainly referred from @Zeiierman.
BTCUSD 8hr performance
ETHUSD 8hr performance
█ Strategy, How It Works: Detailed Explanation
1. SuperTrend Calculation
The SuperTrend is a popular indicator that captures market trends through a combination of the Volume-Weighted Moving Average (VWMA) and the Average True Range (ATR). This strategy utilizes two sets of SuperTrend calculations with varying lengths and factors to capture both short-term and long-term market trends.
2. KNN Algorithm
The strategy employs k-Nearest Neighbors (KNN) algorithms, which are supervised machine learning models. Two sets of KNN algorithms are used, each focused on different lengths of historical data and number of neighbors. The KNN algorithms classify the current SuperTrend data point as bullish or bearish based on the weighted sum of the labels of the k closest historical data points.
3. Signal Generation
Based on the KNN classifications and the SuperTrend indicator, the strategy generates signals for the start of a new trend and the continuation of an existing trend.
4. Trading Logic
The strategy uses these signals to enter long or short positions. It also incorporates dynamic trailing stops for exit conditions.
Local picture
█ Trade Direction
The strategy allows traders to specify their trading direction: long, short, or both. This enables the strategy to be versatile and adapt to various market conditions.
█ Usage
ToolTips: Comprehensive tooltips are provided for each parameter to guide the user through the customization process.
Inputs: Traders can customize numerous parameters including the number of neighbors in KNN, ATR multiplier, and types of moving averages.
Plotting: The strategy also provides visual cues on the chart to indicate bullish or bearish trends.
Order Execution: Based on the generated signals, the strategy will execute buy or sell orders automatically.
█ Default Settings
The default settings are configured to offer a balanced approach suitable for most scenarios:
Initial Capital: $10,000
Default Quantity Type: 10% of equity
Commission: 0.1%
Slippage: 1
Currency: USD
These settings can be modified to suit various trading styles and asset classes.
IU Break of any session StrategyHow this script works:
1. This script is an intraday trading strategy script which buy and sell on the bases of user-defined intraday session range breakout and gives alert(if the alert is set) message too when the new position is open.
2. It calculate the session as per the user inputs or user defined custom session.
3. The script stores the highest and lowest value of the whole session.
4. It take a long position on the first break and close above the highest value.
5. It take a short position on the break and close below the lowest value.
6. The script takes one position in one day.
7. The stop loss for this script is the previous low(if long) or high(if short).
8. Take profit is 1:2 and it's adjustable.
9. This script work on every kind of market.
How The Useful For The User :
1. User can backtest any session range breakout he wants to trade.
2. User can get alert when the new position is open.
3. User can change the Risk to Reward in order to find the best Risk to Reward.
4. User can see the highest and lowest value of the session with respect to analyzing his trading objective.
5. This strategy script highlights which session range breakout performs best and which performs worst.
AI SuperTrend - Strategy [presentTrading]
█ Introduction and How it is Different
The AI Supertrend Strategy is a unique hybrid approach that employs both traditional technical indicators and machine learning techniques. Unlike standard strategies that rely solely on traditional indicators or mathematical models, this strategy integrates the power of k-Nearest Neighbors (KNN), a machine learning algorithm, with the tried-and-true SuperTrend indicator. This blend aims to provide traders with more accurate, responsive, and context-aware trading signals.
*The KNN part is mainly referred from @Zeiierman.
BTCUSD 8hr performance
ETHUSD 8hr performance
█ Strategy, How it Works: Detailed Explanation
SuperTrend Calculation
Volume-Weighted Moving Average (VWMA): A VWMA of the close price is calculated based on the user-defined length (len). This serves as the central line around which the upper and lower bands are calculated.
Average True Range (ATR): ATR is calculated over a period defined by len. It measures the market's volatility.
Upper and Lower Bands: The upper band is calculated as VWMA + (factor * ATR) and the lower band as VWMA - (factor * ATR). The factor is a user-defined multiplier that decides how wide the bands should be.
KNN Algorithm
Data Collection: An array (data) is populated with recent n SuperTrend values. Corresponding labels (labels) are determined by whether the weighted moving average price (price) is greater than the weighted moving average of the SuperTrend (sT).
Distance Calculation: The absolute distance between each data point and the current SuperTrend value is calculated.
Sorting & Weighting: The distances are sorted in ascending order, and the closest k points are selected. Each point is weighted by the inverse of its distance to the current point.
Classification: A weighted sum of the labels of the k closest points is calculated. If the sum is closer to 1, the trend is predicted as bullish; if closer to 0, bearish.
Signal Generation
Start of Trend: A new bullish trend (Start_TrendUp) is considered to have started if the current trend color is bullish and the previous was not bullish. Similarly for bearish trends (Start_TrendDn).
Trend Continuation: A bullish trend (TrendUp) is considered to be continuing if the direction is negative and the KNN prediction is 1. Similarly for bearish trends (TrendDn).
Trading Logic
Long Condition: If Start_TrendUp or TrendUp is true, a long position is entered.
Short Condition: If Start_TrendDn or TrendDn is true, a short position is entered.
Exit Condition: Dynamic trailing stops are used for exits. If the trend does not continue as indicated by the KNN prediction and SuperTrend direction, an exit signal is generated.
The synergy between SuperTrend and KNN aims to filter out noise and produce more reliable trading signals. While SuperTrend provides a broad sense of the market direction, KNN refines this by predicting short-term price movements, leading to a more nuanced trading strategy.
Local picture
█ Trade Direction
The strategy allows traders to choose between taking only long positions, only short positions, or both. This is particularly useful for adapting to different market conditions.
█ Usage
ToolTips: Explains what each parameter does and how to adjust them.
Inputs: Customize values like the number of neighbors in KNN, ATR multiplier, and moving average type.
Plotting: Visual cues on the chart to indicate bullish or bearish trends.
Order Execution: Based on the generated signals, the strategy will execute buy/sell orders.
█ Default Settings
The default settings are selected to provide a balanced approach, but they can be modified for different trading styles and asset classes.
Initial Capital: $10,000
Default Quantity Type: 10% of equity
Commission: 0.1%
Slippage: 1
Currency: USD
By combining both machine learning and traditional technical analysis, this strategy offers a sophisticated and adaptive trading solution.