MACD of Relative Strenght StrategyMACD Relative Strenght Strategy :
INTRODUCTION :
This strategy is based on two well-known indicators: MACD and Relative Strenght (RS). By coupling them, we obtain powerful buy signals. In fact, the special feature of this strategy is that it creates an indicator from an indicator. Thus, we construct a MACD whose source is the value of the RS. The strategy only takes buy signals, ignoring SHORT signals as they are mostly losers. There's also a money management method enabling us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RELATIVE STRENGHT :
RS is an indicator that measures the anomaly between momentum and the assumption of market efficiency. It is used by professionals and is one of the most robust indicators. The idea is to own assets that do better than average, based on their past performance. We calculate RS using this formula :
RS = close/highest_high(RS_Length)
Where highest_high(RS_Length) = highest value of the high over a user-defined time period (which is the RS_Length).
We can thus situate the current price in relation to its highest price over this user-defined period.
MACD (Moving Average Convergence - Divergence) :
This is one of the best-known indicators, measuring the distance between two exponential moving averages : one fast and one slower. A wide distance indicates fast momentum and vice versa. We'll plot the value of this distance and call this line macdline. The MACD uses a third moving average with a lower period than the first two. This last moving average will give a signal when it crosses the macdline. It is therefore constructed using the values of the macdline as its source.
It's important to note that the first two MAs are constructed using RS values as their source. So we've just built an indicator of an indicator. This kind of method is very powerful because it is rarely used and brings value to the strategy.
PARAMETERS :
RS Length : Relative Strength length i.e. the number of candles back to find the highest high and compare the current price with this high. Default is 300.
MACD Fast Length : Relative Strength fast EMA length used to plot the MACD. Default is 14.
MACD Slow Length : Relative Strength slow EMA length used to plot the MACD. Default is 26.
MACD Signal Smoothing : Macdline SMA length used to plot the MACD. Default is 10.
Max risk per trade (in %) : The maximum loss a trade can incur (in percentage of the trade value). Default is 8%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. Default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:ETHUSD in 8h timeframe with the parameters set by default.
ENTER RULES :
The entry rules are very simple : we open a long position when the MACD value turns positive. You are therefore LONG when the MACD is green.
EXIT RULES :
We exit a position (whether losing or winning) when the MACD becomes negative, i.e. turns red.
RISK MANAGEMENT :
This strategy can incur losses, so it's important to manage our risks well. If the position is losing and has incurred a loss of -8%, our stop loss is activated to limit losses.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
Enjoy the strategy and don't forget to take the trade :)
Penunjuk dan strategi
Autofibonacci strategy [BrainyTrade]Fibonacci is a method of analyzing financial markets based on the use of Fibonacci numbers. This method involves using support and resistance levels based on the golden ratio and the Fibonacci sequence to predict future price levels.
A Fibonacci chart for most traders means stretching point A to the very minimum and point B to the very maximum. Often no one can explain why he does this.
Robert Fisher's book, New Fibonacci Trading Techniques, is one of those books that will help you understand the meaning of Fibonacci trading.
Each trend movement is subsequently associated with a correction. Based on my 6 years of trading and observing price movements in the market, I can conclude:
"The probability of correction in trends is more than 70%"
That is, on our side is the percentage of potential development of any movement in a trend.
Now we need to solve several questions:
1) How to determine a trend?
2) How to determine the correction?
3) How to determine the turning point of the correction and entry into the trend?
The indicator determines the correction based on the attenuation of the movement. When the market stops showing strong candles, he finds a second point to plot Fibonacci.
The first point is the result of the deepest correction point after the construction of the previous Fibonacci. That is why most often it will not be built from a visible level.
The indicator is based on a “correction standard”, which is more likely to work after a trend movement. In our case, these are levels 0.618-0.5. to determine potential price reversal zones. If the price rises or declines and reaches this level, you can consider it as a support zone. In this regard, when plotting with the Fibonaccia indicator, we can expect these values from the market.
The turning point of the correction occurs when all conditions are met:
1) Descent to zones 0.618-0.5 level,
2) Exit above level 0.
The tool determines the current trend depending on the previous worked fibonacci.
Every movement in the market is analyzed into impulses and corrections. In this concept, impulses represent directional price movements within the main trend, while corrective waves represent temporary deviations from the main direction of the trend.
The indicator reads all historical data and finds the current Fibonacci structure whose impulse was last found.
Important:
Sometimes fibonacci can be very small in size and that's okay. The indicator needs to read absolutely all movements and build levels there. The only question is: is it necessary to trade such small structures? I don't recommend it. Also, the levels 0.382 and 0.236 have been removed from the indicator, since they are not involved in decision-making and calculations.
Settings:
You can change the color of all elements that the indicator displays on the chart.
Application:
The indicator decides to enter a position strictly below the 0.5 extension level based on the candlestick pattern. You can place a grid of orders between 0.618 and 0.86, since they are the strongest support, and the gold levels 0.786-0.86 are a critical correction.
Closing of positions occurs after going beyond -0.618 and when a new impulse with correction is found. In this case, the Fibonacci is considered “spent” and is removed from the chart.
Gold levels (-0.18, -0.27) are often resistance, when approaching them it is better to be careful with positions
When we go beyond the 1st level, that is, the beginning of the impulse, we understand that the cyclicality of the market is being refracted, changes are occurring in the current price dynamics and we are considering opportunities for opening new positions. It is behind this level that the stop loss for previously acquired positions is located.
Examples:
The long Fibonacci structure implies that the trend is up and the image below is an example of a buy signal.
After some time and going beyond -0.618, the indicator found a new fibonacci and exited the old position, closing it with a market order
The image below shows a Fibonacci short with an entry point to sell the asset. You can notice that it is built in the opposite direction from the long one.
Good luck trader!
Trend-based Price Action StrategyThis is a strategy script that combines trend-based price action analysis with the Relative Strength Index (RSI) and Exponential Moving Averages (EMA) as trend filters. Here's a summary of the key components and logic:
Price Action Candlestick Patterns:
Bullish patterns: Engulfing candle and Morning Star.
Bearish patterns: Engulfing candle and Evening Star.
RSI Integration:
RSI is used to identify overbought and oversold conditions.
EMA Trend Filter:
Three EMAs with different periods: Fast , Medium and Slow.
Long trend condition occur when the fast EMA is above the medium and the medium is above the slow EMA.
Short trend condition occur when the slow EMA is above the medium and the medium is above the fast EMA.
Long entry conditions: RSI is oversold, RSI is decreasing, bullish candlestick pattern, and EMA trend filter conditions are met.
Short entry conditions: RSI is overbought, RSI is decreasing, bearish candlestick pattern, and EMA trend filter conditions are met.
Exit conditions:
Take profit or stop loss is reached.
Plotting:
Signals are plotted on the chart when entry conditions are met.
EMAs are plotted when the EMA trend filter is enabled.
This script aims to capture potential trend reversal points based on a combination of candlestick patterns, RSI, and EMA trend analysis.
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.
simple pull back TJlv26This is a very simple strategy for swing trade in stock indexes.
this strategy only trade long position, recommend to use this in day chart of sp500 or nas100.
SPX
NDX
Buy condition:
close price above long term SMA(default period 200),close price under short term SMA(default period 10), RSI is under 30(default period 3)
Sell condition:
1:if close price is above short period SMA and current close price is lower than low price of previous bar
2:hit the take profit target(default value 10%)
3:hit the stop loss target(default value 5%)
from author:
As you can see, it's a very simple logic. You only start trading when the price is above long-term moving average, so you can avoid risk by taking positions only in the uptrend. You also use stop-loss, so even in situations where there is a significant downturn, you can minimize losses.
However, it's important to note that this strategy performs well only in markets where long-term (approximately 10 years) upward movements are expected. It often yields disappointing results during prolonged bear markets. This is where each user's fundamental analysis comes into play, as there is no such thing as a perfect trading logic.
Another noteworthy point is that, as seen in the results of back testing, this strategy tends to underperform buy-and-hold in most cases. As mentioned earlier, it's a strategy focused on risk mitigation and starting trades at the most advantageous prices, so I believe that using leverage of 2-4 times can maximize profits. However, trading with leverage is highly risky, so it should be assessed based on each individual's risk tolerance.
Supertrend Advance Pullback StrategyHandbook for the Supertrend Advance Strategy
1. Introduction
Purpose of the Handbook:
The main purpose of this handbook is to serve as a comprehensive guide for traders and investors who are looking to explore and harness the potential of the Supertrend Advance Strategy. In the rapidly changing financial market, having the right tools and strategies at one's disposal is crucial. Whether you're a beginner hoping to dive into the world of trading or a seasoned investor aiming to optimize and diversify your portfolio, this handbook offers the insights and methodologies you need. By the end of this guide, readers should have a clear understanding of how the Supertrend Advance Strategy works, its benefits, potential pitfalls, and practical application in various trading scenarios.
Overview of the Supertrend Advance Pullback Strategy:
At its core, the Supertrend Advance Strategy is an evolution of the popular Supertrend Indicator. Designed to generate buy and sell signals in trending markets, the Supertrend Indicator has been a favorite tool for many traders around the world. The Advance Strategy, however, builds upon this foundation by introducing enhanced mechanisms, filters, and methodologies to increase precision and reduce false signals.
1. Basic Concept:
The Supertrend Advance Strategy relies on a combination of price action and volatility to determine the potential trend direction. By assessing the average true range (ATR) in conjunction with specific price points, this strategy aims to highlight the potential starting and ending points of market trends.
2. Methodology:
Unlike the traditional Supertrend Indicator, which primarily focuses on closing prices and ATR, the Advance Strategy integrates other critical market variables, such as volume, momentum oscillators, and perhaps even fundamental data, to validate its signals. This multidimensional approach ensures that the generated signals are more reliable and are less prone to market noise.
3. Benefits:
One of the main benefits of the Supertrend Advance Strategy is its ability to filter out false breakouts and minor price fluctuations, which can often lead to premature exits or entries in the market. By waiting for a confluence of factors to align, traders using this advanced strategy can increase their chances of entering or exiting trades at optimal points.
4. Practical Applications:
The Supertrend Advance Strategy can be applied across various timeframes, from intraday trading to swing trading and even long-term investment scenarios. Furthermore, its flexible nature allows it to be tailored to different asset classes, be it stocks, commodities, forex, or cryptocurrencies.
In the subsequent sections of this handbook, we will delve deeper into the intricacies of this strategy, offering step-by-step guidelines on its application, case studies, and tips for maximizing its efficacy in the volatile world of trading.
As you journey through this handbook, we encourage you to approach the Supertrend Advance Strategy with an open mind, testing and tweaking it as per your personal trading style and risk appetite. The ultimate goal is not just to provide you with a new tool but to empower you with a holistic strategy that can enhance your trading endeavors.
2. Getting Started
Navigating the financial markets can be a daunting task without the right tools. This section is dedicated to helping you set up the Supertrend Advance Strategy on one of the most popular charting platforms, TradingView. By following the steps below, you'll be able to integrate this strategy into your charts and start leveraging its insights in no time.
Setting up on TradingView:
TradingView is a web-based platform that offers a wide range of charting tools, social networking, and market data. Before you can apply the Supertrend Advance Strategy, you'll first need a TradingView account. If you haven't set one up yet, here's how:
1. Account Creation:
• Visit TradingView's official website.
• Click on the "Join for free" or "Sign up" button.
• Follow the registration process, providing the necessary details and setting up your login credentials.
2. Navigating the Dashboard:
• Once logged in, you'll be taken to your dashboard. Here, you'll see a variety of tools, including watchlists, alerts, and the main charting window.
• To begin charting, type in the name or ticker of the asset you're interested in the search bar at the top.
3. Configuring Chart Settings:
• Before integrating the Supertrend Advance Strategy, familiarize yourself with the chart settings. This can be accessed by clicking the 'gear' icon on the top right of the chart window.
• Adjust the chart type, time intervals, and other display settings to your preference.
Integrating the Strategy into a Chart:
Now that you're set up on TradingView, it's time to integrate the Supertrend Advance Strategy.
1. Accessing the Pine Script Editor:
• Located at the top-center of your screen, you'll find the "Pine Editor" tab. Click on it.
• This is where custom strategies and indicators are scripted or imported.
2. Loading the Supertrend Advance Strategy Script:
• Depending on whether you have the script or need to find it, there are two paths:
• If you have the script: Copy the Supertrend Advance Strategy script, and then paste it into the Pine Editor.
• If searching for the script: Click on the “Indicators” icon (looks like a flame) at the top of your screen, and then type “Supertrend Advance Strategy” in the search bar. If available, it will show up in the list. Simply click to add it to your chart.
3. Applying the Strategy:
• After pasting or selecting the Supertrend Advance Strategy in the Pine Editor, click on the “Add to Chart” button located at the top of the editor. This will overlay the strategy onto your main chart window.
4. Configuring Strategy Settings:
• Once the strategy is on your chart, you'll notice a small settings ('gear') icon next to its name in the top-left of the chart window. Click on this to access settings.
• Here, you can adjust various parameters of the Supertrend Advance Strategy to better fit your trading style or the specific asset you're analyzing.
5. Interpreting Signals:
• With the strategy applied, you'll now see buy/sell signals represented on your chart. Take time to familiarize yourself with how these look and behave over various timeframes and market conditions.
3. Strategy Overview
What is the Supertrend Advance Strategy?
The Supertrend Advance Strategy is a refined version of the classic Supertrend Indicator, which was developed to aid traders in spotting market trends. The strategy utilizes a combination of data points, including average true range (ATR) and price momentum, to generate buy and sell signals.
In essence, the Supertrend Advance Strategy can be visualized as a line that moves with the price. When the price is above the Supertrend line, it indicates an uptrend and suggests a potential buy position. Conversely, when the price is below the Supertrend line, it hints at a downtrend, suggesting a potential selling point.
Strategy Goals and Objectives:
1. Trend Identification: At the core of the Supertrend Advance Strategy is the goal to efficiently and consistently identify prevailing market trends. By recognizing these trends, traders can position themselves to capitalize on price movements in their favor.
2. Reducing Noise: Financial markets are often inundated with 'noise' - short-term price fluctuations that can mislead traders. The Supertrend Advance Strategy aims to filter out this noise, allowing for clearer decision-making.
3. Enhancing Risk Management: With clear buy and sell signals, traders can set more precise stop-loss and take-profit points. This leads to better risk management and potentially improved profitability.
4. Versatility: While primarily used for trend identification, the strategy can be integrated with other technical tools and indicators to create a comprehensive trading system.
Type of Assets/Markets to Apply the Strategy:
1. Equities: The Supertrend Advance Strategy is highly popular among stock traders. Its ability to capture long-term trends makes it particularly useful for those trading individual stocks or equity indices.
2. Forex: Given the 24-hour nature of the Forex market and its propensity for trends, the Supertrend Advance Strategy is a valuable tool for currency traders.
3. Commodities: Whether it's gold, oil, or agricultural products, commodities often move in extended trends. The strategy can help in identifying and capitalizing on these movements.
4. Cryptocurrencies: The volatile nature of cryptocurrencies means they can have pronounced trends. The Supertrend Advance Strategy can aid crypto traders in navigating these often tumultuous waters.
5. Futures & Options: Traders and investors in derivative markets can utilize the strategy to make more informed decisions about contract entries and exits.
It's important to note that while the Supertrend Advance Strategy can be applied across various assets and markets, its effectiveness might vary based on market conditions, timeframe, and the specific characteristics of the asset in question. As always, it's recommended to use the strategy in conjunction with other analytical tools and to backtest its effectiveness in specific scenarios before committing to trades.
4. Input Settings
Understanding and correctly configuring input settings is crucial for optimizing the Supertrend Advance Strategy for any specific market or asset. These settings, when tweaked correctly, can drastically impact the strategy's performance.
Grouping Inputs:
Before diving into individual input settings, it's important to group similar inputs. Grouping can simplify the user interface, making it easier to adjust settings related to a specific function or indicator.
Strategy Choice:
This input allows traders to select from various strategies that incorporate the Supertrend indicator. Options might include "Supertrend with RSI," "Supertrend with MACD," etc. By choosing a strategy, the associated input settings for that strategy become available.
Supertrend Settings:
1. Multiplier: Typically, a default value of 3 is used. This multiplier is used in the ATR calculation. Increasing it makes the Supertrend line further from prices, while decreasing it brings the line closer.
2. Period: The number of bars used in the ATR calculation. A common default is 7.
EMA Settings (Exponential Moving Average):
1. Period: Defines the number of previous bars used to calculate the EMA. Common periods are 9, 21, 50, and 200.
2. Source: Allows traders to choose which price (Open, Close, High, Low) to use in the EMA calculation.
RSI Settings (Relative Strength Index):
1. Length: Determines how many periods are used for RSI calculation. The standard setting is 14.
2. Overbought Level: The threshold at which the asset is considered overbought, typically set at 70.
3. Oversold Level: The threshold at which the asset is considered oversold, often at 30.
MACD Settings (Moving Average Convergence Divergence):
1. Short Period: The shorter EMA, usually set to 12.
2. Long Period: The longer EMA, commonly set to 26.
3. Signal Period: Defines the EMA of the MACD line, typically set at 9.
CCI Settings (Commodity Channel Index):
1. Period: The number of bars used in the CCI calculation, often set to 20.
2. Overbought Level: Typically set at +100, denoting overbought conditions.
3. Oversold Level: Usually set at -100, indicating oversold conditions.
SL/TP Settings (Stop Loss/Take Profit):
1. SL Multiplier: Defines the multiplier for the average true range (ATR) to set the stop loss.
2. TP Multiplier: Defines the multiplier for the average true range (ATR) to set the take profit.
Filtering Conditions:
This section allows traders to set conditions to filter out certain signals. For example, one might only want to take buy signals when the RSI is below 30, ensuring they buy during oversold conditions.
Trade Direction and Backtest Period:
1. Trade Direction: Allows traders to specify whether they want to take long trades, short trades, or both.
2. Backtest Period: Specifies the time range for backtesting the strategy. Traders can choose from options like 'Last 6 months,' 'Last 1 year,' etc.
It's essential to remember that while default settings are provided for many of these tools, optimal settings can vary based on the market, timeframe, and trading style. Always backtest new settings on historical data to gauge their potential efficacy.
5. Understanding Strategy Conditions
Developing an understanding of the conditions set within a trading strategy is essential for traders to maximize its potential. Here, we delve deep into the logic behind these conditions, using the Supertrend Advance Strategy as our focal point.
Basic Logic Behind Conditions:
Every strategy is built around a set of conditions that provide buy or sell signals. The conditions are based on mathematical or statistical methods and are rooted in the study of historical price data. The fundamental idea is to recognize patterns or behaviors that have been profitable in the past and might be profitable in the future.
Buy and Sell Conditions:
1. Buy Conditions: Usually formulated around bullish signals or indicators suggesting upward price momentum.
2. Sell Conditions: Centered on bearish signals or indicators indicating downward price momentum.
Simple Strategy:
The simple strategy could involve using just the Supertrend indicator. Here:
• Buy: When price closes above the Supertrend line.
• Sell: When price closes below the Supertrend line.
Pullback Strategy:
This strategy capitalizes on price retracements:
• Buy: When the price retraces to the Supertrend line after a bullish signal and is supported by another bullish indicator.
• Sell: When the price retraces to the Supertrend line after a bearish signal and is confirmed by another bearish indicator.
Indicators Used:
EMA (Exponential Moving Average):
• Logic: EMA gives more weight to recent prices, making it more responsive to current price movements. A shorter-period EMA crossing above a longer-period EMA can be a bullish sign, while the opposite is bearish.
RSI (Relative Strength Index):
• Logic: RSI measures the magnitude of recent price changes to analyze overbought or oversold conditions. Values above 70 are typically considered overbought, and values below 30 are considered oversold.
MACD (Moving Average Convergence Divergence):
• Logic: MACD assesses the relationship between two EMAs of a security’s price. The MACD line crossing above the signal line can be a bullish signal, while crossing below can be bearish.
CCI (Commodity Channel Index):
• Logic: CCI compares a security's average price change with its average price variation. A CCI value above +100 may mean the price is overbought, while below -100 might signify an oversold condition.
And others...
As the strategy expands or contracts, more indicators might be added or removed. The crucial point is to understand the core logic behind each, ensuring they align with the strategy's objectives.
Logic Behind Each Indicator:
1. EMA: Emphasizes recent price movements; provides dynamic support and resistance levels.
2. RSI: Indicates overbought and oversold conditions based on recent price changes.
3. MACD: Showcases momentum and direction of a trend by comparing two EMAs.
4. CCI: Measures the difference between a security's price change and its average price change.
Understanding strategy conditions is not just about knowing when to buy or sell but also about comprehending the underlying market dynamics that those conditions represent. As you familiarize yourself with each condition and indicator, you'll be better prepared to adapt and evolve with the ever-changing financial markets.
6. Trade Execution and Management
Trade execution and management are crucial aspects of any trading strategy. Efficient execution can significantly impact profitability, while effective management can preserve capital during adverse market conditions. In this section, we'll explore the nuances of position entry, exit strategies, and various Stop Loss (SL) and Take Profit (TP) methodologies within the Supertrend Advance Strategy.
Position Entry:
Effective trade entry revolves around:
1. Timing: Enter at a point where the risk-reward ratio is favorable. This often corresponds to confirmatory signals from multiple indicators.
2. Volume Analysis: Ensure there's adequate volume to support the movement. Volume can validate the strength of a signal.
3. Confirmation: Use multiple indicators or chart patterns to confirm the entry point. For instance, a buy signal from the Supertrend indicator can be confirmed with a bullish MACD crossover.
Position Exit Strategies:
A successful exit strategy will lock in profits and minimize losses. Here are some strategies:
1. Fixed Time Exit: Exiting after a predetermined period.
2. Percentage-based Profit Target: Exiting after a certain percentage gain.
3. Indicator-based Exit: Exiting when an indicator gives an opposing signal.
Percentage-based SL/TP:
• Stop Loss (SL): Set a fixed percentage below the entry price to limit potential losses.
• Example: A 2% SL on an entry at $100 would trigger a sell at $98.
• Take Profit (TP): Set a fixed percentage above the entry price to lock in gains.
• Example: A 5% TP on an entry at $100 would trigger a sell at $105.
Supertrend-based SL/TP:
• Stop Loss (SL): Position the SL at the Supertrend line. If the price breaches this line, it could indicate a trend reversal.
• Take Profit (TP): One could set the TP at a point where the Supertrend line flattens or turns, indicating a possible slowdown in momentum.
Swing high/low-based SL/TP:
• Stop Loss (SL): For a long position, set the SL just below the recent swing low. For a short position, set it just above the recent swing high.
• Take Profit (TP): For a long position, set the TP near a recent swing high or resistance. For a short position, near a swing low or support.
And other methods...
1. Trailing Stop Loss: This dynamic SL adjusts with the price movement, locking in profits as the trade moves in your favor.
2. Multiple Take Profits: Divide the position into segments and set multiple TP levels, securing profits in stages.
3. Opposite Signal Exit: Exit when another reliable indicator gives an opposite signal.
Trade execution and management are as much an art as they are a science. They require a blend of analytical skill, discipline, and intuition. Regularly reviewing and refining your strategies, especially in light of changing market conditions, is crucial to maintaining consistent trading performance.
7. Visual Representations
Visual tools are essential for traders, as they simplify complex data into an easily interpretable format. Properly analyzing and understanding the plots on a chart can provide actionable insights and a more intuitive grasp of market conditions. In this section, we’ll delve into various visual representations used in the Supertrend Advance Strategy and their significance.
Understanding Plots on the Chart:
Charts are the primary visual aids for traders. The arrangement of data points, lines, and colors on them tell a story about the market's past, present, and potential future moves.
1. Data Points: These represent individual price actions over a specific timeframe. For instance, a daily chart will have data points showing the opening, closing, high, and low prices for each day.
2. Colors: Used to indicate the nature of price movement. Commonly, green is used for bullish (upward) moves and red for bearish (downward) moves.
Trend Lines:
Trend lines are straight lines drawn on a chart that connect a series of price points. Their significance:
1. Uptrend Line: Drawn along the lows, representing support. A break below might indicate a trend reversal.
2. Downtrend Line: Drawn along the highs, indicating resistance. A break above might suggest the start of a bullish trend.
Filled Areas:
These represent a range between two values on a chart, usually shaded or colored. For instance:
1. Bollinger Bands: The area between the upper and lower band is filled, giving a visual representation of volatility.
2. Volume Profile: Can show a filled area representing the amount of trading activity at different price levels.
Stop Loss and Take Profit Lines:
These are horizontal lines representing pre-determined exit points for trades.
1. Stop Loss Line: Indicates the level at which a trade will be automatically closed to limit losses. Positioned according to the trader's risk tolerance.
2. Take Profit Line: Denotes the target level to lock in profits. Set according to potential resistance (for long trades) or support (for short trades) or other technical factors.
Trailing Stop Lines:
A trailing stop is a dynamic form of stop loss that moves with the price. On a chart:
1. For Long Trades: Starts below the entry price and moves up with the price but remains static if the price falls, ensuring profits are locked in.
2. For Short Trades: Starts above the entry price and moves down with the price but remains static if the price rises.
Visual representations offer traders a clear, organized view of market dynamics. Familiarity with these tools ensures that traders can quickly and accurately interpret chart data, leading to more informed decision-making. Always ensure that the visual aids used resonate with your trading style and strategy for the best results.
8. Backtesting
Backtesting is a fundamental process in strategy development, enabling traders to evaluate the efficacy of their strategy using historical data. It provides a snapshot of how the strategy would have performed in past market conditions, offering insights into its potential strengths and vulnerabilities. In this section, we'll explore the intricacies of setting up and analyzing backtest results and the caveats one must be aware of.
Setting Up Backtest Period:
1. Duration: Determine the timeframe for the backtest. It should be long enough to capture various market conditions (bullish, bearish, sideways). For instance, if you're testing a daily strategy, consider a period of several years.
2. Data Quality: Ensure the data source is reliable, offering high-resolution and clean data. This is vital to get accurate backtest results.
3. Segmentation: Instead of a continuous period, sometimes it's helpful to backtest over distinct market phases, like a particular bear or bull market, to see how the strategy holds up in different environments.
Analyzing Backtest Results:
1. Performance Metrics: Examine metrics like the total return, annualized return, maximum drawdown, Sharpe ratio, and others to gauge the strategy's efficiency.
2. Win Rate: It's the ratio of winning trades to total trades. A high win rate doesn't always signify a good strategy; it should be evaluated in conjunction with other metrics.
3. Risk/Reward: Understand the average profit versus the average loss per trade. A strategy might have a low win rate but still be profitable if the average gain far exceeds the average loss.
4. Drawdown Analysis: Review the periods of losses the strategy could incur and how long it takes, on average, to recover.
9. Tips and Best Practices
Successful trading requires more than just knowing how a strategy works. It necessitates an understanding of when to apply it, how to adjust it to varying market conditions, and the wisdom to recognize and avoid common pitfalls. This section offers insightful tips and best practices to enhance the application of the Supertrend Advance Strategy.
When to Use the Strategy:
1. Market Conditions: Ideally, employ the Supertrend Advance Strategy during trending market conditions. This strategy thrives when there are clear upward or downward trends. It might be less effective during consolidative or sideways markets.
2. News Events: Be cautious around significant news events, as they can cause extreme volatility. It might be wise to avoid trading immediately before and after high-impact news.
3. Liquidity: Ensure you are trading in assets/markets with sufficient liquidity. High liquidity ensures that the price movements are more reflective of genuine market sentiment and not due to thin volume.
Adjusting Settings for Different Markets/Timeframes:
1. Markets: Each market (stocks, forex, commodities) has its own characteristics. It's essential to adjust the strategy's parameters to align with the market's volatility and liquidity.
2. Timeframes: Shorter timeframes (like 1-minute or 5-minute charts) tend to have more noise. You might need to adjust the settings to filter out false signals. Conversely, for longer timeframes (like daily or weekly charts), you might need to be more responsive to genuine trend changes.
3. Customization: Regularly review and tweak the strategy's settings. Periodic adjustments can ensure the strategy remains optimized for the current market conditions.
10. Frequently Asked Questions (FAQs)
Given the complexities and nuances of the Supertrend Advance Strategy, it's only natural for traders, both new and seasoned, to have questions. This section addresses some of the most commonly asked questions regarding the strategy.
1. What exactly is the Supertrend Advance Strategy?
The Supertrend Advance Strategy is an evolved version of the traditional Supertrend indicator. It's designed to provide clearer buy and sell signals by incorporating additional indicators like EMA, RSI, MACD, CCI, etc. The strategy aims to capitalize on market trends while minimizing false signals.
2. Can I use the Supertrend Advance Strategy for all asset types?
Yes, the strategy can be applied to various asset types like stocks, forex, commodities, and cryptocurrencies. However, it's crucial to adjust the settings accordingly to suit the specific characteristics and volatility of each asset type.
3. Is this strategy suitable for day trading?
Absolutely! The Supertrend Advance Strategy can be adjusted to suit various timeframes, making it versatile for both day trading and long-term trading. Remember to fine-tune the settings to align with the timeframe you're trading on.
4. How do I deal with false signals?
No strategy is immune to false signals. However, by combining the Supertrend with other indicators and adhering to strict risk management protocols, you can minimize the impact of false signals. Always use stop-loss orders and consider filtering trades with additional confirmation signals.
5. Do I need any prior trading experience to use this strategy?
While the Supertrend Advance Strategy is designed to be user-friendly, having a foundational understanding of trading and market analysis can greatly enhance your ability to employ the strategy effectively. If you're a beginner, consider pairing the strategy with further education and practice on demo accounts.
6. How often should I review and adjust the strategy settings?
There's no one-size-fits-all answer. Some traders adjust settings weekly, while others might do it monthly. The key is to remain responsive to changing market conditions. Regular backtesting can give insights into potential required adjustments.
7. Can the Supertrend Advance Strategy be automated?
Yes, many traders use algorithmic trading platforms to automate their strategies, including the Supertrend Advance Strategy. However, always monitor automated systems regularly to ensure they're operating as intended.
8. Are there any markets or conditions where the strategy shouldn't be used?
The strategy might generate more false signals in markets that are consolidative or range-bound. During significant news events or times of unexpected high volatility, it's advisable to tread with caution or stay out of the market.
9. How important is backtesting with this strategy?
Backtesting is crucial as it allows traders to understand how the strategy would have performed in the past, offering insights into potential profitability and areas of improvement. Always backtest any new setting or tweak before applying it to live trades.
10. What if the strategy isn't working for me?
No strategy guarantees consistent profits. If it's not working for you, consider reviewing your settings, seeking expert advice, or complementing the Supertrend Advance Strategy with other analysis methods. Remember, continuous learning and adaptation are the keys to trading success.
Other comments
Value of combining several indicators in this script and how they work together
Diversification of Signals: Just as diversifying an investment portfolio can reduce risk, using multiple indicators can offer varied perspectives on potential price movements. Each indicator can capture a different facet of the market, ensuring that traders are not overly reliant on a single data point.
Confirmation & Reduced False Signals: A common challenge with many indicators is the potential for false signals. By requiring confirmation from multiple indicators before acting, the chances of acting on a false signal can be significantly reduced.
Flexibility Across Market Conditions: Different indicators might perform better under different market conditions. For example, while moving averages might excel in trending markets, oscillators like RSI might be more useful during sideways or range-bound conditions. A mashup strategy can potentially adapt better to varying market scenarios.
Comprehensive Analysis: With multiple indicators, traders can gauge trend strength, momentum, volatility, and potential market reversals all at once, providing a holistic view of the market.
How do the different indicators in the Supertrend Advance Strategy work together?
Supertrend: This is primarily a trend-following indicator. It provides traders with buy and sell signals based on the volatility of the price. When combined with other indicators, it can filter out noise and give more weight to strong, confirmed trends.
EMA (Exponential Moving Average): EMA gives more weight to recent price data. It can be used to identify the direction and strength of a trend. When the price is above the EMA, it's generally considered bullish, and vice versa.
RSI (Relative Strength Index): An oscillator that measures the magnitude of recent price changes to evaluate overbought or oversold conditions. By cross-referencing with other indicators like EMA or MACD, traders can spot potential reversals or confirmations of a trend.
MACD (Moving Average Convergence Divergence): This indicator identifies changes in the strength, direction, momentum, and duration of a trend in a stock's price. When the MACD line crosses above the signal line, it can be a bullish sign, and when it crosses below, it can be bearish. Pairing MACD with Supertrend can provide dual confirmation of a trend.
CCI (Commodity Channel Index): Initially developed for commodities, CCI can indicate overbought or oversold conditions. It can be used in conjunction with other indicators to determine entry and exit points.
In essence, the synergy of these indicators provides a balanced, comprehensive approach to trading. Each indicator offers its unique lens into market conditions, and when they align, it can be a powerful indication of a trading opportunity. This combination not only reduces the potential drawbacks of each individual indicator but leverages their strengths, aiming for more consistent and informed trading decisions.
Backtesting and Default Settings
• This indicator has been optimized to be applied for 1 hour-charts. However, the underlying principles of this strategy are supply and demand in the financial markets and the strategy can be applied to all timeframes. Daytraders can use the 1min- or 5min charts, swing-traders can use the daily charts.
• This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
• The combination of the qualifiers results in a highly selective strategy which only considers the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
• Consequently, traders need to apply this strategy for a full watchlist rather than just one financial security.
• Default properties: RSI on (length 14, RSI buy level 50, sell level 50), EMA, RSI, MACD on, type of strategy pullback, SL/TP type: ATR (length 10, factor 3), trade direction both, quantity 5, take profit swing hl 5.1, highest / lowest lookback 2, enable ATR trail (ATR length 10, SL ATR multiplier 1.4, TP multiplier 2.1, lookback = 4, trade direction = both).
Monthly Performance Table by Dr. MauryaWhat is this ?
This Strategy script is not aim to produce strategy results but It aim to produce monthly PnL performance Calendar table which is useful for TradingView community to generate a monthly performance table for Own strategy.
So make sure to read the disclaimer below.
Why it is required to publish?:
I am not satisfied with the monthly performance available on TV community script. Sometimes it is very lengthy in code and sometimes it showing the wrong PNL for current month.
So I have decided to develop new Monthly performance or return in value as well as in percentage with highly flexible to adjust row automatically.
Features :
Accuracy increased for current month PnL.
There are 14 columns and automatically adjusted rows according to available trade years/month.
First Column reflect the YEAR, from second column to 13 column reflect the month and 14 column reflect the yearly PnL.
In tabulated data reflects the monthly PnL (value and (%)) in month column and Yearly PnL (value and (%)) in Yearly column.
Various color input also added to change the table look like background color, text color, heading text color, border color.
In tabulated data, background color turn green for profit and red for loss.
Copy from line 54 to last line as it is in your strategy script.
Credit: This code is modified and top up of the open-source code originally written by QuantNomad. Thanks for their contribution towards to give base and lead to other developers. I have changed the way of determining past PnL to array form and keep separated current month and year PnL from array. Which avoid the false pnl in current month.
Strategy description:
As in first line I said This strategy is aim to provide monthly performance table not focused on the strategy. But it is necessary to explain strategy which I have used here. Strategy is simply based on ADX available on TV community script. Long entry is based on when the difference between DIPlus and ADX is reached on certain value (Set value in Long difference in Input Tab) while Short entry is based on when the difference between DIMinus and ADX is reached on certain value (Set value in Short difference in Input Tab).
Default Strategy Properties used on chart(Important)
This script backtest is done on 1 hour timeframe of NSE:Reliance Inds Future cahrt, using the following backtesting properties:
Balance (default): 500 000 (default base currency)
Order Size: 1 contract
Comission: 20 INR per Order
Slippage: 5 tick
Default setting in Input tab
Len (ADX length) : 14
Th (ADX Threshhold): 20
Long Difference (DIPlus - ADX) = 5
Short Difference (DIMinus - ADX) = 5
We use these properties to ensure a realistic preview of the backtesting system, do note that default properties can be different for various reasons described below:
Order Size: 1 contract by default, this is to allow the strategy to run properly on most instruments such as futures.
Comission: Comission can vary depending on the market and instrument, there is no default value that might return realistic results.
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from the strategies built are realistic.
Disclaimer:
This script not provide indicative of any future results.
This script don’t provide any financial advice.
This strategy is only for the readymade snippet code for monthly PnL performance calender table for any own strategy.
RMI Trend Sync - Strategy [presentTrading]█ Introduction and How It Is Different
The "RMI Trend Sync - Strategy " combines the strength of the Relative Momentum Index (RMI) with the dynamic nature of the Supertrend indicator. This strategy diverges from traditional methodologies by incorporating a dual analytical framework, leveraging both momentum and trend indicators to offer a more holistic market perspective. The integration of the RMI provides an enhanced understanding of market momentum, while the Super Trend indicator offers clear insights into the end of market trends, making this strategy particularly effective in diverse market conditions.
BTC 4h long/short performance
█ Strategy: How It Works - Detailed Explanation
- Understanding the Relative Momentum Index (RMI)
The Relative Momentum Index (RMI) is an adaptation of the traditional Relative Strength Index (RSI), designed to measure the momentum of price movements over a specified period. While RSI focuses on the speed and change of price movements, RMI incorporates the direction and magnitude of those movements, offering a more nuanced view of market momentum.
- Principle of RMI
Calculation Method: RMI is calculated by first determining the average gain and average loss over a given period (Length). It differs from RSI in that it uses the price change (close-to-close) rather than absolute gains or losses. The average gain is divided by the average loss, and this ratio is then normalized to fit within a 0-100 scale.
- Momentum Analysis in the Strategy
Thresholds for Decision Making: The strategy uses predetermined thresholds (pmom for positive momentum and nmom for negative momentum) to trigger trading decisions. When RMI crosses above the positive threshold and other conditions align (e.g., a bullish trend), it signals a potential long entry. Similarly, crossing below the negative threshold in a bearish trend may trigger a short entry.
- Super Trend and Trend Analysis
The Super Trend indicator is calculated based on a higher time frame, providing a broader view of the market trend. This indicator uses the Average True Range (ATR) to adapt to market volatility, making it an effective tool for identifying trend reversals.
The strategy employs a Volume Weighted Moving Average (VWMA) alongside the Super Trend, enhancing its capability to identify significant trend shifts.
ETH 4hr long/short performance
█ Trade Direction
The strategy offers flexibility in selecting the trading direction: long, short, or both. This versatility allows traders to adapt to their market outlook and risk tolerance, whether looking to capitalize on bullish trends, bearish trends, or a combination of both.
█ Usage
To effectively use the "RMI Trend Sync" strategy, traders should first set their preferred trading direction and adjust the RMI and Super Trend parameters according to their risk appetite and trading goals.
The strategy is designed to adapt to various market conditions, making it suitable for different asset classes and time frames.
█ Default Settings
RMI Settings: Length: 21, Positive Momentum Threshold: 70, Negative Momentum Threshold: 30
Super Trend Settings: Length: 10, Higher Time Frame: 480 minutes, Super Trend Factor: 3.5, MA Source: WMA
Visual Settings: Display Range MA: True, Bullish Color: #00bcd4, Bearish Color: #ff5252
Additional Settings: Band Length: 30, RWMA Length: 20
LuxAlgo - Backtester (OSC)The OSC Backtester is an innovative strategy script that allows users to create a wide variety of strategies using various unique oscillators.
By utilizing our 'Step' and 'Match' algorithms, users can create custom and complex strategy entries from each of the supported oscillators and included conditions, as well as any external sources, allowing users to create entries from a sequence of conditions and/or multiple matching conditions.
We included a complete alert system that will send a notification for each action taken by the strategy and we also allow users to set custom messages for each action taken by a strategy.
🔶 Features
🔹 Step & Match Algorithm
More complex entry rules can be created by using multiple conditions together, this is done thanks to the Step dropdown setting on the right of each condition.
The Step setting is directly related to the Step & Match algorithm and works in two ways:
When two or more conditions have the same step number, both conditions are evaluated. Used to test matching conditions.
When two or more conditions have different step numbers, each conditions will be evaluated in order, testing for the first step and switching to the next step once the previous one is true. When the final step is true the strategy will open a market order. Used to create sequence of conditions.
This operation is complementary, as you can create a sequence of conditions with one step consisting of two or more matching conditions as long as they have the same step number.
🔹 Fully Customizable Entries From Various Oscillators And Conditions
We allow the users to set entries using our unique HyperWave, Smart Money Flow, and their derived conditions as entries.
The Hyper Wave is a normalized adaptive oscillator aiming to reflect price trends without returning a high amount of noise.
The Smart Money Flow aims to detect trends based on market activity, by doing a comparative analysis between current volume and historical volume. A Smart Money Flow above 50 suggest market participants are bullish, else bearish. Derived from this oscillator we have Overflow indications, this indicator detects when market is overbought or oversold based on participants activity.
Other entries include proprietary reversal signals, real-time divergence detection, oscillator confluence (indicating how aligned each oscillator is), as well as entries using external sources.
🔹 Complete Alert System
Users can get alerted for any action executed by a strategy, from opening positions to closing them.
The message field in the Alert Messages setting section allows for the strategy to send a custom alert message depending on the action taken by the strategy, if no messages are set the strategy will send default messages.
🔶 Usage
Users can create a wide variety of strategies from this script, whether they are trend-following or contrarian traders.
Let's see a contrarian (revesal-based) strategy example using the following entry conditions:
Long: Hyperwave bullish divergence and oversold Hyperwave (lower than 20).
Short: Hyperwave bearish divergence and overbought Hyperwave (greater than 20).
We can also introduce take-profit and stop-loss exit conditions based on external indicators, allowing more control over exits in our strategy. For example:
Long: Hyperwave crossing over 50 while money flow is bearish.
Short: Hyperwave crossing under 50 while money flow is bullish.
Exit Long on a profit (long exit tp): Hyperwave crossing 80.
Exit Short on a profit (short exit tp): Hyperwave crossing 20.
While this strategy script can be used as a standalone, we recommend using other indicators creatively to assist with entries and exits as well as TP/SLs.
Our Step & Match algorithm can magnify interoperability, allowing for way more complete strategies through complex conditions, let's demonstrate this using the following entries:
Long: Any bullish reversal occurring after the price crosses over the lowest upper reversal zone of the Signals & Overlays™.
Short: Any bearish reversal occurring after the price crosses under the highest lower reversal zone of the Signals & Overlays™.
Long TP/SL: 5 ATR's away from the entry price.
Short TP/SL: 5 ATR's away from the entry price.
🔶 Strategy Properties (Important)
This script backtest is done on daily EURGBP, using the following backtesting properties:
Balance (default): 10 000 (default base currency)
Order Size: 10% of the equity
Comission: 3.4 pips (average spread for EURGBP)
Slippage: 3 tick
Stop Loss: 0.02 points away from entry price
We use these properties to ensure a realistic preview of the backtesting system, do note that default properties can be different for various reasons described below:
Order Size: 1 contract by default, this is to allow the strategy to run properly on most instruments such as futures.
Comission: Comission can vary depending on the market and instrument, there is no default value that might return realistic results.
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from the strategies built are realistic.
🔶 How To Access
You can see the Author's Instructions below to learn how to get access.
LuxAlgo - Backtester (PAC)The PAC Backtester is an innovative strategy script that allows users to create a wide variety of strategies derived from price action-related concepts for a data-driven approach to discretionary trading strategies.
Thanks to our 'Step' and 'Match' algorithm, users can create custom and complex strategy entries and exits from features such as market structure, order blocks, imbalances, as well as any external indicators, allowing users to create entries from a sequence of conditions and/or multiple matching conditions.
We included a complete alert system that will send a notification for each action taken by the strategy and we also allow users to set custom messages for each action taken by a strategy.
🔶 Features
🔹 Step & Match Algorithm
More complex entry rules can be created by using multiple conditions together, this is done thanks to the Step dropdown setting on the right of each condition.
The Step setting is directly related to the Step & Match algorithm and works in two ways:
When two or more conditions have the same step number, both conditions are evaluated. Used to test matching conditions.
When two or more conditions have different step numbers, each condition will be evaluated in order, testing for the first step and switching to the next step once the previous one is true. When the final step is true the strategy will open a market order. Used to create a sequence of conditions.
This operation is complementary, as you can create a sequence of conditions with one step consisting of two or more matching conditions as long as they have the same step number.
🔹 Fully Customizable Price Action Concepts As Entries
We allow the users to use market structures, order blocks, imbalances, and external sources together to set their custom entry and exit conditions.
Market structures are commonly used to determine trend direction by indicating when prices break prior swing points. Their occurrence can be used as entry conditions.
Order blocks highlight areas where institutional market participants open positions, one can use order blocks to determine confirmation entries or potential targets as we can expect there is a large amount of liquidity at these order blocks. Price entering, being within, or mitigating an order block can be used as an entry condition.
Market imbalances highlight areas where there is a disparity between supply and demand. Price entering, being within, or mitigating an imbalance can be used as an entry condition.
This system also allows the use of external sources to create entry and exit conditions, such as moving averages, bands, trailing stops...etc.
🔹 Complete Alert System
Users can get alerted for any action executed by a strategy, from opening positions to closing them.
The message field in the Alert Messages setting section allows for the strategy to send a custom alert message depending on the action taken by the strategy, if no messages are set the strategy will send default messages.
🔶 Usage
Users can create complete price action strategies from this script, let's see an example using the following entry conditions:
Long: Mitigated bearish order block occurring during the New York session after a mitigated bearish imbalance.
Short: Mitigated bullish order block occurring during the New York session after a mitigated bullish imbalance.
Take Profit: 2 points away from the entry price.
Stop Loss: 1 point away from the entry price.
We can also use features from Price Action Concepts™ to construct custom exit conditions, leading to the following strategy conditions:
Long: Bullish CHoCH and price mitigates bearish FVG.
Short: Bearish CHoCH and price mitigates bullish FVG.
Exit Long: Price mitigates bearish order block.
Exit Short: Price mitigates bullish order block.
Users can achieve a wide variety of results by using external indicators as an input source for entries and exits, combining the best from price action and technical indicators. We might for example be interested in exiting a position when the RSI oscillator is overbought or oversold.
🔶 Strategy Properties (Important)
This script backtest is done on daily EURGBP, using the following backtesting properties:
Balance (default): 10 000 (default base currency)
Order Size: 10% of the equity
Comission: 3.4 pips (average spread for EURGBP)
Slippage: 1 tick
Stop Loss: 0.01 points away from entry price
We use these properties to ensure a realistic preview of the backtesting system, do note that default properties can be different for various reasons described below:
Order Size: 1 contract by default, this is to allow the strategy to run properly on most instruments such as futures.
Comission: Comission can vary depending on the market and instrument, there is no default value that might return realistic results.
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from strategies built are realistic.
🔶 How to access
You can see the Author's Instructions below to learn how to get access.
Price Action Pattern Breakout Strategy: Wedge,Triangle,ChannelIntroducing the Price Action Pattern Breakout Strategy: Wedge,Triangle,Channel 💹🚀
The "Price Action Pattern Breakout Strategy: Wedge, Triangle, Channel" is a dynamic and automated trading strategy that excels in recognizing and capitalizing on breakout opportunities within the realm of powerful price action patterns. It is finely tuned to achieve exceptional precision in detecting three distinct pattern types: Wedge, Triangle, and Channel. This diversity equips you to confidently navigate a wide range of market scenarios and opportunities.
This strategy automates trade entries and exits upon confirmed pattern breakouts, this eliminates human errors in correctly recognizing patterns and prevents emotional decisions. This strategy is designed to work across different time frames, making it suitable for both short-term and long-term traders. Whether you're a day trader, swing trader, or investor, this strategy provides the flexibility you need to thrive in diverse market conditions.
💎 How it Works:
▶️ In this strategy, three price action patterns have been utilized, one of which is the "Wedge" pattern. The Wedge pattern has consistently demonstrated a high level of credibility, typically resulting in sharp and rapid price movements following a confirmed breakout from this pattern. This characteristic makes the Wedge pattern highly noteworthy in our strategy. The second pattern is the "Triangle" pattern, which, depending on its formation, whether ascending or descending, can indicate a strong continuation or reversal of the trend. The last pattern is the "Channel" pattern. The reason for using the Channel pattern is its versatility in various market conditions and its tendency to produce reliable results.
In the snapshot below, you can observe the types of patterns that this strategy is capable of identifying at a glance:
▶️ This strategy employs two types of targeting systems: Fixed Targets and Trailing Targets.
Fixed Targets is the default targeting system of the strategy, incorporating two primary targets: TP1 (Target Point 1) and TP2 (Target Point 2). These targets are thoughtfully adjusted in alignment with specific rules for each pattern. With Fixed Targets, you have the flexibility to designate the position size percentage for your exits at TP1 and TP2. For instance, should you opt to allocate 60% of your position size to TP1, as soon as the price triggers the first take profit level, 60% of your initial position is gracefully closed, leaving the remaining 40% to exit the trade upon reaching TP2.
Trailing Targets represent the strategy's alternative targeting system. With this system, the trailing stop becomes active once the price reaches the specified trigger point. The strategy then exits the trade based on the defined offset percentage and price retracement from the trailing limit.
▶️ This strategy relies on a single type of stop loss, determined by previous pivot points and adjusted based on the trade's direction, whether long or short, placing the stop loss above or below the prior pivot. This stop loss approach has demonstrated reliability when used alongside price action patterns.
In addition to this fixed stop loss, you can specify a percentage buffer, offering protection against potential stop hunting due to market fluctuations. This buffer helps protect your positions from sudden price swings. For example, selecting a 1% buffer means your stop loss will be positioned 1% higher or lower concerning the last pivot, depending on your trade's direction. This added layer of security ensures your trades remain resilient and less vulnerable to market volatility.
▶️ A practical feature of this strategy is the "Risk-Free" option. Once activated, it continuously monitors price movements, and as soon as the price progresses in the trade's direction and surpasses the designated Risk-Free Trigger Point in percentage, the stop loss is dynamically shifted from its initial position to the entry price, effectively making the trade "risk-free." This means that if the trade doesn't go as expected, we exit at the entry point, incurring neither profit nor loss from the trade.
Additionally, you have the flexibility to fine-tune the modified stop loss, positioning it slightly above or below the entry price through the configuration of a specified percentage. This allows for effective consideration of commission fees in your trading strategy.
▶️ Risk management is a crucial concept in trading, playing a significant role in a trader's long-term success. This strategy introduces a unique feature called "Fixed Loss Position Sizing", where upon activation, you can limit the risk exposure to a specified percentage of your capital per trade. Set your preferred risk percentage along with the intended leverage. The strategy independently considers your available capital and designated leverage, determining the position size before executing any trade.
In the case of a stop loss, your loss is limited to the specified risk percentage. For instance, with a $1000 account and a 1% risk set, the strategy adjusts each trade's size to ensure a maximum loss of $10 if the stop loss is triggered. Enabling this feature will ensure disciplined risk management, aligning potential losses precisely with your predetermined risk percentage, contingent upon your total available capital.
▶️ Another feature of this strategy is a sophisticated mechanism called "Loss Compensation". When enabled, Loss Compensation dynamically adjusts the position size after a loss, aiming to recover from previous losses in subsequent trades. This adaptive mechanism continually modifies the position size to mitigate the impact of consecutive losses until reaching a user-defined limit for consecutive loss compensations.
The feature's configurability allows users to set the maximum number of consecutive losses to compensate for and also includes an option to factor in trading fees from prior trades into the compensation calculation. Loss Compensation operates in conjunction with the 'Fixed Loss Position Sizing' setting, ensuring that once losses are sufficiently compensated, subsequent entries revert to the predefined configurations within the 'Fixed Loss Position Sizing' settings.
This advanced tool ensures a stable risk management approach by changing trade sizes dynamically according to past results during consecutive loss periods.
▶️ This strategy incorporates a feature known as the "Counter-Pattern Breakout", altering its approach to wedge, triangle, and channel pattern breakouts. Normally, the strategy relies on standard pattern signals to determine whether to enter long or short positions based on breakout directions.
For example, in an ascending channel or a rising wedge pattern, the strategy typically seeks a short position opportunity upon a confirmed breakout in the lower line, and breakouts from the upper line are disregarded by the strategy. But with this feature enabled, strategy disregards the conventional pattern signals, seizing breakouts from upper or lower lines to open corresponding positions. For instance, in the ascending channel or the rising wedge pattern example, the strategy might enter a long position if the upper line breaks or a short position if the lower line breaks.
This introduces a more adaptive and opportunistic trading style, allowing you to capitalize on price movements, irrespective of the typical signal direction indicated by the pattern.
▶️ This strategy is fully compatible with third-party trading bots, allowing for easy connectivity to popular trading platforms. By leveraging the TradingView webhook functionality, you can effortlessly link the strategy to your preferred bot and receive accurate signals for position entry and exit. The strategy provides all the necessary alert message fields, ensuring a smooth and user-friendly trading experience. With this integration, you can automate the execution of trades, saving time and effort while enjoying the benefits of this powerful strategy.
⚙️ How to Use & Configure User Settings:
To fully utilize the "Price Action Pattern Breakout Strategy: Wedge, Triangle, Channel," it's essential to consider and comprehend the following steps. They play a crucial role in enhancing its functionality and achieving its utmost potential outcomes:
1. General Strategy Settings:
Enable Dark Mode if using a dark TradingView theme for improved chart visibility.
Select the Strategy's Trade Direction: Long, Short, or Both.
Choose Pattern Recognition Accuracy: High for precise recognition but fewer positions, Low for more positions with slightly less accuracy.
Enable 'Prevent New Entry on Opposite Signal While In Position' to avoid new trades if the opposite signal occurs.
Switch to Indicator Mode if solely using the strategy as an indicator or in combination with other strategies.
2. Pattern and Pivot Configuration:
Consider configuring the Number of Patterns and Pivot Lookback Lengths. Here, you can personalize the pivot lookback lengths for wedge, triangle, and channel patterns across eight different settings on your chart. For lower time frames, consider larger lengths to reduce chart noise. Alternatively, to maintain clarity on your chart, you can disable multiple patterns with different lengths while ensuring at least one pattern remains enabled.
Note that enabling more patterns doesn't always equate to increased potential profit. Sometimes, fewer patterns result in greater profit potential, and vice versa. Experiment with lengths and the number of patterns to determine the most profitable and optimal outcome for your trading symbol and timeframe.
3. Targeting System Selection:
Choose between 'Fixed Targets' or 'Trailing Targets' for your targeting system.
'Fixed Targets' is the default setting, operational when 'Trailing Targets' are turned off.
Set the TP1 Position Size as a percentage, defining the size for TP1, and the rest exits at TP2.
Optionally activate 'Skip Entry if TP1 is Passed' to bypass entering positions if the price has exceeded TP1.
Alternatively, opt for the 'Trailing Target' for dynamic exits based on trigger points and offsets. Note that this option disables fixed targets.
4. Stop Loss Configuration:
Determine the number of candles to consider for stop loss placement based on the last pivot.
Optionally add a percentage to the stop loss to create a buffer against market fluctuations, guarding your positions from sudden price swings.
5. Risk Management Configuration:
You can activate the 'Risk-Free' feature, making your trades risk-free by moving the stop loss to the entry price upon reaching a specified trigger point.
You have the possibility to enable 'Fixed Loss Position Sizing' to limit risk to a percentage of total capital per trade, ensuring prudent risk management.
You can employ 'Use Real-Time Balance for Each Entry' to precisely calculate fixed loss position sizing according to the real-time balance for every entry.
The 'Loss Compensation' feature can be activated to automatically adjust trade sizes during consecutive losses and compensate for prior incurred losses.
Loss compensation continues adjusting trade sizes until it reaches the defined limit of consecutive losses specified in the 'Maximum Consecutive Losses To Compensate' field.
You can factor in commission fees by specifying a percentage in the 'Include Trading Fees in Compensation (%)' field, providing an option for more accurate loss compensation calculations.
You have the option to enable 'Limit Compensation to Real-Time Balance' to prevent consecutive loss compensation from exceeding your current real-time account balance.
It's important to note that for the 'Loss Compensation' feature to operate, the 'Fixed Loss Position Sizing' must be enabled.
6. Counter-Pattern Breakout Configuration:
In this section you have the option to enable the "Counter-Pattern Breakout" feature to adjust the strategy's approach to wedge, triangle, and channel pattern breakouts. Once enabled, the strategy disregards traditional pattern signals and capitalizes on breakouts from either the upper or lower lines, initiating corresponding positions accordingly.
Choose between 'Fixed Target' or 'Trailing Target' for your targeting system. If you opt for the 'Fixed Target', set a specific target point as a percentage, serving as the default target for counter-pattern breakouts. Alternatively, choose the 'Trailing Target' for dynamic exits based on trigger points and offsets. Do keep in mind that selecting the 'Trailing Target' option disables the fixed target setting.
Keep in mind that for standard, non-counter-pattern breakouts, the target point settings in their respective sections remain applicable, distinct from the settings configured for targeting within this section.
Note that the stop loss configurations are shared across standard pattern and counter-pattern breakouts and can be adjusted within the stop loss section.
7. Info Tables:
In the info tables section, you can show or hide different tables on the charts. This includes the backtest table, the current balance table displaying available funds, and a table showcasing Maximum Consecutive Wins or Losses. Choose which to display according to your preferences and specific needs.
8.Date & Time Range Filter:
Utilize the Date & Time Range filter feature to precisely select a start and end date, including time, to filter data within the chosen range.
When connecting this strategy to a trading bot for automated trades, ensure to set the start date and time to the intended initiation moment to avoid undesired outcomes as this directly affects the real-time balance calculations of the strategy.
8. Integration with Third-Party Bots:
To automate trading, leverage the strategy's compatibility with third-party trading bots. Seamlessly integrate the strategy into well-known trading platforms by using alert message fields to input commands from third-party trading bots, enabling automated trade execution for both long and short positions.
By furnishing these adjustable settings, the strategy empowers you to personalize it according to your unique requirements, thereby bolstering the adaptability and efficacy of your trading approach.
🔐 Source Code Protection:
The 'Price Action Pattern Breakout Strategy: Wedge, Triangle, Channel' source code is engineered for precision, reliability, and effectiveness. Its original and innovative design warrants protection and restricted access, preserving the strategy's exclusivity. Safeguarding the code maintains the strategy's integrity and distinctiveness, providing users with a competitive advantage in their trading endeavors.
Crypto Market Strategy (CMS)/Introduction
The Crypto Market Strategy (CMS) is a composite strategy for the cryptocurrency market. It integrates multiple strategies (called signals) to ensure you are exploiting multiple patterns/anomalies in the market.
/Signals
The three distinct strategies, each providing signals based on specific market conditions are explained below:
1. Limit Range: This signal targets stable market periods, triggering signals based on micro breakouts in price. The market during this period is described as stable because of the short lookback period required for breakout, four bars is the default.
2. Trend Breakout: This signal seeks to capitalize on significant market movements following consolidation periods, it triggers when large price breakouts occur. The market during this period is described as volatile because of the long lookback period required for breakout, forty bars is the default.
3. Momentum: After breakouts, price uptrends may persist for a long time, typically weeks to months. This signal captures long term trends.
An upward blue arrow signifies a long entry signal, a downward red arrow indicates a short entry signal, while an upward/downward pink arrow indicates an exit signal. All signals will have a label indicating the triggering strategy and number of units (this can be disabled in the style settings).
/Construction
The strategy is constructed using minimal indicators, it is basically price action and moving averages.
/Settings
The settings are organised according to the signals;
1. Limit range
Entry - This is the size of breakout
+Exit - Closes the trade in profit
-Exit - Closes the trade to minimise loss
2. Trend breakout
Entry - This is the size of the breakout
Exit - Closes the trade to minimise loss
3. Momentum
Entry - This determines how quickly a signal is triggered
Lookback - This is the duration considered for the entry
/Results
The backtest results are based on a starting capital of $13,700 (convenient amount for retail traders) with 5% of equity for the position size and pyramiding of 3 consecutive positions because there are three signals. Commissions vary from broker to broker with some charging zero commissions, so commissions is set to an exorbitant $3 per order to ensure profitability in backtests is reproducible in live trading. Slippage of 3 ticks is used to ensure the results are representative of real world, market order, end-of-day trading. The backtest results are available to view at the bottom of this page.
Note:
Past performance in backtesting does not guarantee future results. Cryptocurrency markets are particularly volatile, and individual execution and market changes can significantly affect strategy performance. Price data may also vary across exchanges.
/Tickers
CMS has been backtested primarily on BTCUSD. It also performs well on ETHUSD.
Seasonal Market Strategy (SMS)/Introduction
The Seasonal Market Strategy (SMS) is not a technical strategy, it is based on market seasonality and draws heavily from the work of Yale Hirsch, creator of the Stock Trader's Almanac.
/Signals
The strategy is long only. Four different seasonal signals are generated to ensure stock market history, cycles, psychology and patterns are turned into actionable trades. The signals are:
1. Sell in May and Go Away: A strategy suggesting investors sell stocks in May and avoid the market until November, based on historical underperformance during this period.
2. Turn of the Month: Trading tactic that capitalises on the tendency of stock prices to rise at the month's beginning.
3. Santa Claus Rally: Refers to the often-seen increase in stock prices around Christmas and the New Year.
4. Turn Around Tuesday: A pattern where stock markets rebound on Tuesdays following a decline on Mondays.
There is no logic or calculation, just dates for entry and exit. These seasonal patterns are explained in various places online for those who want to understand why they are profitable. Stock Trader's Almanac is a good resource to start with.
/Interpretation
SMS will display an upward blue arrow signifying a buy signal after the candle closes, when entry conditions are met. A label below the arrow will describe which signal was triggered and a number depicting the number of units (they can be deactivated in the style settings). SMS will also display a downwards pink arrow above the candle when the exit conditions are met.
/Strategy Results
The backtest results are based on a starting capital of $13,700 (convenient amount for retail traders) with 5% of equity for the position size and pyramiding of 4 consecutive positions because there are four signals. Because of the large amount of trades, this strategy is suitable with brokers that do not charge commissions, so commissions is set to zero while slippage of 3 ticks is used to ensure the results are representative of real world, market order, end-of-day trading. The backtest results are available to view at the bottom of this page.
NOTE:
Past results are not indicative of future results. The strategy is backtested in ideal conditions, it has no predictive abilities and seasonal trends may breakdown at anytime hence, results from live trading may not achieve the same performance shown here as each trader may introduce subjectivity or interfere with its performance or market conditions might change significantly.
/Tickers
This strategy has been backtested on the Dow Jones Industrial Average ETF with ticker DIA but it also performs well with the SPY ticker which is the ETF for the S&P500.
IchiBot - [SigmaStreet]
The IchiBot Indicator has been used to develop automated trading systems. It leverages the open-source Ichimoku framework provided by Trading View, to enable users to creatively generate over 1 trillion different combinations of trading conditions with the use of multiple timeframes to create unique “signal labels” that can be used to create custom strategies or provide in depth market analysis. At the end of this description, I have provided an example of input settings for a simple scalping strategy that I have back tested on US30 on the 5 minute timeframe.
Overview of the Settings:
The visuals section includes an option to show or hide certain parts of the indicator and change the size of the signal labels plotted on the chart.
Next to the “Signal color on baseline/candles” section, you can choose if you want to see additional signals generations from the most previous plotted label on a color changing baseline, or color changing candles. A color change from gray to blue/red indicate that the conditions from the most previously plotted signal label have been met again.
The next 5 sections are all related to the strategy portion of the indicator, used to aid in the back testing process. These sections are titled “Stop loss”, “Take Profit”, “Trail Stop”, “Trade Settings” and “Trade Schedule”.
The Stop Loss section includes an option to choose between value of “pts”, “atr” (average true range) or “None”. The stop loss value in “pts” is simply a specified number of points or pips from the current entry price of a trade that are input in the “SL” section. If the stop loss type is “atr” the “SL” section is not used and the value is calculated and displaced from the current entry price of a trade based on the atr period multiplied by the atr multiplier.
The take profit section is based on the same logic as the stop loss.
The Trail Stop section includes an option to choose between values “pts” or “None”. If the Trail Stop value is “pts”, a trailing stop loss is activated if a trade moves a point value into profit that exceeds the value of the “Trail Activation”. If the Trail Offset type is “pts”, the trailing stop loss is placed a point value away from the current price that is equal to the “Trail Offset” value.
The trade settings section has two options to either prevent or allow trade reversals and prevent or allow only 1 trade per signal label.
If the “Don’t allow trade reversals” is on, then a currently active trade can not be cancelled by an opposite trade signal. It can only be cancelled by the exit logic selected in the above sections. If the “One trade per signal” is selected, the strategy will only enter a trade if the most recent signal label is different from the last signal label where a trade was entered, or if the most recent signal label is in the opposite direction of the most recent signal label where a trade was entered.
The trade schedule section includes an option to only generate signal labels during the specified time. You can choose between 24/7 which will generate signals without any time restriction, or you can choose a custom time which is based on the America / New York time zone.
The timeframe settings section includes an option to choose “single” or “multiple” timeframes, as well as an option to show every signal label combination (“all”), or only the signal labels with the highest numerical value (“absolute”).
If you select “single” next to “timeframe”, the indicator will show you labels based on trade conditions met from only 1 selected timeframe. If you select “multiple” next to “timeframe”, the indicator is designed to return signal labels based on trade conditions that have been met on at least 2 different timeframes.
If you select “multiple” and “use current timeframe”, the indicator will include labels that always include a minimum of 2 timeframes where 1 timeframe is always the current timeframe. If you unselect the “use current timeframe”, the indicator will include labels with a minimum of 2 timeframes.
If you select “multiple” next to “timeframe” and “all” next to “Show all/absolute labels”, the indicator will show you every possible combination of labels that vary from trade conditions met on a minimum of 2 timeframes, to the maximum number of timeframes selected.
If you select “multiple” next to “timeframe” and “absolute” next to “Show all/absolute labels”, the indicator will only show you labels where the numerical value is equivalent to the maximum number of timeframes selected.
Each signal label provides a number which refers to the number of timeframes used to generate the label, offering insights briefly. Hover over a label to reveal detailed tooltip information that details the exact timeframes used to generate each label.
You can choose all from “Show all/absolute labels” to see every possible combination of trade signals or “absolute” to only see labels that have the highest possible numerical value. Absolute means that every condition selected from every timeframe was calculated to be true at the same time on the same candle.
The next 8 sections are “Current timeframe trade conditions”, “1-minute timeframe trade conditions”, “5-minute timeframe trade conditions”, “15-minute timeframe trade conditions”, “30-minute timeframe trade conditions”, “1-hour timeframe trade conditions”, “4-hour timeframe trade conditions”, “Daily timeframe trade conditions”.
These sections include the same 10 trade conditions, that can be used independently, or in combination with each other. This brings the total number of trade conditions to 70.
The final section includes a standard option to adjust the current Ichimoku values.
Understanding the Calculations:
The term “future” refers to a value that is calculated 26 candles to the right of the most recent closing price.
The term “current” refers to a value that is calculated on the most recent closing price.
The term “past” refers to a value that is calculated 26 candles to the left of the most recent closing price.
Bullish is referred to as “blue” and bearish is referred to as “red”.
Buy Signals:
1. The current closing price is greater than the current cloud value.
2. The future cloud is blue.
3. The current closing price is greater than the current conversion line.
4. The current conversion line is greater than the current baseline.
5. The lagging span is greater than the closing price of the last 25 candles.
6. The lagging span is greater than the past cloud.
7. The lagging span is greater than the past conversion line and the past baseline.
8. The current conversion line is greater than the current cloud.
9. The current baseline is greater than the current cloud.
10. The value of the current cloud to the future cloud is completely blue.
Sell Signals:
1. The current closing price is less than the current cloud value.
2. The future cloud is red.
3. The current closing price is less than the current conversion line.
4. The current conversion line is less than the current baseline.
5. The lagging span is less than the closing price of the last 25 candles.
6. The lagging span is less than the past cloud.
7. The lagging span is less than the past conversion line and the past baseline.
8. The current conversion line is less than the current cloud.
9. The current baseline is less than the current cloud.
10. The value of the current cloud to the future cloud is completely red.
The script enables users to access the value of these 10 trade conditions across the 7 major time frames (1-minute, 5-minute, 15-minute, 30-minute, 1-hour, 4-hour, Daily, and the current charts time frame) by using the official non repainting request security function provided by Trading View:
f_secSecurity(_src, _res, _exp) =>
request.security(_src, _res, _exp )
This indicator provides up to 70 variables (10 variables X 7 timeframes) that can be used separately, or in combination to generate signal labels.
Enhance your visual analysis with a color-changing baseline and candle colors that adapt to signal shifts, offering an immediate understanding of market trends. The base line will change from gray to blue/red which will reference the most previously plotted signal label. This change in color indicate that the conditions from the most recently plotted signal label have been met once again. Please refer to the example below.
Adjustments to the Ichimoku Indicator:
The script uses a slightly refined version of the Ichimoku indicator to calculate 10 different “trade conditions”. Each trade condition can create 1 bullish signal label and 1 bearish signal label. The calculations are primarily based on “greater than and less than logic” which is standard for signal generation.
In the original Ichimoku calculations, the “Lagging Span” has a default value of 26 periods. In the actual calculations, this input with the title “Lagging Span” is referred to as the “displacement”. When the lagging span is plotted on the chart, it is plotted with an offset value of offset = -displacement + 1 which technically plots the lagging span 25 candles to the left the most recent candle (if you count the most recent closing price as 0 and not 1). The clouds are plotted with an offset of offset = displacement -1 which technically plots the clouds 25 candles to the right of the most recent candle.
I have adjusted the logic of the Ichimoku indicator so the lagging span is still plotted 25 candles to the left of the most recently confirmed candle close, but the cloud is plotted 26 candles to the right of the most recent confirmed candle close.
This seemingly small adjustment of one candle cannot simply be adjusted in the settings of the original Ichimoku indicator since the calculations of the cloud and lagging span displacements are directly affected by the same value (displacement = 26, also known as the “lagging span”). My script is adjusted to make calculations where the lagging span is 25 candles to the left of the most recent candle, and the cloud is displaced 26 candles to the right of the most recent candle.
For example, my scripts logic to detect if the current closing price is over the current cloud is (close > leadLead1 and close > leadLine2 and leadLine1 > leadLine2 . By using a lookback of , the logic assumes that the displaced value is 26 bars to the right of the most recent candle. My script also reflects this logic in the plotted values of the cloud where the offset values are offset = displacement. This adjustment is made without affecting any other part of the Ichimoku indicators calculations, only the displacement of the cloud which directly affects the logic of trade conditioins. This change is a deliberate and necessary function of this script’s logic to generate trade conditions and signal labels.
I’ve removed the conversion line and the lagging span and introduced a 26-period pivot high/low to provide a less cluttered chart. The pivot high/low looks 26 periods to the left and only 1 period to the right. The lagging span and conversion line logic is still built into the framework of the trading signals. If you choose to enable the lagging span, or conversion line.
trading approach, and always test your strategies thoroughly.
The function to generate the "Signal Labels" calculates every single possible combination of the 7 different timeframes which is a total of 127 combinations for bullish signal labels, and 127 combinations for bearish signal labels. This function also provides the necessary criteria for the strategy entry conditions, based on the dynamically calculated values derived from the signal labels themselves. For example: "buy signal on 1 minute and 5 minute timeframe" is considered 1 combination, and "Buy signal on current, 5 minute, 15 minute, 30 minute, 1 hour, 4 hour and daily timeframe" is also considered 1 combination. There are a total of 254 combinations between buy and sell signal labels along with 254 individual variables with their own unique tool tip description. The signal label function alone spans over 1340 lines of code (minus spaces and comments) to specifically account for every possible variable combination. This unique and original function also calculates the signal label "value" which is the number you see on the signal label. This function adjusts the amount of labels plotted, the value and description of all labels based on the timeframe settings "single"/"multiple", the use of "use current timeframe" setting, and the "trade schedule". This signal label function has been a landmark piece of code for me in my endeavor to create and optimize my strategies based on its ability to provide an in depth analysis of the timeframes used when generating signal labels. This function is main reason that this script has been published closed source.
Back tested results.
The current results are from US30 (Dow Jones Industrial Average CFD) on the 5-minute timeframe using regular candles. The inputs are as follows:
Stop loss = 5000 pts
No take profit.
Trail activation = 100 pts
Trail offset = 100 pts
Don’t allow trade reversals
Trade 24/7
Timeframe = multiple
Show absolute signals
Use current timeframe, lag span over/under candles
Use 30m timeframe, all cloud is bull/bear
Initial capital = $10,000 USD, 1 contract, $0.07 per contract, slippage = 3 ticks, use bar magnifier = on
Timeframe = June 1st, 2023 – November 10th, 2023, risk = 5% (greatest loosing trade = $500.44)
Sniper [Decentrader]Bespoke Decentrader Mean Reversion / Colume based support/resistance Strategy builder.
Colour-coded mean line using price and volume
Volatility Bands (chose % or Std Dev)
Major support and resistance plotted lines
Suggested dynamic hard-stop placement
Built for all markets
A realistic strategy for multi-asset portfolio management
Complementary components to assist other indicators/strategies
Filtering for Long / Short only conditions is possible under settings.
Can be automated by including 3rd party code into the settings to be used as alerts.
Use the Mitigate lines to show previous areas of support or resistance, which have been broken.
4 main strategy options:
1. You can choose whether to enter based on the upper or lower Meanline. If the price is below the Meanline, the lower Meanline will be used for entry, while if the price is above the Meanline, the upper Meanline will be used. If you want to use this condition to exit the position, you also need to select the "Exit at the Meanline" option as well.
2. If the selected strategy is "3. Buy/Sell Volatility Bands," you can specify which Band should trigger the position to open. The price must touch or cross the edge of the chosen Band. Additionally, if the "Exit at the Volatility Bands" option is selected, the same Band will be used for the exit criteria.
3. Buy/Sell Meanline retest": A position will be opened when the price retests the Meanline. The price must touch or wick through the Meanline without closing below/above it. (If this strategy is combined with "Exit at the Meanline" option, then in case price goes against our position, the strategy will exit if the price closes under/above the meanline
Buy/Sell Meanline breakout (UP/DOWN)": A long or short position will be opened when the price breaks above or below the Meanline
4. Buy/Sell Support/Resistance lines": A position will be opened when the price touches the support or resistance lines. This option can also be combined with the "Exit at the Meanline" option.
This tool can be used to help enter a trending asset or find entries for an asset retracing.
Please take care to test strategies before automation, which is also possible.
Ironman [Decentrader]Ironman
What is it? how it does it? And how to use it:
i) Ironman is a multifaceted strategy builder, which uses coloured candles which represent certain customisable inputs being in confluence with one another and the set scenario.
ii) There are 7 customised technical indicators which can be input as a basis for the analytical review.
iii) Determine a primary indicator which dictates a bullish or bearish trend (and colour) and then optionally add up to 6 other indicators to be required to be in confluence which adds another colour to be represented.
An example might be two moving averages crossing as the main trend determination. The primary determinant is dictated as the trend being “bullish or bearish” and the added confluence adds an additional layer being “very bullish or very bearish”
iv) Users select which conditions they wish to enter and exit trades on using the Bullish / Very Bullish and Bearish / Very Bearish settings. This can be combined with other timeframes.
v) The selected inputs for each indicator will show in a table contained in the bottom right-hand corner. Active indicators within the system will be highlighted.
vi) Ironman is built to include various take profit and stop loss options such as trailing stops, and fixed percentage targets which can be included in the strategy. Different timeframes can be used to determine the stop if users wish to do so.
vii) Users can require that there is also confluence with a differing time period or choose long and short-only options which can be dictated independently or based upon filtering criteria using moving averages.
viii) Using the strategy settings, users are also able to choose backtesting periods.
ix) Position label settings allow users to show various backtesting options such as profit by position, total backtesting results and results for the active position.
x) Ironman enables users to automate trading easily using the input boxes under Alert messages which also allows connection to a third party which can conduct execution. Always make sure to thoroughly test the strategy if it is being automated.
xi) To get the best out of Ironman, build up a strategy for the timeframe and asset you are looking at and back-test outcomes as variables are layered in. Ensure to backtest over a suitable length of time.
xii) When optimising input variables, it can sometimes visually assist in having the underlying inputs on the screen via the standard indicators.
xiii) There are many boxes of information in the input variables, which explain how to use each part. Users can also add features such as a marker showing on the chart where all indicators are bullish/bearish, or where RSI is overbought / over sold.
xiv) Users can further customise the style of the tool under the style tab in the indicator settings.
Captain Backtest Model [TFO]Created by @imjesstwoone and @mickey1984, this trade model attempts to capture the expansion from the 10:00-14:00 EST 4h candle using just 3 simple steps. All of the information presented in this description has been outlined by its creators, all I did was translate it to Pine Script. All core settings of the trade model may be edited so that users can test several variations, however this description will cover its default, intended behavior using NQ 5m as an example.
Step 1 is to identify our Price Range. In this case, we are concerned with the highest high and the lowest low created from 6:00-10:00 EST.
Step 2 is to wait for either the high or low of said range to be taken out. Whichever side gets taken first determines the long/short bias for the remainder of the Trade Window (i.e. if price takes the range high, bias is long, and vice versa). Bias must be determined by 11:15 EST, otherwise no trades will be taken. This filter is intended to weed out "choppy" trading days.
Step 3 is to wait for a retracement and enter with a close through the previous candle's high (if long biased) or low (if short biased). There are a couple toggleable criteria that we use to define a retracement; one is checking for opposite close candles that indicate a pullback; another is checking if price took the previous candle's low (if long biased) or high (if short biased).
This trade model was initially tested for index futures, particularly ES and NQ, using a 5m chart, however this indicator allows us to backtest any symbol on any timeframe. Creators @imjesstwoone and @mickey1984 specified a 5 point stop loss on ES and a 25 point stop loss on NQ with their testing.
I've personally found some success in backtesting NQ 5m using a 25 point stop loss and 75 point profit target (3:1 R). Enabling the Use Fixed R:R parameter will ensure that these stops and targets are utilized, otherwise it will enter and hold the position until the close of the Trade Window.
Bollinger Bands StrategyBollinger Bands Strategy :
INTRODUCTION :
This strategy is based on the famous Bollinger Bands. These are constructed using a standard moving average (SMA) and the standard deviation of past prices. The theory goes that 90% of the time, the price is contained between these two bands. If it were to break out, this would mean either a reversal or a continuation. However, when a reversal occurs, the movement is weak, whereas when a continuation occurs, the movement is substantial and profits can be interesting. We're going to use BB to take advantage of this strong upcoming movement, while managing our risks reasonably. There's also a money management method for reinvesting part of the profits or reducing the size of orders in the event of substantial losses.
BOLLINGER BANDS :
The construction of Bollinger bands is straightforward. First, plot the SMA of the price, with a length specified by the user. Then calculate the standard deviation to measure price dispersion in relation to the mean, using this formula :
stdv = (((P1 - avg)^2 + (P2 - avg)^2 + ... + (Pn - avg)^2) / n)^1/2
To plot the two Bollinger bands, we then add a user-defined number of standard deviations to the initial SMA. The default is to add 2. The result is :
Upper_band = SMA + 2*stdv
Lower_band = SMA - 2*stdv
When the price leaves this channel defined by the bands, we obtain buy and sell signals.
PARAMETERS :
BB Length : This is the length of the Bollinger Bands, i.e. the length of the SMA used to plot the bands, and the length of the price series used to calculate the standard deviation. The default is 120.
Standard Deviation Multipler : adds or subtracts this number of times the standard deviation from the initial SMA. Default is 2.
SMA Exit Signal Length : Exit signals for winning and losing trades are triggered by another SMA. This parameter defines the length of this SMA. The default is 110.
Max Risk per trade (in %) : It's the maximum percentage the user can lose in one trade. The default is 6%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, meaning that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:BTCUSD in 8h timeframe with the following parameters :
BB Length = 120
Standard Deviation Multipler = 2
SMA Exit Signal Length = 110
Max Risk per trade (in %) = 6%
ENTER RULES :
The entry rules are simple:
If close > Upper_band it's a LONG signal
If close < Lower_band it's a SHORT signal
EXIT RULES :
If we are LONG and close < SMA_EXIT, position is closed
If we are SHORT and close > SMA_EXIT, the position is closed
Positions close automatically if they lose more than 6% to limit risk
RISK MANAGEMENT :
This strategy is subject to losses. We manage our risk using the exit SMA or using a SL sets to 6%. This SMA gives us exit signals when the price closes below or above, thus limiting losses. If the signal arrives too late, the position is closed after a loss of 6%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the fixed ratio value, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 8h, this strategy is a medium/long-term strategy. That's why only 51 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
Rate of Change StrategyRate of Change Strategy :
INTRODUCTION :
This strategy is based on the Rate of Change indicator. It compares the current price with that of a user-defined period of time ago. This makes it easy to spot trends and even speculative bubbles. The strategy is long term and very risky, which is why we've added a Stop Loss. There's also a money management method that allows you to reinvest part of your profits or reduce the size of your orders in the event of substantial losses.
RATE OF CHANGE (ROC) :
As explained above, the ROC is used to situate the current price compared to that of a certain period of time ago. The formula for calculating ROC in relation to the previous year is as follows :
ROC (365) = (close/close (365) - 1) * 100
With this formula we can find out how many percent the change in the current price is compared with 365 days ago, and thus assess the trend.
PARAMETERS :
ROC Length : Length of the ROC to be calculated. The current price is compared with that of the selected length ago.
ROC Bubble Signal : ROC value indicating that we are in a bubble. This value varies enormously depending on the financial product. For example, in the equity market, a bubble exists when ROC = 40, whereas in cryptocurrencies, a bubble exists when ROC = 150.
Stop Loss (in %) : Stop Loss value in percentage. This is the maximum trade value percentage that can be lost in a single trade.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by an amount chosen by the user.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:BTCUSD in 1D timeframe with the following parameters :
ROC Length = 365
ROC Bubble Signal = 180
Stop Loss (in %) = 6
LONG CONDITION :
We are in a LONG position if ROC (365) > 0 for at least two days. This allows us to limit noise and irrelevant signals to ensure that the ROC remains positive.
SHORT CONDITION :
We are in a SHORT position if ROC (365) < 0 for at least two days. We also open a SHORT position when the speculative bubble is about to burst. If ROC (365) > 180, we're in a bubble. If the bubble has been in existence for at least a week and the ROC falls back below this threshold, we can expect the asset to return to reasonable prices, and thus a downward trend. So we're opening a SHORT position to take advantage of this upcoming decline.
EXIT RULES FOR WINNING TRADE :
The strategy is self-regulating. We don't exit a LONG trade until a SHORT signal has arrived, and vice versa. So, to exit a winning position, you have to wait for the entry signal of the opposite position.
RISK MANAGEMENT :
This strategy is very risky, and we can easily end up on the wrong side of the trade. That's why we're going to manage our risk with a Stop Loss, limiting our losses as a percentage of the trade's value. By default, this percentage is set at 6%. Each trade will therefore take a maximum loss of 6%.
If the SL has been triggered, it probably means we were on the wrong side. This is why we change the direction of the trade when a SL is triggered. For example, if we were SHORT and lost 6% of the trade value, the strategy will close this losing trade and open a long position without taking into account the ROC value. This allows us to be in position all the time and not miss the best opportunities.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 1D, this strategy is a medium/long-term strategy. That's why only 34 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
RSI & Backed-Weighted MA StrategyRSI & MA Strategy :
INTRODUCTION :
This strategy is based on two well-known indicators that work best together: the Relative Strength Index (RSI) and the Moving Average (MA). We're going to use the RSI as a trend-follower indicator, rather than a reversal indicator as most are used to. To the signals sent by the RSI, we'll add a condition on the chart's MA, filtering out irrelevant signals and considerably increasing our winning rate. This is a medium/long-term strategy. There's also a money management method enabling us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
RSI :
The RSI is one of the best-known and most widely used indicators in trading. Its purpose is to warn traders when an asset is overbought or oversold. It was designed to send reversal signals, but we're going to use it as a trend indicator by increasing its length to 20. The RSI formula is as follows :
RSI (n) = 100 - (100 / (1 + (H (n)/L (n))))
With n the length of the RSI, H(n) the average of days closing above the open and L(n) the average of days closing below the open.
MA :
The Moving Average is also widely used in technical analysis, to smooth out variations in an asset. The SMA formula is as follows :
SMA (n) = (P1 + P2 + ... + Pn) / n
where n is the length of the MA.
However, an SMA does not weight any of its terms, which means that the price 10 days ago has the same importance as the price 2 days ago or today's price... That's why in this strategy we use a RWMA, i.e. a back-weighted moving average. It weights old prices more heavily than new ones. This will enable us to limit the impact of short-term variations and focus on the trend that was dominating. The RWMA used weights :
The 4 most recent terms by : 100 / (4+(n-4)*1.30)
The other oldest terms by : weight_4_first_term*1.30
So the older terms are weighted 1.30 more than the more recent ones. The moving average thus traces a trend that accentuates past values and limits the noise of short-term variations.
PARAMETERS :
RSI Length : Lenght of RSI. Default is 20.
MA Type : Choice between a SMA or a RWMA which permits to minimize the impact of short term reversal. Default is RWMA.
MA Length : Length of the selected MA. Default is 19.
RSI Long Signal : Minimum value of RSI to send a LONG signal. Default is 60.
RSI Short signal : Maximum value of RSI to send a SHORT signal. Default is 40.
ROC MA Long Signal : Maximum value of Rate of Change MA to send a LONG signal. Default is 0.
ROC MA Short signal : Minimum value of Rate of Change MA to send a SHORT signal. Default is 0.
TP activation in multiple of ATR : Threshold value to trigger trailing stop Take Profit. This threshold is calculated as multiple of the ATR (Average True Range). Default value is 5 meaning that to trigger the trailing TP the price need to move 5*ATR in the right direction.
Trailing TP in percentage : Percentage value of trailing Take Profit. This Trailing TP follows the profit if it increases, remaining selected percentage below it, but stops if the profit decreases. Default is 3%.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. Default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by a user-selected amount.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot has been used to test the different parameters and determine which ones maximize return while limiting drawdown. This strategy is the most optimal on BITSTAMP:ETHUSD with a timeframe set to 6h. Parameters are set as follows :
MA type: RWMA
MA Length: 19
RSI Long Signal: >60
RSI Short Signal : <40
ROC MA Long Signal : <0
ROC MA Short Signal : >0
TP Activation in multiple ATR : 5
Trailing TP in percentage : 3
ENTER RULES :
The principle is very simple:
If the asset is overbought after a bear market, we are LONG.
If the asset is oversold after a bull market, we are SHORT.
We have defined a bear market as follows : Rate of Change (20) RWMA < 0
We have defined a bull market as follows : Rate of Change (20) RWMA > 0
The Rate of Change is calculated using this formula : (RWMA/RWMA(20) - 1)*100
Overbought is defined as follows : RSI > 60
Oversold is defined as follows : RSI < 40
LONG CONDITION :
RSI > 60 and (RWMA/RWMA(20) - 1)*100 < -1
SHORT CONDITION :
RSI < 40 and (RWMA/RWMA(20) - 1)*100 > 1
EXIT RULES FOR WINNING TRADE :
We have a trailing TP allowing us to exit once the price has reached the "TP Activation in multiple ATR" parameter, i.e. 5*ATR by default in the profit direction. TP trailing is triggered at this point, not limiting our gains, and securing our profits at 3% below this trigger threshold.
Remember that the True Range is : maximum(H-L, H-C(1), C-L(1))
with C : Close, H : High, L : Low
The Average True Range is therefore the average of these TRs over a length defined by default in the strategy, i.e. 20.
RISK MANAGEMENT :
This strategy may incur losses. The method for limiting losses is to set a Stop Loss equal to 3*ATR. This means that if the price moves against our position and reaches three times the ATR, we exit with a loss.
Sometimes the ATR can result in a SL set below 10% of the trade value, which is not acceptable. In this case, we set the SL at 10%, limiting losses to a maximum of 10%.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
Enjoy the strategy and don't forget to take the trade :)
Narrow Range StrategyNarrow Range Strategy :
INTRODUCTION :
This strategy is based on the Narrow Range Day concept, implying that low volatility will generate higher volatility in the days ahead. The strategy sends us buy and sell signals with well-defined profit targets. It's a medium/long-term strategy. There's also a money management method that allows us to reinvest part of the profits or reduce the size of orders in the event of substantial losses.
NARROW RANGE (NR) DAY :
A Narrow Range Day is a day in which price variations are included in those of a specific day some time before. The high and low of this specific day form the "reference range". In general, we compare these variations with those of 4 or 7 days ago. The mathematical formula for finding an NR4 is :
If low > low(4) and high < high(4) :
nr = true
This implies that the current low is greater than the low of 4 days ago, and the current high is smaller than the high of 4 days ago. So today's volatility is lower than that of 4 days ago, and may be a sign of high volatility to come.
PARAMETERS :
Narrow Range Length : Corresponds to the number of candles back to compare current volatility. The default is 4, allowing comparison of current volatility with that of 4 candles ago.
Stop Loss : Percentage of the reference range on which to set an exit order to limit losses. The minimum value is 0.001, while the maximum is 1. The default value is 0.35.
Fixed Ratio : This is the amount of gain or loss at which the order quantity is changed. The default is 400, which means that for each $400 gain or loss, the order size is increased or decreased by an amount chosen by the user.
Increasing Order Amount : This is the amount to be added to or subtracted from orders when the fixed ratio is reached. The default is $200, which means that for every $400 gain, $200 is reinvested in the strategy. On the other hand, for every $400 loss, the order size is reduced by $200.
Initial capital : $1000
Fees : Interactive Broker fees apply to this strategy. They are set at 0.18% of the trade value.
Slippage : 3 ticks or $0.03 per trade. Corresponds to the latency time between the moment the signal is received and the moment the order is executed by the broker.
Important : A bot was used to test NR4 and NR7 with all possible Stop Losses in order to find out which combination generates the highest return on BITSTAMP:ETHUSD while limiting the drawdown. This strategy is the most optimal with an NR4 and a SL of 35% of the reference range size in 5D timeframe.
BUY AND SHORT SIGNALS :
When an NR is spotted, we create two stop orders on the high and low of the reference range. As soon as there's a breakout from this reference range (shown in blue on the chart), we open a position. We're LONG if there's a breakout on the high and SHORT if there's a breakout on the low. Executing a stop order cancels the second stop order.
RISK MANAGEMENT :
This strategy is subject to losses. We manage our risk with Stop Losses. The user is free to enter a SL as a percentage of the reference range. The maximum amount risked per trade therefore depends on the size of the range. The larger the range, the greater the risk. That's why we have set a maximum Stop Loss to 10% to limiting risks per trade.
The special feature of this strategy is that it targets a precise profit objective. This corresponds to the size of the reference range at the top of the high if you're LONG, or at the bottom of the low if you're short. In the same way, the larger the reference range, the greater the potential profits.
The risk reward remains the same for all trades and amounts to : 100/35 = 2.86. If the reference range is too high, we have set a SL to 10% of the trade value to limit losses. In that case, the risk reward is less than 2.86.
MONEY MANAGEMENT :
The fixed ratio method was used to manage our gains and losses. For each gain of an amount equal to the value of the fixed ratio, we increase the order size by a value defined by the user in the "Increasing order amount" parameter. Similarly, each time we lose an amount equal to the value of the fixed ratio, we decrease the order size by the same user-defined value. This strategy increases both performance and drawdown.
NOTE :
Please note that the strategy is backtested from 2017-01-01. As the timeframe is 5D, this strategy is a medium/long-term strategy. That's why only 37 trades were closed. Be careful, as the test sample is small and performance may not necessarily reflect what may happen in the future.
Enjoy the strategy and don't forget to take the trade :)
Stx Monthly Trades ProfitMonthly profit displays profits in a grid and allows you to know the gain related to the investment during each month.
The profit could be computed in terms of gain/trade_cost or as percentage of equity update.
Settings:
- Profit: Monthly profit percentage or percentage of equity
- Table position
This strategy is intended only as a container for the code and for testing the script of the profit table.
Setting of strategy allows to select the test case for this snippet (percentage grid).
Money management: not relevant as strategy is a test case.
This script stand out as take in account the gain of each trade in relation to the capital invested in each trade. For example consider the following scenario:
Capital of 1000$ and we invest a fixed amount of 1000$ (I know is too risky but is a good example), we gain 10% every month.
After 10 months our capital is of 2000$ and our strategy is perfect as we have the same performance every month.
Instead, evaluating the percentage of equity we have 10% the first month, 9.9% the second (1200$/1100$ - 1) and 5.26% the tenth month. So seems that strategy degrade with times but this is not true.
For this reason, to evaluate my strategy I prefer to see the montly return of investment.
WARNING: The strategy provided with this script is only a test case and allows to see the behavior with different "trades" management, for these reason commision are set to zero.
At the moment only the provided test cases are handled:
test 1 - single entry and single exit;
test 2 - single entry and multiple exits;
test 3 - single entry and switch position;
hamster-bot MRS 2 (simplified version) MRS - Mean Reversion Strategy (Countertrend) (Envelope strategy)
This script does not claim to be unique and does not mislead anyone. Even the unattractive backtest result is attached. The source code is open. The idea has been described many times in various sources. But at the same time, their collection in one place provides unique opportunities.
Published by popular demand and for ease of use. so that users can track the development of the script and can offer their ideas in the comments. Otherwise, you have to communicate in several telegram chats.
Representative of the family of counter-trend strategies. The basis of the strategy is Mean reversion . You can also read about the Envelope strategy .
Mean reversion , or reversion to the mean, is a theory used in finance that suggests that asset price volatility and historical returns eventually will revert to the long-run mean or average level of the entire dataset.
The strategy is very simple. Has very few settings. Good for beginners to get acquainted with algorithmic trading. A simple adjustment will help avoid overfitting. There are many variations of this strategy, but for understanding it is better to start with this implementation.
Principle of operation.
1)
A conventional MA is being built. (fuchsia line). A limit order is placed on this line to close the position.
2)
(green line) A limit order is placed on this line to open a long position
3)
(red line) A limit order is placed on this line to open a short position
Attention!
Please note that a limit order is used. Conclude that the strategy has a limited capacity. And the results obtained on low-liquid instruments will be too high in the tester. On real auctions there will be a different result.
Note for testing the strategy in the spot market:
When testing in the spot market, do not include both long and short at the same time. It is recommended to test only the long mode on the spot. Short mode for more advanced users.
Settings:
Available types of moving averages:
SMA
EMA
TEMA - triple exponential moving average
DEMA - Double Exponential Moving Average
ZLEMA - Zero lag exponential moving average
WMA - weighted moving average
Hma - Hull Moving Average
Thma - Triple Exponential Hull Moving Average
Ehma - Exponential Hull Moving Average
H - MA built based on highs for n candles | ta.highest(len)
L - MA built based on lows for n candles | ta.lowest(len)
DMA - Donchian Moving Average
A Kalman filter can be applied to all MA
The peculiarity of the strategy is a large selection of MA and the possibility of shifting lines. You can set up a reverse trending strategy on the Donchian channel for example.
Use Long - enable/disable opening a Long position
Use Short - enable/disable opening a Short position
Lot Long, % - % allocated from the deposit for opening a Long position. In the spot market, do not use % greater than 100%
Lot Short, % - allocated % of the deposit for opening a Short position
Start date - the beginning of the testing period
End date - the end of the testing period (Example: only August 2020 can be tested)
Mul - multiplier. Used to offset lines. Example:
Mul = 0.99 is shift -1%
Mul = 1.01 is shift +1%
Non-strict recommendations:
1) Test the SPOT market on crypto exchanges. (The countertrend strategy has liquidation risk on futures)
2) Symbols altcoin/bitcoin or altcoin/altcoin. Example: ETH/BTC or DOGE/ETH
3) Timeframe is usually 1 hour
If the script passes moderation, I will supplement it by adding separate settings for closing long and short positions according to their MA
EUR/USD 45 MIN Strategy - FinexBOTThis strategy uses three indicators:
RSI (Relative Strength Index) - It indicates if a stock is potentially overbought or oversold.
CCI (Commodity Channel Index) - It measures the current price level relative to an average price level over a certain period of time.
Williams %R - It is a momentum indicator that shows whether a stock is at the high or low end of its trading range.
Long (Buy) Trades Open:
When all three indicators suggest that the stock is oversold (RSI is below 25, CCI is below -130, and Williams %R is below -85), the strategy will open a buy position, assuming there is no current open trade.
Short (Sell) Trades Open:
When all three indicators suggest the stock is overbought (RSI is above 75, CCI is above 130, and Williams %R is above -15), the strategy will open a sell position, assuming there is no current open trade.
SL (Stop Loss) and TP (Take Profit):
SL (Stop Loss) is 0.45%.
TP (Take Profit) is 1.2%.
The strategy automatically sets these exit points as a percentage of the entry price for both long and short positions to manage risks and secure profits. You can easily adopt these inputs according to your strategy. However, default settings are recommended.