mikul's Ichimoku Cloud Strategy v 2.0This is an Ichimoku cloud (long) strategy with both pump signals and trend signals.
It has both ATR stop loss, trailing percentage stop loss and also ichomoku cloud exit signal.
You can also combine the ATR stop loss and the trailing percentage stop loss with the Ichimoku cloud exit signal and a the take profit percentage.
In this example I use the default ATR stop loss method for taking profit.
10000$ is my initial capital and I risking 10% every trade. Commission is set to 0.075%.
Everything is set to default in this example.
There is also a moving average filter that is available, set to 200 EMA and turned off by default.
Conditions for taking a long position:
Trend Signal:
• Positive cross above the cloud
• Chikou span(lagging span) above price action
• Price above the Cloud
Pump Signal:
• Cloud ahead of you is green
• Price above the cloud
• Positive cross (Doesn’t Matter Where)
• Chikou span(lagging span) above the cloud
Ichimoku cloud exit signals:
• Negative cross
• Chikou span(lagging span) touches the price action
This strategy is totally free as freedom and as in free beer!
I do this for myself, but I like sharing and I want everyone to have the ability to use what I make no matter your economic situation.
If you have any suggestions for this strategy or perhaps any filtering options that could be fun to experiment with, then please leave a comment with your suggestion and maybe I can add it to the next version.
Indicators and strategies
FlexiMA x FlexiST - Strategy [presentTrading]█ Introduction and How it is Different
The FlexiMA x FlexiST Strategy blends two analytical methods - FlexiMA and FlexiST, which are opened in my early post.
- FlexiMA calculates deviations between an indicator source and a dynamic moving average, controlled by a starting factor and increment factor.
- FlexiST, on the other hand, leverages the SuperTrend model, adjusting the Average True Range (ATR) length for a comprehensive trend-following oscillator.
This synergy offers traders a more nuanced and multifaceted tool for market analysis.
BTC 6H L/S Performance
Local
█ Strategy, How It Works: Detailed Explanation
The strategy combines two components: FlexiMA and FlexiST, each utilizing unique methodologies to analyze market trends.
🔶FlexiMA Component:
- Calculates deviations between an indicator source and moving averages of variable lengths.
- Moving average lengths are dynamically adjusted using a starting factor and increment factor.
- Deviations are normalized and analyzed to produce median and standard deviation values, forming the FlexiMA oscillator.
Length indicator (50)
🔶FlexiST Component:
- Uses SuperTrend indicators with varying ATR (Average True Range) lengths.
- Trends are identified based on the position of the indicator source relative to the SuperTrend bands.
- Deviations between the indicator source and SuperTrend values are calculated and normalized.
Starting Factor (5)
🔶Combined Strategy Logic:
- Entry Signals:
- Long Entry: Triggered when median values of both FlexiMA and FlexiST are positive.
- Short Entry: Triggered when median values of both FlexiMA and FlexiST are negative.
- Exit Signals:
- Long Exit: Triggered when median values of FlexiMA or FlexiST turn negative.
- Short Exit: Triggered when median values of FlexiMA or FlexiST turn positive.
This strategic blend of FlexiMA and FlexiST allows for a nuanced analysis of market trends, providing traders with signals based on a comprehensive view of market momentum and trend strength.
█ Trade Direction
The strategy is designed to cater to various trading preferences, offering "Long", "Short", and "Both" options. This flexibility allows traders to align the strategy with their specific market outlook, be it bullish, bearish, or a combination of both.
█ Usage
Traders can effectively utilize the FlexiMA x FlexiST Strategy by first selecting their desired trade direction. The strategy then generates entry signals when the conditions for either the FlexiMA or FlexiST are met, indicating potential entry points in the market. Conversely, exit signals are generated when the conditions for these indicators diverge, thus signaling a potential shift in market trends and suggesting a strategic exit point.
█ Default Settings
1. Indicator Source (HLC3): Provides a balanced and stable price source, reducing the impact of extreme market fluctuations.
2. Indicator Lengths (20 for FlexiMA, 10 for FlexiST): Longer FlexiMA length smooths out short-term fluctuations, while shorter FlexiST length allows for quicker response to market changes.
3. Starting Factors (1.0 for FlexiMA, 0.618 for FlexiST): Balanced start for FlexiMA and a harmonized approach for FlexiST, resonating with natural market cycles.
4. Increment Factors (1.0 for FlexiMA, 0.382 for FlexiST): FlexiMA captures a wide range of market behaviors, while FlexiST provides a gradual transition to capture finer trend shifts.
5. Normalization Methods ('None'): Uses raw deviations, suitable for markets where absolute price movements are more significant.
6. Trade Direction ('Both'): Allows strategy to consider both long and short opportunities, ideal for versatile market engagement.
*More details:
1. FlexiMA
2. FlexiST
5 ema strategyThis Strategy is based of Subhashish Pani's (power of stocks) 5 EMA Strategy.strategy used for sell in 5 minutes and for buy in 15 minutes ..
Rules for this strategy ..
Sell signal -
1) if price is above 5 Ema and not touching Ema use as alert candle..
2) if price break low of alert candle strategy open trade ..
3) if price move more upside low of alert candle keep change into next candle ..
4) input we can select number of trade per day .as rule should take only 4 signal should execute
5) stop loss is fixed highest high of last 2 candle and take profit is input multiply of stop loss
buy signal-
1) if price is below 5 Ema and not touching Ema use as alert candle..
2) if price break high of alert candle strategy open trade ..
3) if price move more downside high of alert candle keep change into next candle ..
4) input we can select number of trade per day .as rule should take only 4 signal should execute
5) stop loss is fixed lowest low of last 2 candle and take profit is input multiply of stop loss
notes -input can be selected which side should take signal either buy or sell side ...number of trade can be adjusted ..
Disclaimer -Traders can use this script as a starting point for further customization or as a reference for developing their own trading strategies. It's important to note that past performance is not indicative of future results, and thorough testing and validation are recommended before deploying any trading strategy.
CCI based support and resistance strategy
WARNING:
Commissions and slippage has not been considered! Don’t take it easy adding commissions and slippage could turns a fake-profitable strategy to a real disaster.
We consider account size as 10k and we enter 1000 for each trade.
Less than 100 trades is too small sample community and it’s not reliable, Also the performance of the past do not guarantee future performance. This result was handpicked by author and will differ by other timeframes, instruments and settings.
*PLEASE SHARE YOUR SETTINGS THAT WORK WITH THE COMMUNITY.
Introduction:
The CCI-based dynamic support and resistance is a "Bands and Channels" kind of indicator consisting an upper and lower band. This is a strategy which uses CCI-based (Made by me) indicator to execute trades.
SL and TP are calculated based on max ATR during last selected time period. You can edit strategy settings using "Ksl", "Ktp" and the other button for time period. “KSL” and “KTP” are 2.5 and 5 by default.
Bands are calculated regarding CCI previous high and low pivot. CCI length, right pivot length and left pivot length are 50.
A dynamic support and resistance has been calculated using last upper-cci minus a buffer and last lower-cci plus the buffer. The buffer is 10.
If "Trend matter?" button is on you can detect trend by color of the upper and lower line. Green is bullish and red is bearish! "Trend matter?" is on.
The "show mid?" button makes mid line visible, which is average of upper and lower lines, visible. The button is not active by default.
Reaction to the support could be a buy signal while a reaction to the resistance could interpreted as a sell signal.
How this strategy work?
Donald Lambert, a technical analyst, created the CCI, or Commodity Channel Index, which he first published in 1980. CCI is calculated regarding CCI can be used both as trend-detector or an oscillator. As an oscillator most traders believe in static predefined levels. Overbought and oversold candles which are clear in the chart could be used as sell and buy signals.
During my trading career I’ve noticed that there might be some reversal points for the CCI. I believe CCI could have to potential to reverse more from lately reversal point. Of course, just like other trading strategies we are talking about probabilities. We do not expect a win trade each time.
On price chart
Now this the question! What price should the instrument reach that CCI turns to be equal to our reversing aim for CCI? Imagine we have found last important bearish reversal of CCI in 200. Now, if we need the CCI to be 200 what price should we wait for?
How to calculate?
This is the CCI formula:
CCI = (Typical Price - SMA of TP) / (0.015 x Mean Deviation)
Where, Typical Price (TP) = (High + Low + Close)/3
For probable reversing points, high and low pivots of 50 bars have been used.
So we do have an Upper CCI and a Lower CCI. They are valid until the next pivot is available.
By relocating factors in CCI formula you can reach the “Typical Price”.
“
Typical Price = CCI (0.015 * Mean Deviation) + SMA of TP
So we could have a Support or Resistance by replacing CCI with Upper and Lower CCI.
A buy signal is valid if the trend is bullish (or “trend matter” is off) and lowest low of last 2 candles is lower than support and close is greater than both support and open.
A Sell signal is produced in opposite situation.
There are 2+1 options for trend!
Trend matter box is on by default, which means we’ll just open trades in direction of the trend. It’s available to turn it off.
Other 2 options are cross and slope. Cross calculated by comparing fast SMA and slow SMA. The slope one differentiate slow SMA to last “n” one.
Considering last day and today highest ATR as the ATR to calculating SL and TP is our unique technique.
Hulk Grid Algorithm V2 - The Quant ScienceIt's the latest proprietary grid algorithm developed by our team. This software represents a clearer and more comprehensive modernization of the deprecated Hulk Grid Algorithm. In this new release, we have optimized the source code architecture and investment logic, which we will describe in detail below.
Overview
Hulk Grid Algorithm V2 is designed to optimize returns in sideways market conditions. In this scenario, the algorithm divides purchases with long orders at each level of the grid. Unlike a typical grid algorithm, this version applies an anti-martingale model to mitigate volatility and optimize the average entry price. Starting from the lower level, the purchase quantity is increased at each new subsequent level until reaching the upper level. The initial quantity of the first order is fixed at 0.50% of the initial capital. With each new order, the initial quantity is multiplied by a value equal to the current grid level (where 1 is the lower level and 10 is the upper level).
Example: Let's say we have an initial capital of $10,000. The initial capital for the first order would be $50 * 1 = $50, for the second order $50 * 2 = $100, for the third order $50 * 3 = $150, and so on until reaching the upper level.
All previously opened orders are closed using a percentage-based stop-loss and take-profit, calculated based on the extremes of the grid.
Set Up
As mentioned earlier, the user's goal is to analyze this strategy in markets with a lack of trend, also known as sideways markets. After identifying a price range within which the asset tends to move, the user can choose to create the grid by placing the starting price at the center of the range. This way, they can consider trading the asset, if the backtesting generates a return greater than the Buy & Hold return.
Grid Configuration
To create the grid, it's sufficient to choose the starting price during the launch phase. This level will be the center of the grid from which the upper and lower levels will be calculated. The grid levels are computed using an arithmetic method, adding and subtracting a configurable fixed amount from the user interface (Grid Step $).
Example: Let's imagine choosing 1000 as the starting price and 50 as the Grid Step ($). The upper levels will be 1000, 1050, 1100, 1150, 1200. The lower levels will be 950, 900, 850, 800, and 750.
Markets
This software can be used in all markets: stocks, indices, commodities, cryptocurrencies, ETFs, Forex, etc.
Application
With this backtesting software, is possible to analyze the strategy and search for markets where it can generate better performance than Buy & Hold returns. There are no alerts or automatic investment mechanisms, and currently, the strategy can only be executed manually.
Design
Is possible to modify the grid style and customize colors by accessing the Properties section of the user interface.
Pivot Percentile Trend - Strategy [presentTrading]
█ Introduction and How it is Different
The "Pivot Percentile Trend - Strategy" from PresentTrading represents a paradigm shift in technical trading strategies. What sets this strategy apart is its innovative use of pivot percentiles, a method that goes beyond traditional indicator-based analyses. Unlike standard strategies that might depend on single-dimensional signals, this approach takes a multi-layered view of market movements, blending percentile calculations with SuperTrend indicators for a more nuanced and dynamic market analysis.
This strategy stands out for its ability to process multiple data points across various timeframes and pivot lengths, thereby capturing a broader and more detailed picture of market trends. It's not just about following the price; it's about understanding its position in the context of recent historical highs and lows, offering a more profound insight into potential market movements.
BTC 6h L/S
Where traditional methods might react to market changes, the Pivot Percentile Trend strategy anticipates them, using a calculated approach to identify trend strengths and weaknesses. This foresight gives traders a significant advantage, allowing for more strategic decision-making and potentially increasing the chances of successful trades.
In essence, this strategy introduces a more comprehensive and proactive approach to trading, harnessing the power of advanced percentile calculations combined with the robustness of SuperTrend indicators. It's a strategy designed for traders who seek a deeper understanding of market dynamics and a more calculated approach to their trading decisions.
Local picture
█ Strategy, How It Works: Detailed Explanation
🔶 Percentile Calculations
- The strategy employs percentile calculations to assess the relative position of current market prices against historical data.
- For a set of lengths (e.g., `length * 1`, `length * 2`, up to `length * 7`), it calculates the 75th percentile for high values (`percentilesHigh`) and the 25th percentile for low values (`percentilesLow`).
- These percentiles provide a sense of where the current price stands compared to recent price ranges.
Length - 10
Length - 15
🔶 SuperTrend Indicator
- The SuperTrend indicator is a key component, providing trend direction signals.
- It uses the `currentTrendValue`, derived from the difference between bull and bear strengths calculated from the percentile data.
* used the Supertrend toolkit by @EliCobra
🔶 Trend Strength Counts
- The strategy calculates counts of bullish and bearish indicators based on comparisons between the current high and low against high and low percentiles.
- `countBull` and `countBear` track the number of times the current high is above the high percentiles and the current low is below the low percentiles, respectively.
- Weak bullish (`weakBullCount`) and bearish (`weakBearCount`) counts are also determined by how often the current lows and highs fall within the percentile range.
*The idea of this strength counts mainly comes from 'Trend Strength Over Time' @federalTacos5392b
🔶 Trend Value Calculation
- The `currentTrendValue` is a crucial metric, computed as `bullStrength - bearStrength`.
- It indicates the market's trend direction, where a positive value suggests a bullish trend and a negative value indicates a bearish trend.
🔶 Trade Entry and Exit Logic
- The entry points for trades are determined by the combination of the trend value and the direction indicated by the SuperTrend indicator.
- For a long entry (`shouldEnterLong`), the `currentTrendValue` must be positive and the SuperTrend indicator should show a downtrend.
- Conversely, for a short entry (`shouldEnterShort`), the `currentTrendValue` should be negative with the SuperTrend indicating an uptrend.
- The strategy closes positions when these conditions reverse.
█ Trade Direction
The strategy is versatile, allowing traders to choose their preferred trading direction: long, short, or both. This flexibility enables traders to tailor their strategies to their market outlook and risk appetite.
█ Default Settings and Customization
1. Trade Direction: Selectable as Long, Short, or Both, affecting the type of trades executed.
2. Indicator Source: Pivot Percentile Calculations, key for identifying market trends and reversals.
3. Lengths for Percentile Calculation: Various configurable lengths, influencing the scope of trend analysis.
4. SuperTrend Settings: ATR Length 20, Multiplier 18, affecting indicator sensitivity and trend detection.
5. Style Options: Custom colors for bullish (green) and bearish (red) trends, aiding visual interpretation.
6. Additional Settings: Includes contrarian signals and UI enhancements, offering strategic and visual flexibility.
Zero-lag Volatility-Breakout EMA Trend StrategyThis is a simple volatility-breakout strategy which uses the difference in two different zero-lag* EMAs (explained below on what exactly I mean by this) to track the upwards or downwards strength of an instrument. When the difference breaks above a Bollinger Band of a configurable standard deviation multiple, the strategy enters based off the direction of the base EMA used (i.e. if the difference breaks above and the current EMA is rising, a long entry is produced. If the difference breaks above and the current EMA is falling, a short entry is produced).
The two EMA-type metrics used to calculate the volatility difference are calculated by the following formula:
top_ema = math.max(src, ta.ema(src, length))
bottom_ema = math.min(src, ta.ema(src, length))
ema_difference = (top_ema - bottom_ema) - 1
This produces a difference which responds immediately to large price movements, instead of lagging if it used strictly the EMA itself.
SETTINGS
Source : The source of the strategy - close, hlc3, another indicator plot, etc.
EMA Difference Length : The length of both the EMA difference statistics and the base EMA used to calculate the entry side.
Standard Deviation Multiple : The Bollinger Bands multiple used when the difference is breaking out.
Use Binary Strategy : The strategy has two configurations: Binary and Rapid-Exit. 'Binary' means that it will not close a long position until a short position is generated, and vice-versa. 'Rapid-Exit' will close a long or short position once the difference reaches the middle Bollinger Band MA. This means that turning on 'Binary' will expose you to more market risk, but potentially greater market return. Turning off 'Binary' will exit quickly and reduce drawdown.
The strategy results below use 10% equity and 0.1% fees per trade.
Megabar Breakout (Range & Volume & RSI)Hey there,
This strategy is based on the idea that certain events lead to what are called Megabars. Megabars are bars that have a very large range and volume. I wanted to verify whether these bars indicate the start of a trend and whether one should follow the trend.
Summary of the Code:
The code is based on three indicators: the range of the bar, the volume of the bar, and the RSI. When certain values of these indicators are met, a Megabar is identified. The direction of the Megabar indicates the direction in which we should trade.
Why do I combine these indicators?
I want to identify special bars that have the potential to mark the beginning of a breakout. Therefore, a bar needs to exhibit high volume, have a large range (huge price movement), and we also use the Relative Strength Index (RSI) to assess potential momentum. Only if all three criteria are met within one candle, do we use this as an identifier for a megabar.
Explanation of Drawings on the Chart:
As you can see, there is a green background on my chart. The green background symbolizes the time when I'm entering a trade. Only if a Megabar happens during that time, I'm ready to enter a trade. The time is between 6 AM and 4 PM CET. It's just because I prefer that time. Also, the strategy draws an error every time a Megabar happens based on VOL and Range only (not on the RSI). That makes it pretty easy to go through your chart and check the biggest bars manually. You can activate or deactivate these settings via the input data of the strategy.
When Do We Enter a Trade?
We wait for a Megabar to happen during our trading session. If the Megabar is bullish, we open a LONG trade at the opening price of the next candle. If the Megabar is bearish, we open a SHORT trade at the opening price of the next candle.
Where Do We Put Our Take Profit & Stop Loss?
The default setting is TP = 40 Pips and SL = 30 Pips. In that case, we are always trading with a risk-reward ratio of 1.33 by default. You can easily change these settings via the input data of the strategy.
Strategy Results
The criteria for Megabars were chosen by me in a way that makes Megabars something special. They are not intended to occur too frequently, as the fundamental idea of this strategy would otherwise not hold. This results in only 37 closed trades within the last 12 months. If you change the criterias for a megabar to a milder one, you will create more Megabars and therefore more trades. It's up to you. I have adapted this strategy to the 30-minute chart of the EURUSD. In the evaluation, we consider a period of 12 months, which I believe is sufficient.
My default settings for the indicators look like this:
Avg Length Vol 20
Avg Multiplier Vol 3
Avg Length Range 20
Avg Multiplier Range 4
Value SMA RSI for Long Trades 50
Value SMA RSI for Short Trades 70
IMPORTANT: The current performance overview does not display the results of these settings. Please change the settings to my default ones so that you can see how I use this strategy.
I do not recommend trading this strategy without further testing. The script is meant to reflect a basic idea and be used as a tool to identify Megabars. I have made this strategy completely public so that it can be further developed. One can take this framework and test it on different timeframes and different markets.
FlexiSuperTrend - Strategy [presentTrading]█ Introduction and How it is Different
The "FlexiSuperTrend - Strategy" by PresentTrading is a cutting-edge trading strategy that redefines market analysis through the integration of the SuperTrend indicator and advanced variance tracking.
BTC 6H L/S
This strategy stands apart from conventional methods by its dynamic adaptability, capturing market trends and momentum shifts with increased sensitivity. It's designed for traders seeking a more responsive tool to navigate complex market movements.
Local
█ Strategy, How It Works: Detailed Explanation
The "FlexiSuperTrend - Strategy" employs a multifaceted approach, combining the adaptability of the SuperTrend indicator with variance tracking. The strategy's core lies in its unique formulation and application of these components:
🔶 SuperTrend Polyfactor Oscillator:
- Basic Concept: The oscillator is a series of SuperTrend calculations with varying ATR lengths and multipliers. This approach provides a broader and more nuanced perspective of market trends.
- Calculation:
- For each iteration, `i`, the SuperTrend is calculated using:
- `ATR Length = indicatorLength * (startingFactor + i * incrementFactor)`.
- `Multiplier = dynamically adjusted based on market conditions`.
- The SuperTrend output for each iteration is compared with the indicator source (like hlc3), and the deviation is recorded.
SuperTrend Calculation:
- `Upper Band (UB) = hl2 + (ATR Length * Multiplier)`
- `Lower Band (LB) = hl2 - (ATR Length * Multiplier)`
- Where `hl2` is the average of high and low prices.
Deviation Calculation:
- `Deviation = indicatorSource - SuperTrend Value`
- This value is calculated for each SuperTrend setting in the oscillator series.
🔶 Indicator Source (`hlc3`):
- **Usage:** The strategy uses the average of high, low, and close prices, providing a balanced representation of market activity.
🔶 Adaptive ATR Lengths and Factors:
- Dynamic Adjustment: The strategy adjusts the ATR length and multiplier based on the `startingFactor` and `incrementFactor`. This adaptability is key in responding to changing market volatilities.
- Equation: ATR Length at each iteration `i` is given by `len = indicatorLength * (startingFactor + i * incrementFactor)`.
incrementFactor - 1
incrementFactor - 2
🔶 Normalization Methods:
Purpose: To standardize the deviations for comparability.
- Methods:
- 'Max-Min': Scales the deviation based on the range of values.
- 'Absolute Sum': Uses the sum of absolute deviations for normalization.
Normalization 'Absolute Sum'
- For 'Max-Min': `Normalized Deviation = (Deviation - Min(Deviations)) / (Max(Deviations) - Min(Deviations))`
- For 'Absolute Sum': `Normalized Deviation = Deviation / Sum(Absolute(Deviations))`
🔶 Trading Logic:
The strategy integrates the SuperTrend indicator, renowned for its effectiveness in identifying trend direction and reversals. The SuperTrend's incorporation enhances the strategy's ability to filter out false signals and confirm genuine market trends. * The SuperTrend Toolkit is made by @QuantiLuxe
- Long Entry Conditions: A buy signal is generated when the current trend, as indicated by the SuperTrend Polyfactor Oscillator, turns positive.
- Short Entry Conditions: A sell signal is triggered when the current trend turns negative.
- Entry and Exit Strategy: The strategy opens or closes positions based on these signals, aligning with the selected trade direction (long, short, or both).
█ Trade Direction
The strategy is versatile, allowing traders to choose their preferred trading direction: long, short, or both. This flexibility enables traders to tailor their strategies to their market outlook and risk appetite.
█ Usage
The FlexiSuperTrend strategy is suitable for various market conditions and can be adapted to different asset classes and time frames. Traders should set the strategy parameters according to their risk tolerance and trading goals. It's particularly useful for capturing long-term movements, ideal for swing traders, yet adaptable for short-term trading strategies.
█ Default Settings
1. Trading Direction: Choose from "Long", "Short", or "Both" to define the trade type.
2. Indicator Source (HLC3): Utilizes the HLC3 as the primary price reference.
3. Indicator Length (Default: 10): Influences the moving average calculation and trend sensitivity.
4. Starting Factor (0.618): Initiates the ATR length, influenced by Fibonacci ratios.
5. Increment Factor (0.382): Adjusts the ATR length incrementally for dynamic trend tracking.
6. Normalization Method: Options include "None", "Max-Min", and "Absolute Sum" for scaling deviations.
7. SuperTrend Settings: Varied ATR lengths and multipliers tailor the indicator's responsiveness.
8. Additional Settings: Features mesh style plotting and customizable colors for visual distinction.
The default settings provide a balanced approach, but users are encouraged to adjust them based on their individual trading style and market analysis.
The Flash-Strategy with Minervini Stage Analysis QualifierThe Flash-Strategy (Momentum-RSI, EMA-crossover, ATR) with Minervini Stage Analysis Qualifier
Introduction
Welcome to a comprehensive guide on a cutting-edge trading strategy I've developed, designed for the modern trader seeking an edge in today's dynamic markets. This strategy, which I've honed through my years of experience in the trading arena, stands out for its unique blend of technical analysis and market intuition, tailored specifically for use on the TradingView platform.
As a trader with a deep passion for the financial markets, my journey began several years ago, driven by a relentless pursuit of a trading methodology that is both effective and adaptable. My background in trading spans various market conditions and asset classes, providing me with a rich tapestry of experiences from which to draw. This strategy is the culmination of that journey, embodying the lessons learned and insights gained along the way.
The cornerstone of this strategy lies in its ability to generate precise long signals in a Stage 2 uptrend and equally accurate short signals in a Stage 4 downtrend. This approach is rooted in the principles of trend following and momentum trading, harnessing the power of key indicators such as the Momentum-RSI, EMA Crossover, and Average True Range (ATR). What sets this strategy apart is its meticulous design, which allows it to adapt to the ever-changing market conditions, providing traders with a robust tool for navigating both bullish and bearish scenarios.
This strategy was born out of a desire to create a trading system that is not only highly effective in identifying potential trade setups but also straightforward enough to be implemented by traders of varying skill levels. It's a reflection of my belief that successful trading hinges on clarity, precision, and disciplined execution. Whether you are a seasoned trader or just beginning your journey, this guide aims to provide you with a comprehensive understanding of how to harness the full potential of this strategy in your trading endeavors.
In the following sections, we will delve deeper into the mechanics of the strategy, its implementation, and how to make the most out of its features. Join me as we explore the nuances of a strategy that is designed to elevate your trading to the next level.
Stage-Specific Signal Generation
A distinctive feature of this trading strategy is its focus on generating long signals exclusively during Stage 2 uptrends and short signals during Stage 4 downtrends. This approach is based on the widely recognized market cycle theory, which divides the market into four stages: Stage 1 (accumulation), Stage 2 (uptrend), Stage 3 (distribution), and Stage 4 (downtrend). By aligning the signal generation with these specific stages, the strategy aims to capitalize on the most dynamic and clear-cut market movements, thereby enhancing the potential for profitable trades.
1. Long Signals in Stage 2 Uptrends
• Characteristics of Stage 2: Stage 2 is characterized by a strong uptrend, where prices are consistently rising. This stage typically follows a period of accumulation (Stage 1) and is marked by increased investor interest and bullish sentiment in the market.
• Criteria for Long Signal Generation: Long signals are generated during this stage when the technical indicators align with the characteristics of a Stage 2 uptrend.
• Rationale for Stage-Specific Signals: By focusing on Stage 2 for long trades, the strategy seeks to enter positions during the phase of strong upward momentum, thus riding the wave of rising prices and investor optimism. This stage-specific approach minimizes exposure to less predictable market phases, like the consolidation in Stage 1 or the indecision in Stage 3.
2. Short Signals in Stage 4 Downtrends
• Characteristics of Stage 4: Stage 4 is identified by a pronounced downtrend, with declining prices indicating prevailing bearish sentiment. This stage typically follows the distribution phase (Stage 3) and is characterized by increasing selling pressure.
• Criteria for Short Signal Generation: Short signals are generated in this stage when the indicators reflect a strong bearish trend.
• Rationale for Stage-Specific Signals: Targeting Stage 4 for shorting capitalizes on the market's downward momentum. This tactic aligns with the natural market cycle, allowing traders to exploit the downward price movements effectively. By doing so, the strategy avoids the potential pitfalls of shorting during the early or late stages of the market cycle, where trends are less defined and more susceptible to reversals.
In conclusion, the strategy’s emphasis on stage-specific signal generation is a testament to its sophisticated understanding of market dynamics. By tailoring the long and short signals to Stages 2 and 4, respectively, it leverages the most compelling phases of the market cycle, offering traders a clear and structured approach to aligning their trades with dominant market trends.
Strategy Overview
At the heart of this trading strategy is a philosophy centered around capturing market momentum and trend efficiency. The core objective is to identify and capitalize on clear uptrends and downtrends, thereby allowing traders to position themselves in sync with the market's prevailing direction. This approach is grounded in the belief that aligning trades with these dominant market forces can lead to more consistent and profitable outcomes.
The strategy is built on three foundational components, each playing a critical role in the decision-making process:
1. Momentum-RSI (Relative Strength Index): The Momentum-RSI is a pivotal element of this strategy. It's an enhanced version of the traditional RSI, fine-tuned to better capture the strength and velocity of market trends. By measuring the speed and change of price movements, the Momentum-RSI provides invaluable insights into whether a market is potentially overbought or oversold, suggesting possible entry and exit points. This indicator is especially effective in filtering out noise and focusing on substantial market moves.
2. EMA (Exponential Moving Average) Crossover: The EMA Crossover is a crucial component for trend identification. This strategy employs two EMAs with different timeframes to determine the market trend. When the shorter-term EMA crosses above the longer-term EMA, it signals an emerging uptrend, suggesting a potential long entry. Conversely, a crossover below indicates a possible downtrend, hinting at a short entry opportunity. This simple yet powerful tool is key in confirming trend directions and timing market entries.
3. ATR (Average True Range): The ATR is instrumental in assessing market volatility. This indicator helps in understanding the average range of price movements over a given period, thus providing a sense of how much a market might move on a typical day. In this strategy, the ATR is used to adjust stop-loss levels and to gauge the potential risk and reward of trades. It allows for more informed decisions by aligning trade management techniques with the current volatility conditions.
The synergy of these three components – the Momentum-RSI, EMA Crossover, and ATR – creates a robust framework for this trading strategy. By combining momentum analysis, trend identification, and volatility assessment, the strategy offers a comprehensive approach to navigating the markets. Whether it's capturing a strong trend in its early stages or identifying a potential reversal, this strategy aims to provide traders with the tools and insights needed to make well-informed, strategically sound trading decisions.
Detailed Component Analysis
The efficacy of this trading strategy hinges on the synergistic functioning of its three key components: the Momentum-RSI, EMA Crossover, and Average True Range (ATR). Each component brings a unique perspective to the strategy, contributing to a well-rounded approach to market analysis.
1. Momentum-RSI (Relative Strength Index)
• Definition and Function: The Momentum-RSI is a modified version of the classic Relative Strength Index. While the traditional RSI measures the velocity and magnitude of directional price movements, the Momentum-RSI amplifies aspects that reflect trend strength and momentum.
• Significance in Identifying Trend Strength: This indicator excels in identifying the strength behind a market's move. A high Momentum-RSI value typically indicates strong bullish momentum, suggesting the potential continuation of an uptrend. Conversely, a low Momentum-RSI value signals strong bearish momentum, possibly indicative of an ongoing downtrend.
• Application in Strategy: In this strategy, the Momentum-RSI is used to gauge the underlying strength of market trends. It helps in filtering out minor fluctuations and focusing on significant movements, providing a clearer picture of the market's true momentum.
2. EMA (Exponential Moving Average) Crossover
• Definition and Function: The EMA Crossover component utilizes two exponential moving averages of different timeframes. Unlike simple moving averages, EMAs give more weight to recent prices, making them more responsive to new information.
• Contribution to Market Direction: The interaction between the short-term and long-term EMAs is key to determining market direction. A crossover of the shorter EMA above the longer EMA is an indicator of an emerging uptrend, while a crossover below signals a developing downtrend.
• Application in Strategy: The EMA Crossover serves as a trend confirmation tool. It provides a clear, visual representation of the market's direction, aiding in the decision-making process for entering long or short positions. This component ensures that trades are aligned with the prevailing market trend, a crucial factor for the success of the strategy.
3. ATR (Average True Range)
• Definition and Function: The ATR is an indicator that measures market volatility by calculating the average range between the high and low prices over a specified period.
• Role in Assessing Market Volatility: The ATR provides insights into the typical market movement within a given timeframe, offering a measure of the market's volatility. Higher ATR values indicate increased volatility, while lower values suggest a calmer market environment.
• Application in Strategy: Within this strategy, the ATR is instrumental in tailoring risk management techniques, particularly in setting stop-loss levels. By accounting for the market's volatility, the ATR ensures that stop-loss orders are placed at levels that are neither too tight (risking premature exits) nor too loose (exposing to excessive risk).
In summary, the combination of Momentum-RSI, EMA Crossover, and ATR in this trading strategy provides a comprehensive toolkit for market analysis. The Momentum-RSI identifies the strength of market trends, the EMA Crossover confirms the market direction, and the ATR guides in risk management by assessing volatility. Together, these components form the backbone of a strategy designed to navigate the complexities of the financial markets effectively.
1. Signal Generation Process
• Combining Indicators: The strategy operates by synthesizing signals from the Momentum-RSI, EMA Crossover, and ATR indicators. Each indicator serves a specific purpose: the Momentum-RSI gauges trend momentum, the EMA Crossover identifies the trend direction, and the ATR assesses the market’s volatility.
• Criteria for Signal Validation: For a signal to be considered valid, it must meet specific criteria set by each of the three indicators. This multi-layered approach ensures that signals are not only based on one aspect of market behavior but are a result of a comprehensive analysis.
2. Conditions for Long Positions
• Uptrend Confirmation: A long position signal is generated when the shorter-term EMA crosses above the longer-term EMA, indicating an uptrend.
• Momentum-RSI Alignment: Alongside the EMA crossover, the Momentum-RSI should indicate strong bullish momentum. This is typically represented by the Momentum-RSI being at a high level, confirming the strength of the uptrend.
• ATR Consideration: The ATR is used to fine-tune the entry point and set an appropriate stop-loss level. In a low volatility scenario, as indicated by the ATR, the stop-loss can be set tighter, closer to the entry point.
3. Conditions for Short Positions
• Downtrend Confirmation: Conversely, a short position signal is indicated when the shorter-term EMA crosses below the longer-term EMA, signaling a downtrend.
• Momentum-RSI Confirmation: The Momentum-RSI should reflect strong bearish momentum, usually seen when the Momentum-RSI is at a low level. This confirms the bearish strength of the market.
• ATR Application: The ATR again plays a role in determining the stop-loss level for the short position. Higher volatility, as indicated by a higher ATR, would warrant a wider stop-loss to accommodate larger market swings.
By adhering to these mechanics, the strategy aims to ensure that each trade is entered with a high probability of success, aligning with the market’s current momentum and trend. The integration of these indicators allows for a holistic market analysis, providing traders with clear and actionable signals for both entering and exiting trades.
Customizable Parameters in the Strategy
Flexibility and adaptability are key features of this trading strategy, achieved through a range of customizable parameters. These parameters allow traders to tailor the strategy to their individual trading style, risk tolerance, and specific market conditions. By adjusting these parameters, users can fine-tune the strategy to optimize its performance and align it with their unique trading objectives. Below are the primary parameters that can be customized within the strategy:
1. Momentum-RSI Settings
• Period: The lookback period for the Momentum-RSI can be adjusted. A shorter period makes the indicator more sensitive to recent price changes, while a longer period smoothens the RSI line, offering a broader view of the momentum.
• Overbought/Oversold Thresholds: Users can set their own overbought and oversold levels, which can help in identifying extreme market conditions more precisely according to their trading approach.
2. EMA Crossover Settings
• Timeframes for EMAs: The strategy uses two EMAs with different timeframes. Traders can modify these timeframes, choosing shorter periods for a more responsive approach or longer periods for a more conservative one.
• Source Data: The choice of price data (close, open, high, low) used in calculating the EMAs can be varied depending on the trader’s preference.
3. ATR Settings
• Lookback Period: Adjusting the lookback period for the ATR impacts how the indicator measures volatility. A longer period may provide a more stable but less responsive measure, while a shorter period offers quicker but potentially more erratic readings.
• Multiplier for Stop-Loss Calculation: This parameter allows traders to set how aggressively or conservatively they want their stop-loss to be in relation to the ATR value.
Here are the standard settings:
Pairs strategyHello, Tradingview community,
I am been playing with this idea that nowadays trading instruments are interconnected and when one goes too far "out of order" it should return to the mean.
So, here's a relatively simple idea.
This is a LONG-ONLY strategy.
Buy when your traded instrument's last bar closes down, and the comparing instrument closes up.
Sell when close is higher than the previous bar's high.
Best results I found with medium timeframes: 45min, 120min, 180min.
Also, feel free to test non-typical timeframes such as 59min, 119min, 179min, etc.
My reasoning for medium timeframes would be, that they are big enough to avoid "market noise"
of smaller timeframes + commissions & slippage is less negligible, and small enough to avoid exposure of higher timeframes, although, I haven't tested D timeframe and above.
The best results, I found were with instruments that aren't directly correlated. I mostly tested equities and equity futures, so for equity indexes, equity index futures, or large-cap stocks, NASDAQ:SMH , NASDAQ:NVDA , EURUSD, and Crude Oil would be a good candidate for comparing symbols.
When testing either futures or stocks, please adjust the commission for each asset, for stocks I use % equity, so it compounds over time, whereas, for futures, I use 1 contract all the time.
Here's NASDAQ:MSFT on 119min chart
Here's AMEX:SPY on 59min chart using NASDAQ:NVDA as comparison
Here's CME_MINI:ES1! on 179min chart using NYMEX:CL1! as comparison
To change comparison symbol just insert your symbol between the brackets on both fields down here.
SymbolClose = request.security("YOUR SYMBOL HERE", timeframe.period, close)
SymbolOpen = request.security("YOUR SYMBOL HERE", timeframe.period, open)
Since I am still relatively new to testing, hence, I am publishing this idea, so you can point out some crucial things I may have missed.
Thanks,
Enjoy the strategy!
Scale In : Scale OutScale In : Scale Out strategy is an adaptation and extension of dollar-cost-averaging.
As the name implies it not only scales in - allocates a given percentage of available capital to buy at each bar - it also scales out - sells a given percentage of holdings at each bar when a target profit level is reached.
The strategy can potentially mitigate risks associated with market timing.
Although dollar-cost-averaging is often recommended as a strategy for building a position, the management of taking and retaining profits is not often addressed. This strategy demonstrates the potential benefits of managing both the building and (full or partial) liquidation of an investment.
We do not provide any mechanism for managing stop losses. We assume a scale in/out strategy will typically be applied to investing in assets with a high conviction thesis based on criteria external to the strategy. If the strategy does not perform, then the thesis may need to be re-evaluated, and the position liquidated. Even in this case, scaling out should still be considered.
Mean Reversion with Incremental Entry by HedgerLabsThe "Mean Reversion with Incremental Entry" strategy, designed by HedgerLabs, is an advanced TradingView strategy script focusing on the mean reversion technique in financial markets. This strategy is engineered for traders who prefer a systematic approach with an emphasis on incremental entries based on price movements relative to a moving average.
Key Features:
Moving Average Based Strategy: Central to this strategy is the simple moving average (SMA), around which all trade entries and exits revolve. Traders can customize the MA length, making it flexible for various trading styles and timeframes.
Incremental Entry Mechanism: Unique to this strategy is the incremental entry system. The strategy initiates an initial trade when the price deviates from the MA by a specified percentage. Subsequent entries are made at incremental steps, defined by the trader, as the price moves further away from the MA. This method can potentially capitalize on increasing market volatility.
Dynamic Position Management: The strategy intelligently manages positions by entering long when the price is below the MA and short when above, allowing for adaptive positioning in different market conditions.
Automated Exit Logic: Exit points are determined when the price touches the MA, aiming to close positions at potential reversal points for optimized trade outcomes.
Continuous Market Analysis: With 'calc_on_every_tick' enabled, the strategy constantly evaluates market conditions, ensuring prompt reaction to price movements.
Usage Scenario:
This strategy is particularly beneficial in markets exhibiting mean-reverting behavior. It is suitable for traders focusing on swing trading or those who prefer to scale into positions during periods of high volatility.
Disclaimer:
Please remember that this strategy is for informational and educational purposes only and is not intended as financial or investment advice. Trading in financial markets carries risks, including the potential loss of capital. We advise doing your own research and consulting with a financial expert before making any investment decisions.
Ehlers Combo Strategy🚀 Presenting the Enhanced Ehlers Combo Strategy 🚀
Hello Traders! 👋 I'm thrilled to share the latest version of the Ehlers Combo Strategy v2.0. This powerful algorithm combines Ehlers Elegant Oscillator, Decycler, Instantaneous Trendline, Spearman Rank, and introduces the Signal to Noise Ratio for even more precise trading signals.
📊 Strategy Highlights:
Ehlers Elegant Oscillator: Captures market momentum and turning points.
Ehlers Decycler: Filters out market noise for clearer trend signals.
Instantaneous Trendline: Offers a dynamic view of the market trend.
Spearman Rank: Analyzes market rank correlations for enhanced insights.
Signal to Noise Ratio (SNR): Filters out noise for more accurate signals.
💡 Key Features & Customizations:
Adaptive Length: Enable adaptive length based on the market's current conditions.
SNR Threshold: Set your desired SNR threshold for filtering signals.
Exit Length: Define the length for exit signals.
📈 Trading Signals:
Long Entry: Elegant Oscillator and Decycler cross above 0, source crosses above Decycler, source is greater than an increasing Instantaneous Trendline, Spearman Rank is positive, and SNR exceeds the threshold.
Long Exit: Source crosses below the Instantaneous Trendline after entering a long position.
Short Entry: Elegant Oscillator and Decycler cross below 0, source crosses below Decycler, source is less than a decreasing Instantaneous Trendline, Spearman Rank is negative, and SNR exceeds the threshold.
Short Exit: Source crosses above the Instantaneous Trendline after entering a short position.
📊 Insights & Enhancements:
Dynamic Length: The strategy adapts its length dynamically based on market conditions.
Improved SNR: Signal to Noise Ratio ensures better filtering of signals.
Enhanced Visualization: The Elegant Oscillator now features improved color coding for a clearer interpretation.
🚨 Disclaimer:
Trading involves risk, and this script should be used judiciously. It's not a guaranteed profit machine, but with careful use, it can be a valuable addition to your toolkit.
Feel free to backtest, tweak, and make it your own! Let's conquer the markets together! 💪📈
🚀✨ Happy Trading! ✨🚀
---
🙌 Credits:
A big shoutout to the original contributors:
@blackcat1402
@cheatcountry
@DasanC
Session Breakout Scalper Trading BotHi Traders !
Introduction:
I have recently been exploring the world of automated algorithmic trading (as I prefer more objective trading strategies over subjective technical analysis (TA)) and would like to share one of my automation compatible (PineConnecter compatible) scripts “Session Breakout Scalper”.
The strategy is really simple and is based on time conditional breakouts although has more ”relatively” advanced optional features such as the regime indicators (Regime Filters) that attempt to filter out noise by adding more confluence states and the ATR multiple SL that takes into account volatility to mitigate the down side risk of the trade.
What is Algorthmic Trading:
Firstly what is algorithmic trading? Algorithmic trading also known as algo-trading, is a method of using computer programs (in this case pine script) to execute trades based on predetermined rules and instructions (this trading strategy). It's like having a robot trader who follows a strict set of commands to buy and sell assets automatically, without any human intervention.
Important Note:
For Algorithmic trading the strategy will require you having an essential TV subscription at the minimum (so that you can set alerts) plus a PineConnecter subscription (scroll down to the .”How does the strategy send signals” headings to read more)
The Strategy Explained:
Is the Time input true ? (this can be changed by toggling times under the “TRADE MEDIAN TIMES” group for user inputs).
Given the above is true the strategy waits x bars after the session and then calculates the highest high (HH) to lowest low (LL) range. For this box to form, the user defined amount of bars must print after the session. The box is symmetrical meaning the HH and LL are calculated over a lookback that is equal to the sum of user defined bars before and after the session (+ 1).
The Strategy then simultaneously defines the HH as the buy level (green line) and the LL as the sell level (red line). note the strategy will set stop orders at these levels respectively.
Enter a buy if price action crosses above the HH, and then cancel the sell order type (The opposite is true for a stop order).
If the momentum based regime filters are true the strategy will check for the regime / regimes to be true, if the regime if false the strategy will exit the current trade, as the regime filter has predicted a slowing / reversal of momentum.
The image below shows the strategy executing these trading rules ( Regime filters, "Trades on chart", "Signal & Label" and "Quantity" have been omitted. "Strategy label plots" has been switched to true)
Other Strategy Rules:
If a new session (time session which is user defined) is true (blue vertical line) and the strategy is currently still in a trade it will exit that trade immediately.
It is possible to also set a range of percentage gain per day that the strategy will try to acquire, if at any point the strategy’s profit is within the percentage range then the position / trade will be exited immediately (This can be changed in the “PERCENT DAY GAIN” group for user inputs)
Stops and Targets:
The strategy has either static (fixed) or variable SL options. TP however is only static. The “STRAT TP & TP” group of user inputs is responsible for the SL and TP values (quoted in pips). Note once the ATR stop is set to true the SL values in the above group no longer have any affect on the SL as expected.
What are the Regime Filters:
The Larry Williams Large Trade Index (LWLTI): The Larry Williams Large Trade Index (LWTI) is a momentum-based technical indicator developed by iconic trader Larry Williams. It identifies potential entries and exits for trades by gauging market sentiment, particularly the buying and selling pressure from large market players. Here's a breakdown of the LWTI:
LWLTI components and their interpretation:
Oscillator: It oscillates between 0 and 100, with 50 acting as the neutral line.
Sentiment Meter: Values above 75 suggest a bearish market dominated by large selling, while readings below 25 indicate a bullish market with strong buying from large players.
Trend Confirmation: Crossing above 75 during an uptrend and below 25 during a downtrend confirms the trend's continuation.
The Andean Oscillator (AO) : The Andean Oscillator is a trend and momentum based indicator designed to measure the degree of variations within individual uptrends and downtrends in the prices.
Regime Filter States:
In trading, a regime filter is a tool used to identify the current state or "regime" of the market.
These Regime filters are integrated within the trading strategy to attempt to lower risk (equity volatility and/or draw down). The regime filters have different states for each market order type (buy and sell). When the regime filters are set to true, if these regime states fail to be true the trade is exited immediately.
For Buy Trades:
LWLTI positive momentum state: Quotient of the lagged trailing difference and the ATR > 50
AO positive momentum state: Bull line > Bear line (signal line is omitted)
For Sell Trades:
LWLTI negative momentum stat: Quotient of the lagged trailing difference and the ATR < 50
AO negative momentum state: Bull line < Bear line (signal line is omitted)
How does the Strategy Send Signals:
The strategy triggers a TV alert (you will neet to set a alert first), TV then sends a HTTP request to the automation software (PineConnecter) which receives the request and then communicates to an MT4/5 EA to automate the trading strategy.
For the strategy to send signals you must have the following
At least a TV essential subscription
This Script added to your chart
A PineConnecter account, which is paid and not free. This will provide you with the expert advisor that executes trades based on these strategies signals.
For more detailed information on the automation process I would recommend you read the PineConnecter documentation and FAQ page.
Dashboard:
This Dashboard (top right by defualt) lists some simple trading statistics and also shows when a trade is live.
Important Notice:
- USE THIS STRATEGY AT YOUR OWN RISK AND ALWAYS DO YOUR OWN RESEARCH & MANUAL BACKTESTING !
- THE STRATEGY WILL NOT EXHIBIT THE BACKTEST PERFORMANCE SEEN BELOW IN ALL MARKETS !
SILVER Midnight Candle Color Strategy 1-Hour Delay and SL/TP Overview:
The "Midnight Candle Color Strategy with 1-Hour Delay and SL/TP" is a unique trading strategy designed for the Forex market. This strategy capitalizes on the color of the midnight candle based on New York time, making trade decisions one hour later, at 1:00 AM.
Key Features:
Time Zone Adjustment: Automatically adjusts to New York time (UTC-5 or UTC-4 during Daylight Saving Time).
Midnight Candle Analysis: Utilizes the color of the midnight candle to gauge market sentiment.
Trade Execution at 1 AM: Trades are executed one hour after midnight based on the previous day's candle color.
Strategic SL/TP: Incorporates predefined stop loss (SL) and take profit (TP) levels for each trade.
How It Works:
The script first determines whether the current bar represents 12:00 AM or 1:00 AM in New York time.
At midnight, it records the color of the candle (green for bullish, red for bearish).
At 1:00 AM, the strategy:
Enters a long position if the midnight candle was green, with specific TP and SL settings.
Enters a short position if the midnight candle was red, again with defined TP and SL.
Visualization:
Optional markers are plotted on the chart for easy visualization of the strategy's entry points at midnight and 1 AM.
Usage Tips:
Ideal for traders focusing on overnight price movements and early morning trends.
Best suited for SILVER trading due to the 24-hour trading cycle.
We recommend backtesting the strategy with historical data to evaluate performance.
Disclaimer:
This strategy is provided for educational purposes and should not be considered as financial advice. Users should conduct their own research and exercise caution while trading. Past performance is not indicative of future results.
I´m not a signal service, however I´m sharing my signals. For free. If you wish to buy something, contact some other signalist, preferably with 5-10-15-20K followers, selling signals on the premium channel, but in reality not trading them themselves. If you will realise after few blown account that something is wrong, ask yourself why is that. Trading is not pushing the buy-sell button and drinking tequila on the beach. If you want to learn, you know what to do.
TrailingTakeProfit exampleQuite recently I came upon a concept of Trailing Take Profit and I couldn't find a PineScript which implements it for the fastest possible execution, so here it is :)
Everybody knows Trailing StopLoss - an invisible mechanism follows the price and exits the trade once the price retreats too much from its recent most extended favourable value. Trailing TakeProfit does the similar thing, but at the opposite end - the trade gets closed if a price moves too well, in too favourable extent.
Why close the trade if it is going so good? Well, whatever goes up, must go down and vice versa. It is expected, that after fast rally a market will soon fall and after a dump it will go up. So Trailing TakeProfit's role is to secure profits.
But how does Trailing TakeProfit differ from the standard one? "Trailing" means, the exit level is moving. Its role is to be executed only after a rapid favourable move within 1-2 candles, not more. We never know when a rapid move happens, but when it does, we wanna catch those pips and quickly exit without looking back.
Visually Trailing TakeProfit levels are... bands. In this script example these are ATR multiplied bands (aka Keltner Channel), but they could also be Bollinger Bands or something else.
The code is simple just to focus on this single functionality, so you can quickly copy-paste it into your script. Entries are triggered by default SMA crosses.
P.S. I wouldn't be myself, if I didn't add alert messages compatible with the syntax of recently revamped TradingConnector - both in the code already and in the table showing them.
FlexiMA Variance Tracker - Strategy [presentTrading]█ Introduction and How It Is Different
The FlexiMA Variance Tracker by PresentTrading introduces a novel approach to technical trading strategies. Unlike traditional methods, it calculates deviations between a chosen indicator source (such as price or average) and a moving average with a variable length. This flexibility is achieved through a unique combination of a starting factor and an increment factor, allowing the moving average to adapt dynamically within a specified range. This strategy provides a more responsive and nuanced view of market trends, setting it apart from standard trading methodologies.
BTC 8h L/S
Local
█ Strategy, How It Works: Detailed Explanation
The FlexiMA Variance Tracker, developed by PresentTrading, stands at the forefront of trading strategies, distinguished by its adaptive and multifaceted approach to market analysis. This strategy intricately weaves various technical elements to construct a comprehensive trading logic. Here's an in-depth professional breakdown:
🔶Foundation on Variable-Length Moving Averages:
Central to this strategy is the concept of variable-length Moving Averages (MAs). Unlike traditional MAs with a fixed period, this strategy dynamically adjusts the length of the MA based on a starting factor and an incremental factor. This approach allows the strategy to adapt to market volatility and trend strength more effectively.
Each MA iteration offers a distinct temporal perspective, capturing short-term price movements to long-term trends. This aggregation of various time frames provides a richer and more nuanced market analysis, essential for making informed trading decisions.
🔶Deviation Analysis and Normalization:
The strategy calculates deviations of the price (or the chosen indicator source) from each of these MAs. These deviations are pivotal in identifying the immediate market direction relative to the average trend captured by each MA.
To standardize these deviations for comparability, they undergo a normalization process. The choice of normalization method (Max-Min or Absolute Sum) can significantly influence the interpretation of market conditions, offering distinct insights into price movements and trend strength.
🔹Normalization: Absolute Sum
🔶Composite Oscillator Construction:
A composite oscillator is derived from the median of these normalized deviations. The median serves as a balanced and robust central trend indicator, minimizing the impact of outliers and market noise.
Additionally, the standard deviation of these deviations is computed, providing a measure of market volatility. This volatility indicator is crucial for assessing market risk and can guide traders in setting appropriate stop-loss and take-profit levels.
🔶Integration with SuperTrend Indicator:
The FlexiMA strategy integrates the SuperTrend indicator, renowned for its effectiveness in identifying trend direction and reversals. The SuperTrend's incorporation enhances the strategy's ability to filter out false signals and confirm genuine market trends.
* The SuperTrend Toolkit is made by @QuantiLuxe
This combination of the variable-length MA oscillator with the SuperTrend indicator forms a potent duo, offering traders a dual-confirmation mechanism for trade signals.
🔹Supertrend's incorporation
🔶Strategic Trade Signal Generation:
Trade signals are generated when there is a confluence between the composite oscillator and the SuperTrend indicator. For example, a long position signal might be considered when the oscillator suggests an uptrend, and the SuperTrend flips to bullish.
The strategy's parameters are fully customizable, enabling traders to tailor the signal generation process to their specific trading style, risk tolerance, and market conditions.
█ Usage
To effectively employ the FlexiMA Variance Tracker strategy:
Traders should set their desired trade direction and fine-tune the starting and increment factors according to their market analysis and risk tolerance.
Indicator Length: 5
Indicator Length: 40
The strategy is suitable for a wide range of markets and can be adapted to different time frames, making it a versatile tool for various trading scenarios.
█ Default Settings Impact on Performance: FlexiMA Variance Tracker
1. Trade Direction (Configurable: Long, Short, Both): Determines trade types. 'Long' for buying, 'Short' for selling, 'Both' adapts to market trends.
2. Indicator Source: HLC3: Balances market sentiment by considering high, low, and close, providing comprehensive period analysis.
4. Indicator Length (Default: 10): Baseline for moving averages. Shorter lengths increase responsiveness but add noise, while longer lengths favor trends.
5. Starting and Increment Factor (Default: 1.0): Adjusts MA lengths range. Higher values capture broad market dynamics, lower values focus analysis.
6. Normalization Method (Options: None, Max-Min, Absolute Sum): Standardizes deviations. 'None' for raw deviations, 'Max-Min' for relative scaling, 'Absolute Sum' emphasizes relative strength.
7. SuperTrend Settings (ATR Length: 10, Multiplier: 15.0): Influences indicator sensitivity. Short ATR or high multiplier for short-term, long ATR or low multiplier for long-term trends.
8. Additional Settings (Mesh Style, Color Customization): Enhances visual clarity. Mesh style for detailed deviation view, colors for quick market condition identification.
TASC 2024.01 Gap Momentum System█ OVERVIEW
TASC's January 2024 edition of Traders' Tips features an article titled “Gap Momentum” by Perry J. Kaufman. The article discusses how a trader might create a momentum strategy based on opening gap data. This script implements the Gap Momentum system presented therein.
█ CONCEPTS
In the article, Perry J. Kaufman introduces Gap Momentum as a cumulative series constructed in the same way as On-Balance Volume (OBV) , but using gap openings (today’s open minus yesterday’s close).
To smoothen the resulting time series (i.e., obtain the " signal line "), the author applies a simple moving average . Subsequently, he proposes the following two trading rules for a long-only trading system:
• Enter a long position when the signal line is moving higher.
• Exit when the signal line is moving lower.
█ CALCULATIONS
The calculation of Gap Momentum involves the following steps:
1. Calculate the ratio of the sum of positive gaps over the past N days to the sum of negative gaps (absolute values) over the same time period.
2. Add the resulting gap ratio to the cumulative time series. This time series is the Gap Momentum.
3. Keep moving forward, as in an N-day moving average.
Elliott's Quadratic Momentum - Strategy [presentTrading]█ Introduction and How It Is Different
The "Elliott's Quadratic Momentum - Strategy" is a unique and innovative approach in the realm of technical trading. This strategy is a fusion of multiple SuperTrend indicators combined with an Elliott Wave-like pattern analysis, offering a comprehensive and dynamic trading tool. It stands apart from conventional strategies by incorporating multiple layers of trend analysis, thereby providing a more robust and nuanced view of market movements.
*Although the script doesn't explicitly analyze Elliott Wave patterns, it employs a wave-like approach by considering multiple SuperTrend indicators. Elliott Wave theory is based on the premise that markets move in predictable wave patterns. While this script doesn't identify specific Elliott Wave structures like impulsive and corrective waves, the sequential checking of trend conditions across multiple SuperTrend indicators mimics a wave-like progression.
BTC 8hr Long/Short Performance
Local Detail
█ Strategy, How It Works: Detailed Explanation
The core of this strategy lies in its multi-tiered approach:
1. Multiple SuperTrend Indicators:
The strategy employs four different SuperTrend indicators, each with unique ATR lengths and multipliers. These indicators offer various perspectives on market trends, ranging from short to long-term views.
By analyzing the convergence of these indicators, the strategy can pinpoint robust entry signals for both long and short positions.
2. Elliott Wave-like Pattern Recognition:
While not directly applying Elliott Wave theory, the strategy takes inspiration from its pattern recognition approach. It looks for alignments in market movements that resemble the characteristic waves of Elliott's theory.
This pattern recognition aids in confirming the signals provided by the SuperTrend indicators, adding an extra layer of validation to the trading signals.
3. Comprehensive Market Analysis:
By combining multiple indicators and pattern analysis, the strategy offers a holistic view of the market. This allows for capturing potential trend reversals and significant market moves early.
█ Trade Direction
The strategy is designed with flexibility in mind, allowing traders to select their preferred trading direction – Long, Short, or Both. This adaptability is key for traders looking to tailor their approach to different market conditions or personal trading styles. The strategy automatically adjusts its logic based on the chosen direction, ensuring that traders are always aligned with their strategic objectives.
█ Usage
To utilize the "Elliott's Quadratic Momentum - Strategy" effectively:
Traders should first determine their trading direction and adjust the SuperTrend settings according to their market analysis and risk appetite.
The strategy is versatile and can be applied across various time frames and asset classes, making it suitable for a wide range of trading scenarios.
It's particularly effective in trending markets, where the alignment of multiple SuperTrend indicators can provide strong trade signals.
█ Default Settings
Trading Direction: Configurable (Long, Short, Both)
SuperTrend Settings:
SuperTrend 1: ATR Length 7, Multiplier 4.0
SuperTrend 2: ATR Length 14, Multiplier 3.618
SuperTrend 3: ATR Length 21, Multiplier 3.5
SuperTrend 4: ATR Length 28, Multiplier 3.382
Additional Settings: Gradient effect for trend visualization, customizable color schemes for upward and downward trends.
Backtesting ModuleDo you often find yourself creating new 'strategy()' scripts for each trading system? Are you unable to focus on generating new systems due to fatigue and time loss incurred in the process? Here's a potential solution: the 'Backtesting Module' :)
INTRODUCTION
Every trading system is based on four basic conditions: long entry, long exit, short entry and short exit (which are typically defined as boolean series in Pine Script).
If you can define the conditions generated by your trading system as a series of integers, it becomes possible to use these variables in different scripts in efficient ways. (Pine Script is a convenient language that allows you to use the integer output of one indicator as a source in another.)
The 'Backtesting Module' is a dynamic strategy script designed to adapt to your signals. It boasts two notable features:
⮞ It produces a backtest report using the entry and exit variables you define.
⮞ It not only serves for system testing but also to combine independent signals into a single system. (This functionality enables to create complex strategies and report on their success!)
The module tests Golden and Death cross signals by default, when you enter your own conditions the default signals will be neutralized. The methodology is described below.
PREPARATION
There are three simple steps to connect your own indicator to the Module.
STEP 1
Firstly, you must define entry and exit variables in your own script. Let's elucidate it with a straightforward example. Consider a system generating long and short signals based on the intersections of two moving averages. Consequently, our conditions would be as follows:
// Signals
long = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
short = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
Now, the question is: How can we convert boolean variables into integer variables? The answer is conditional ternary block, defined as follows:
// Entry & Exit
long_entry = long ? 1 : 0
long_exit = short ? 1 : 0
short_entry = short ? 1 : 0
short_exit = long ? 1 : 0
The mechanics of the Entry & Exit variables are simple. The variable takes on a value of 1 when your trading system generates the signal and if your system does not produce any signal, variable returns 0. In this example, you see how exit signals can be generated in a trading system that only contains entry signals. If you have a system with original exit signals, you can also use them directly. (Please mind the NOTES section below).
STEP 2
To utilize the Entry & Exit variables as source in another script, they must be plotted on the chart. Therefore, the final detail to include in the script containing your trading system would be as follows:
// Plot The Output
plot(long_entry, "Long Entry", display=display.data_window, editable=false)
plot(long_exit, "Long Exit", display=display.data_window, editable=false)
plot(short_entry, "Short Entry", display=display.data_window, editable=false)
plot(short_exit, "Short Exit", display=display.data_window, editable=false)
STEP 3
Now, we are ready to test the system! Load the Backtesting Module indicator onto the chart along with your trading system/indicator. Then set the outputs of your system (Long Entry, Long Exit, Short Entry, Short Exit) as source in the module. That's it.
FEATURES & ORIGINALITY
⮞ Primarily, this script has been created to provide you with an easy and practical method when testing your trading system.
⮞ I thought it might be nice to visualize a few useful results. The Backtesting Module provides insights into the outcomes of both long and short trades by computing the number of trades and the success percentage.
⮞ Through the 'Trade' parameter, users can specify the market direction in which the indicator is permitted to initiate positions.
⮞ Users have the flexibility to define the date range for the test.
⮞ There are optional features allowing users to plot entry prices on the chart and customize bar colors.
⮞ The report and the test date range are presented in a table on the chart screen. The entry price can be monitored in the data window.
⮞ Note that results are based on realized returns, and the open trade is not included in the displayed results. (The only exception is the 'Unrealized PNL' result in the table.)
STRATEGY SETTINGS
The default parameters are as follows:
⮞ Initial Balance : 10000 (in units of currency)
⮞ Quantity : 10% of equity
⮞ Commission : 0.04%
⮞ Slippage : 0
⮞ Dataset : All bars in the chart
For a realistic backtest result, you should size trades to only risk sustainable amounts of equity. Do not risk more than 5-10% on a trade. And ALWAYS configure your commission and slippage parameters according to pessimistic scenarios!
NOTES
⮞ This script is intended solely for development purposes. And it'll will be available for all the indicators I publish.
⮞ In this version of the module, all order types are designed as market orders. The exit size is the sum of the entry size.
⮞ As your trading conditions grow more intricate, you might need to define the outputs of your system in alternative ways. The method outlined in this description is tailored for straightforward signal structures.
⮞ Additionally, depending on the structure of your trading system, the backtest module may require further development. This encompasses stop-loss, take-profit, specific exit orders, quantity, margin and risk management calculations. I am considering releasing improvements that consider these options in future versions.
⮞ An example of how complex trading signals can be generated is the OTT Collection. If you're interested in seeing how the signals are constructed, you can use the link below.
THANKS
Special thanks to PineCoders for their valuable moderation efforts.
I hope this will be a useful example for the TradingView community...
DISCLAIMER
This is just an indicator, nothing more. It is provided for informational and educational purposes exclusively. The utilization of this script does not constitute professional or financial advice. The user solely bears the responsibility for risks associated with script usage. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
Contrarian DC Strategy - w Entry SL Pause and TrailingStopDonchian Channel Setup:
The strategy uses a tool called the Donchian Channel. Imagine this as two lines (bands) on a chart that show the highest and lowest prices over a certain number of past trading days (default is 20 days).
There's also a centerline, which is the average of these two bands.
Entry Conditions for Trades:
Buying (Going Long): The strategy considers buying when the price touches or falls below the lower band of the Donchian Channel. However, this only happens if there has been a pause after a previous losing trade. This pause is a number of candles where no new trades are taken.
Selling (Going Short): Similarly, the strategy considers selling when price reaches or exceeds the upper band of the Donchian Channel. Again, this is subject to a pause after a losing trade.
Stop Loss and Take Profit:
Each trade has a "Stop Loss" and "Take Profit" set. The Stop Loss is a preset price level where the trade will close to prevent further losses if the market moves against your position. The Take Profit does the same but locks in profit if the market moves in your favor.
The Stop Loss is set based on a percentage of the price at which you entered the trade.
The Take Profit is determined by the Risk/Reward Ratio. This ratio helps balance how much you're willing to risk versus the potential reward.
Trailing Stop Loss:
When a trade is profitable, the strategy should involve a "Trailing Stop Loss." This means the Stop Loss level moves (or trails) the price movement to lock in profits as the market moves in your favor.
For a buy trade, if the price moves above the centerline of the Donchian Channel, the Trailing Stop Loss should be adjusted in the middle between the entry price and the centerline. Viceversa for a sell trade, it should be adjusted in the same way if the price goes below the centerline.
IMPORTANT: There's no allert for the trailing stop at the moment.
Post-Stop Loss Pause:
If a trade hits the Stop Loss (i.e., it's a losing trade), the strategy takes a break before opening another trade in the same direction. This pause helps to avoid entering another trade immediately in a potentially unfavorable market.
In summary, this strategy is designed to make trades based on the Donchian Channel, with specific rules for when to enter and exit trades, and mechanisms to manage risk and protect profits. It's contrarian because it tends to buy when the price is low and sell when the price is high, which is opposite to what many traders might do.
COSTAR Strategy [SS]A little late posting this but here it is, as promised!
This is the companion to the COSTAR indicator.
What it does:
It creates a co-integration paired relationship with a separate, cointegrated ticker. It then plots out the expected range based on the value of the cointegrated pair. When the current ticker is below the value of its co-integrated partner, it becomes a "Buy" and should be longed. When it becomes overvalued in comparison, it becomes a "Sell" and should be shorted.
The example above is with BA and USO, which have a strong inverse relationship.
How it works:
I made the strategy version a bit more intuitive. Instead of you selecting the parameters for your model, it will autoselect the ideal parameters based on your desired co-integrated pair. You simply enter the ticker you want to compare against, and it will sort through the values at various lags to find significance and stationarity. It will then create a model and plot the model out for you on your chart, as you can see above.
The premise of the strategy:
The premise of the strategy is as stated before. You long when the ticker is undervalued in comparison to its co-integrated pair, and short when it is overvalued. The conditions for entry are simply a co-integrated pair being over the expected range (short) or below the expected range (long).
The condition to exit is a "re-integration", or a crossover of the expected value of the ticker (the centreline).
What if it can't find a relationship?
In some instances, the indicator will not be able to determine a co-integrated relationship, owning to a lack of stationarity between the data. When this happens, you will get the following error:
The indicator provides you with prompts, such as switching the timeframe or trying an alternative ticker. In the case displayed above, if we simply switch to the 1 hour timeframe, we have a viable model with great backtest results:
You can toggle in the settings menu the various parameters, such as timeframe, fills and displays.
And that is the strategy in a nutshell, be sure to check out its partner indicator, COSTAR, for more information on the premise of using co-integrated models for trading. And let me know your questions below!
Safe trades everyone!