Quatro SMA Strategy [4h]Hello, I would like to present to you The "Quatro SMA" strategy
Strategy is based on four simple moving averages of different lengths and monitoring trading volume. The key idea is to identify strong market trends by comparing short-term moving averages with the long-term SMA. The strategy generates buy signals when all short-term SMAs are above the SMA(200) and the volume confirms the strength of the move. Similarly, sell signals are generated when all short-term SMAs are below the SMA(200), and the volume is sufficiently high.
The strategy manages risk by applying a stop loss and three different Take Profit levels (TP1, TP2, TP3), with varying percentages of the position closed at each level.
Each Take Profit level is triggered at a specific percentage gain, with the position being closed gradually depending on the achieved targets. The percentage of the position closed at each TP level is also defined by the user.
Indicators and Parameters:
Simple Moving Averages (SMA):
The script utilizes four simple moving averages with different lengths (4, 16, 32, 200). The first three SMAs (SMA1, SMA2, SMA3) are used to determine the trend direction, while the fourth SMA (with a length of 200) serves as a support/resistance line.
Volume:
The script monitors trading volume and checks if the current volume exceeds 2.5 times the average volume of the last 40 candles. High volume is considered as confirmation of trend strength.
Entry Conditions:
- Long Position: Triggered when SMA1 > SMA2 > SMA3, the closing price is above SMA(200), and the volume condition is met.
- Short Position: Triggered when SMA1 < SMA2 < SMA3, the closing price is below SMA(200), and the volume condition is met.
Exit Conditions:
- Long Position: Closed when SMA1 < SMA2 < SMA3 and the closing price is above SMA(200).
- Short Position: Closed when SMA1 > SMA2 > SMA3 and the closing price is below SMA(200).
to determine the level of stop loss and target point I used a piece of code by RafaelZioni, here is the script from which a piece of code was taken
I hope the strategy will be helpful, as always, best regards and safe trades
;)
Indicators and strategies
Double CCI Confirmed Hull Moving Average Reversal StrategyOverview
The Double CCI Confirmed Hull Moving Average Strategy utilizes hull moving average (HMA) in conjunction with two commodity channel index (CCI) indicators: the slow and fast to increase the probability of entering when the short and mid-term uptrend confirmed. The main idea is to wait until the price breaks the HMA while both CCI are showing that the uptrend has likely been already started. Moreover, strategy uses exponential moving average (EMA) to trail the price when it reaches the specific level. The strategy opens only long trades.
Unique Features
Dynamic stop-loss system: Instead of fixed stop-loss level strategy utilizes average true range (ATR) multiplied by user given number subtracted from the position entry price as a dynamic stop loss level.
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Double trade setup confirmation: Strategy utilizes two different period CCI indicators to confirm the breakouts of HMA.
Trailing take profit level: After reaching the trailing profit activation level scrip activate the trailing of long trade using EMA. More information in methodology.
Methodology
The strategy opens long trade when the following price met the conditions:
Short-term period CCI indicator shall be above 0.
Long-term period CCI indicator shall be above 0.
Price shall cross the HMA and candle close above it with the same candle
When long trade is executed, strategy set the stop-loss level at the price ATR multiplied by user-given value below the entry price. This level is recalculated on every next candle close, adjusting to the current market volatility.
At the same time strategy set up the trailing stop validation level. When the price crosses the level equals entry price plus ATR multiplied by user-given value script starts to trail the price with EMA. If price closes below EMA long trade is closed. When the trailing starts, script prints the label “Trailing Activated”.
Strategy settings
In the inputs window user can setup the following strategy settings:
ATR Stop Loss (by default = 1.75)
ATR Trailing Profit Activation Level (by default = 2.25)
CCI Fast Length (by default = 25, used for calculation short term period CCI
CCI Slow Length (by default = 50, used for calculation long term period CCI)
Hull MA Length (by default = 34, period of HMA, which shall be broken to open trade)
Trailing EMA Length (by default = 20)
User can choose the optimal parameters during backtesting on certain price chart.
Justification of Methodology
Before understanding why this particular combination of indicator has been chosen let's briefly explain what is CCI and HMA.
The Commodity Channel Index (CCI) is a momentum-based technical indicator used in trading to measure a security's price relative to its average price over a given period. Developed by Donald Lambert in 1980, the CCI is primarily used to identify cyclical trends in a security, helping traders to spot potential buying or selling opportunities.
The CCI formula is:
CCI = (Typical Price − SMA) / (0.015 × Mean Deviation)
Typical Price (TP): This is calculated as the average of the high, low, and closing prices for the period.
Simple Moving Average (SMA): This is the average of the Typical Prices over a specific number of periods.
Mean Deviation: This is the average of the absolute differences between the Typical Price and the SMA.
The result is a value that typically fluctuates between +100 and -100, though it is not bounded and can go higher or lower depending on the price movement.
The Hull Moving Average (HMA) is a type of moving average that was developed by Alan Hull to improve upon the traditional moving averages by reducing lag while maintaining smoothness. The goal of the HMA is to create an indicator that is both quick to respond to price changes and less prone to whipsaws (false signals).
How the Hull Moving Average is Calculated?
The Hull Moving Average is calculated using the following steps:
Weighted Moving Average (WMA): The HMA starts by calculating the Weighted Moving Average (WMA) of the price data over a period square root of n (sqrt(n))
Speed Adjustment: A WMA is then calculated for half of the period n/2, and this is multiplied by 2 to give more weight to recent prices.
Lag Reduction: The WMA of the full period n is subtracted from the doubled n/2 WMA.
Final Smoothing: To smooth the result and reduce noise, a WMA is calculated for the square root of the period n.
The formula can be represented as:
HMA(n) = WMA(WMA(n/2) × 2 − WMA(n), sqrt(n))
The Weighted Moving Average (WMA) is a type of moving average that gives more weight to recent data points, making it more responsive to recent price changes than a Simple Moving Average (SMA). In a WMA, each data point within the selected period is multiplied by a weight, with the most recent data receiving the highest weight. The sum of these weighted values is then divided by the sum of the weights to produce the WMA.
This strategy leverages HMA of user given period as a critical level which shall be broken to say that probability of trend change to the upside increased. HMA reacts faster than EMA or SMA to the price change, that’s why it increases chances to enter new trade earlier. Long-term period CCI helps to have an approximation of mid-term trend. If it’s above 0 the probability of uptrend increases. Short-period CCI allows to have an approximation of short-term trend reversal from down to uptrend. This approach increases chances to have a long trade setup in the direction of mid-term trend when the short-term trend starts to reverse.
ATR is used to adjust the strategy risk management to the current market volatility. If volatility is low, we don’t need the large stop loss to understand the there is a high probability that we made a mistake opening the trade. User can setup the settings ATR Stop Loss and ATR Trailing Profit Activation Level to realize his own risk to reward preferences, but the unique feature of a strategy is that after reaching trailing profit activation level strategy is trying to follow the trend until it is likely to be finished instead of using fixed risk management settings. It allows sometimes to be involved in the large movements. It’s also important to make a note, that script uses HMA to enter the trade, but for trailing it leverages EMA. It’s used because EMA has no such fast reaction to price move which increases probability not to be stopped out from any significant uptrend move.
Backtest Results
Operating window: Date range of backtests is 2022.07.01 - 2024.08.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 100%
Maximum Single Position Loss: -4.67%
Maximum Single Profit: +19.66%
Net Profit: +14897.94 USDT (+148.98%)
Total Trades: 104 (36.54% win rate)
Profit Factor: 2.312
Maximum Accumulated Loss: 1302.66 USDT (-9.58%)
Average Profit per Trade: 143.25 USDT (+0.96%)
Average Trade Duration: 34 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 2h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Multi-Step Vegas SuperTrend - strategy [presentTrading]Long time no see! I am back : ) Please allow me to gain some warm-up.
█ Introduction and How it is Different
The "Vegas SuperTrend Strategy" is an enhanced trading strategy that leverages both the Vegas Channel and SuperTrend indicators to generate buy and sell signals.
What sets this strategy apart from others is its dynamic adjustment to market volatility and its multi-step take profit mechanism. Unlike traditional single-step profit-taking approaches, this strategy allows traders to systematically scale out of positions at predefined profit levels, thereby optimizing their risk-reward ratio and maximizing potential gains.
BTCUSD 6hr performance
█ Strategy, How it Works: Detailed Explanation
The Vegas SuperTrend Strategy combines the strengths of the Vegas Channel and SuperTrend indicators to identify market trends and generate trade signals. The following subsections delve into the details of how each component works and how they are integrated.
🔶 Vegas Channel Calculation
The Vegas Channel is based on a simple moving average (SMA) and the standard deviation (STD) of the closing prices over a specified period. The channel is defined by upper and lower bounds that are dynamically adjusted based on market volatility.
Simple Moving Average (SMA):
SMA_vegas = (1/N) * Σ(Close_i) for i = 0 to N-1
where N is the length of the Vegas Window.
Standard Deviation (STD):
STD_vegas = sqrt((1/N) * Σ(Close_i - SMA_vegas)^2) for i = 0 to N-1
Vegas Channel Upper and Lower Bounds:
VegasChannelUpper = SMA_vegas + STD_vegas
VegasChannelLower = SMA_vegas - STD_vegas
The details are here:
🔶 Trend Detection and Trade Signals
The strategy determines the current market trend based on the closing price relative to the SuperTrend bounds:
Market Trend:
MarketTrend = 1 if Close > SuperTrendPrevLower
-1 if Close < SuperTrendPrevUpper
Previous Trend otherwise
Trade signals are generated when there is a shift in the market trend:
Bullish Signal: When the market trend shifts from -1 to 1.
Bearish Signal: When the market trend shifts from 1 to -1.
🔶 Multi-Step Take Profit Mechanism
The strategy incorporates a multi-step take profit mechanism that allows for partial exits at predefined profit levels. This helps in locking in profits gradually and reducing exposure to market reversals.
Take Profit Levels:
The take profit levels are calculated as percentages of the entry price:
TakeProfitLevel_i = EntryPrice * (1 + TakeProfitPercent_i/100) for long positions
TakeProfitLevel_i = EntryPrice * (1 - TakeProfitPercent_i/100) for short positions
Multi-steps take profit local picture:
█ Trade Direction
The trade direction can be customized based on the user's preference:
Long: The strategy only takes long positions.
Short: The strategy only takes short positions.
Both: The strategy can take both long and short positions based on the market trend.
█ Usage
To use the Vegas SuperTrend Strategy, follow these steps:
Configure Input Settings:
- Set the ATR period, Vegas Window length, SuperTrend Multiplier, and Volatility Adjustment Factor.
- Choose the desired trade direction (Long, Short, Both).
- Enable or disable the take profit mechanism and set the take profit percentages and amounts for each step.
█ Default Settings
The default settings of the strategy are designed to provide a balanced approach to trading. Below is an explanation of each setting and its effect on the strategy's performance:
ATR Period (10): This setting determines the length of the ATR used in the SuperTrend calculation. A longer period smoothens the ATR, making the SuperTrend less sensitive to short-term volatility. A shorter period makes the SuperTrend more responsive to recent price movements.
Vegas Window Length (100): This setting defines the period for the Vegas Channel's moving average. A longer window provides a broader view of the market trend, while a shorter window makes the channel more responsive to recent price changes.
SuperTrend Multiplier (5): This base multiplier adjusts the sensitivity of the SuperTrend to the ATR. A higher multiplier makes the SuperTrend less sensitive, reducing the frequency of trade signals. A lower multiplier increases sensitivity, generating more signals.
Volatility Adjustment Factor (5): This factor dynamically adjusts the SuperTrend multiplier based on the width of the Vegas Channel. A higher factor increases the sensitivity of the SuperTrend to changes in market volatility, while a lower factor reduces it.
Take Profit Percentages (3.0%, 6.0%, 12.0%, 21.0%): These settings define the profit levels at which portions of the trade are exited. They help in locking in profits progressively as the trade moves in favor.
Take Profit Amounts (25%, 20%, 10%, 15%): These settings determine the percentage of the position to exit at each take profit level. They are distributed to ensure that significant portions of the trade are closed as the price reaches the set levels, reducing exposure to reversals.
Adjusting these settings can significantly impact the strategy's performance. For instance, increasing the ATR period or the SuperTrend multiplier can reduce the number of trades, potentially improving the win rate but also missing out on some profitable opportunities. Conversely, lowering these values can increase trade frequency, capturing more short-term movements but also increasing the risk of false signals.
Simple Fibonacci Retracement Strategy This strategy uses Fibonacci retracement to identify key levels in the market and helps traders find good entry and exit points. By understanding and using this strategy, traders can improve their trading decisions and increase their chances of success in the market.
This strategy, called the "Simple Fibonacci Retracement Strategy," is designed to help traders identify potential entry and exit points in the market based on Fibonacci retracement levels. The code is written in Pine Script and runs on the TradingView platform.
Overall Function
The strategy uses Fibonacci retracement levels to identify potential support and resistance levels in the market. This helps traders find good entry and exit points for trades, as well as set stop-loss and take-profit levels to minimize risk and maximize gains.
Main Components of the Code
1. Input Parameters
Lookback Period: The number of bars used to identify the highest high and lowest low.
Fibonacci Direction: The choice of whether Fibonacci levels are calculated from top to bottom or bottom to top.
Fibonacci Levels: Specific Fibonacci levels (23.6%, 38.2%, 50%, 61.8%) used to identify important price levels.
Take Profit and Stop Loss: The number of pips used to set take profit and stop loss levels.
2. Identification of Highest and Lowest Points
The code uses the lookback period to find the highest high (highestHigh) and the lowest low (lowestLow). These levels form the basis for calculating the Fibonacci levels.
3. Calculation of Fibonacci Levels
Based on the direction chosen by the user, the code calculates the various Fibonacci levels (0%, 23.6%, 38.2%, 50%, 61.8%, 100%).
4. Trading Logic
Long Signal: Generated when the price crosses above the 61.8% Fibonacci level from bottom to top.
Short Signal: Generated when the price crosses below the 38.2% Fibonacci level from top to bottom.
When a long or short signal is generated, the strategy opens a position and sets take profit and stop loss levels based on the input parameters.
5. Visualization
The strategy plots the Fibonacci levels on the chart to provide a visual representation of the calculated levels. This helps traders see where the levels are in relation to the current price.
6. Alerts
The code also has functionality to create alerts (commented out), which can notify traders of buy or sell signals.
How to Use the Strategy
Configure Parameters: Adjust the lookback period, Fibonacci direction, and levels for take profit and stop loss to your preferences.
View the Chart: The Fibonacci levels will be plotted on the chart, providing a visual overview of potential support and resistance levels.
Trade Signals: Follow the generated buy and sell signals. Set your parameters in settings and adjust according to the generated buy and sell signals in the strategy tester. The strategy will automatically set your take profit and stop loss levels.
Evaluation and Adjustment: Monitor the performance of the strategy and make adjustments as needed to optimize the results.
Norwegian
Denne strategien, kalt "Simple Fibonacci Retracement Strategy", er designet for å hjelpe tradere med å identifisere mulige inngangs- og utgangspunkter i markedet basert på Fibonacci-retracementnivåer. Koden er skrevet i Pine Script og kjøres på TradingView-plattformen.
Overordnet Funksjon
Strategien bruker Fibonacci-retracementnivåer for å identifisere potensielle støtte- og motstandsnivåer i markedet. Dette hjelper tradere med å finne gode inngangs- og utgangspunkter for handler, samt å sette stop-loss og take-profit nivåer for å minimere risiko og maksimere gevinster.
Hovedkomponenter i Koden
1. Input Parametere
Lookback Period: Antall barer som brukes til å identifisere høyeste høydepunkt og laveste lavpunkt.
Fibonacci Direction: Valg om Fibonacci-nivåene skal beregnes fra topp til bunn eller bunn til topp.
Fibonacci Levels: Spesifikke Fibonacci-nivåer (23.6%, 38.2%, 50%, 61.8%) som brukes til å identifisere viktige prisnivåer.
Take Profit og Stop Loss: Antall pips som brukes til å sette take profit og stop loss nivåer.
2. Identifikasjon av Høyeste og Laveste Punkt
Koden bruker lookback perioden for å finne det høyeste høydepunktet (highestHigh) og det laveste lavpunktet (lowestLow). Disse nivåene er grunnlaget for å beregne Fibonacci-nivåene.
3. Beregning av Fibonacci-nivåer
Basert på retningen valgt av brukeren, beregner koden de forskjellige Fibonacci-nivåene (0%, 23.6%, 38.2%, 50%, 61.8%, 100%).
4. Handelslogikk
Long Signal: Genereres når prisen krysser over 61.8% Fibonacci-nivået fra bunn til topp.
Short Signal: Genereres når prisen krysser under 38.2% Fibonacci-nivået fra topp til bunn.
Når et long eller short signal genereres, åpner strategien en posisjon og setter take profit og stop loss nivåer basert på inputparametrene.
5. Visualisering
Strategien plottet Fibonacci-nivåene på chartet for å gi en visuell representasjon av de beregnede nivåene. Dette hjelper tradere med å se hvor nivåene er i forhold til den nåværende prisen.
6. Varsler
Koden har også funksjonalitet for å lage varsler (kommentert ut), som kan varsle tradere om kjøps- eller salgssignaler.
Slik Bruker Du Strategien
Konfigurer Parametere: Juster lookback perioden, Fibonacci-retningen, og nivåene for take profit og stop loss til dine preferanser.
Se på Chartet: Fibonacci-nivåene vil bli plottet på chartet, noe som gir deg en visuell oversikt over potensielle støtte- og motstandsnivåer.
Handle Signaler: Sett dine parametere i innstillinger og juster etter genererte kjøps- og salgssignalene i strategy testeren. Strategien vil automatisk sette dine take profit og stop loss nivåer.
Evaluering og Justering: Overvåk ytelsen til strategien og gjør justeringer etter behov for å optimalisere resultatene.
Zero-lag TEMA Crosses Strategy[Pakun]Here's the adjusted strategy description in English, aligned with the house rules:
---
### Strategy Name: Zero-lag TEMA Cross Strategy
**Purpose:** This strategy aims to identify entry and exit points in the market using Zero-lag Triple Exponential Moving Averages (TEMA). It focuses on minimizing lag and improving the accuracy of trend-following signals.
### Uniqueness and Usefulness
**Uniqueness:** This strategy employs the less commonly used Zero-lag TEMA, compared to standard moving averages. This unique approach reduces lag and provides more timely signals.
**Usefulness:** This strategy is valuable for traders looking to capture trend reversals or continuations with reduced lag. It has the potential to enhance the profitability and accuracy of trades.
### Entry Conditions
**Long Entry:**
- **Condition:** A crossover occurs where the short-term Zero-lag TEMA surpasses the long-term Zero-lag TEMA.
- **Signal:** A buy signal is generated, indicating a potential uptrend.
**Short Entry:**
- **Condition:** A crossunder occurs where the short-term Zero-lag TEMA falls below the long-term Zero-lag TEMA.
- **Signal:** A sell signal is generated, indicating a potential downtrend.
### Exit Conditions
**Exit Strategy:**
- **Stop Loss:** Positions are closed if the price moves against the trade and hits the predefined stop loss level. The stop loss is set based on recent highs/lows.
- **Take Profit:** Positions are closed when the price reaches the profit target. The profit target is calculated as 1.5 times the distance between the entry price and the stop loss level.
### Risk Management
**Risk Management Rules:**
- This strategy incorporates a dynamic stop loss mechanism based on recent highs/lows over a specified period.
- The take profit level ensures a reward-to-risk ratio of 1.5 times the stop loss distance.
- These measures aim to manage risk and protect capital.
**Account Size:** ¥500,000
**Commissions and Slippage:** 94 pips per trade and 1 pip slippage
**Risk per Trade:** 1% of account equity
### Configurable Options
**Configurable Options:**
- Lookback Period: The number of bars to calculate recent highs/lows.
- Fast Period: Length of the short-term Zero-lag TEMA (69).
- Slow Period: Length of the long-term Zero-lag TEMA (130).
- Signal Display: Option to display buy/sell signals on the chart.
- Bar Color: Option to change bar colors based on trend direction.
### Adequate Sample Size
**Sample Size Justification:**
- To ensure the robustness and reliability of the strategy, it should be tested with a sufficiently long period of historical data.
- It is recommended to backtest across multiple market cycles to adapt to different market conditions.
- This strategy was backtested using 10 days of historical data, including 184 trades.
### Notes
**Additional Considerations:**
- This strategy is designed for educational purposes and should be thoroughly tested in a demo environment before live trading.
- Settings should be adjusted based on the asset being traded and current market conditions.
### Credits
**Acknowledgments:**
- The concept and implementation of Zero-lag TEMA are based on contributions from technical analysts and the trading community.
- Special thanks to John Doe for the TEMA concept.
- Thanks to Zero-lag TEMA Crosses .
- This strategy has been enhanced by adding new filtering algorithms and risk management rules to the original TEMA code.
### Clean Chart Description
**Chart Appearance:**
- This strategy provides a clean and informative chart by plotting Zero-lag TEMA lines and optional entry/exit signals.
- The display of signals and color bars can be toggled to declutter the chart, improving readability and analysis.
VIX Futures Basis StrategyVIX Futures Basis Strategy
The VIX Futures Basis Strategy is a trading approach that takes advantage of the unique characteristics of the VIX index and its futures market. The VIX, often referred to as the "fear index," measures market expectations of near-term volatility. This strategy focuses on how the VIX futures contracts behave in relation to the spot VIX index and seeks to capitalize on the market's contango and backwardation phases.
Key Concepts:
VIX Index and VIX Futures:
The VIX index reflects the market's expectation of volatility over the next 30 days.
VIX futures allow traders to speculate on the future value of the VIX index.
Contango and Backwardation:
Contango occurs when the futures price is higher than the spot price, often indicating that the market expects volatility to rise in the future.
Backwardation is when the futures price is lower than the spot price, suggesting that the market expects a decrease in volatility.
Basis:
The basis is the difference between the futures price and the spot price. This strategy examines the basis for two consecutive VIX futures contracts.
Strategy Overview:
The VIX Futures Basis Strategy uses the relationship between the VIX index and its futures contracts to generate trading signals:
Long Position on Contango:
When both the front month and the second month VIX futures contracts are in contango (their prices are above the spot VIX index by a specified threshold), the strategy takes a long position.
This implies an expectation that the market will move from a state of expected higher future volatility to a more stable state, allowing profits to be made as the futures prices converge toward the spot price.
Closing Position on Backwardation:
If the basis for both futures contracts indicates backwardation (their prices are below the spot VIX index by a threshold), the strategy closes any long positions.
This condition suggests that the market anticipates decreasing volatility, and closing positions helps to avoid potential losses.
Bollinger Bands Enhanced StrategyOverview
The common practice of using Bollinger bands is to use it for building mean reversion or squeeze momentum strategies. In the current script Bollinger Bands Enhanced Strategy we are trying to combine the strengths of both strategies types. It utilizes Bollinger Bands indicator to buy the local dip and activates trailing profit system after reaching the user given number of Average True Ranges (ATR). Also it uses 200 period EMA to filter trades only in the direction of a trend. Strategy can execute only long trades.
Unique Features
Trailing Profit System: Strategy uses user given number of ATR to activate trailing take profit. If price has already reached the trailing profit activation level, scrip will close long trade if price closes below Bollinger Bands middle line.
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Major Trend Filter: Strategy utilizes 100 period EMA to take trades only in the direction of a trend.
Flexible Risk Management: Users can choose number of ATR as a stop loss (by default = 1.75) for trades. This is flexible approach because ATR is recalculated on every candle, therefore stop-loss readjusted to the current volatility.
Methodology
First of all, script checks if currently price is above the 200-period exponential moving average EMA. EMA is used to establish the current trend. Script will take long trades on if this filtering system showing us the uptrend. Then the strategy executes the long trade if candle’s low below the lower Bollinger band. To calculate the middle Bollinger line, we use the standard 20-period simple moving average (SMA), lower band is calculated by the substruction from middle line the standard deviation multiplied by user given value (by default = 2).
When long trade executed, script places stop-loss at the price level below the entry price by user defined number of ATR (by default = 1.75). This stop-loss level recalculates at every candle while trade is open according to the current candle ATR value. Also strategy set the trailing profit activation level at the price above the position average price by user given number of ATR (by default = 2.25). It is also recalculated every candle according to ATR value. When price hit this level script plotted the triangle with the label “Strong Uptrend” and start trail the price at the middle Bollinger line. It also started to be plotted as a green line.
When price close below this trailing level script closes the long trade and search for the next trade opportunity.
Risk Management
The strategy employs a combined and flexible approach to risk management:
It allows positions to ride the trend as long as the price continues to move favorably, aiming to capture significant price movements. It features a user-defined ATR stop loss parameter to mitigate risks based on individual risk tolerance. By default, this stop-loss is set to a 1.75*ATR drop from the entry point, but it can be adjusted according to the trader's preferences.
There is no fixed take profit, but strategy allows user to define user the ATR trailing profit activation parameter. By default, this stop-loss is set to a 2.25*ATR growth from the entry point, but it can be adjusted according to the trader's preferences.
Justification of Methodology
This strategy leverages Bollinger bangs indicator to open long trades in the local dips. If price reached the lower band there is a high probability of bounce. Here is an issue: during the strong downtrend price can constantly goes down without any significant correction. That’s why we decided to use 200-period EMA as a trend filter to increase the probability of opening long trades during major uptrend only.
Usually, Bollinger Bands indicator is using for mean reversion or breakout strategies. Both of them have the disadvantages. The mean reversion buys the dip, but closes on the return to some mean value. Therefore, it usually misses the major trend moves. The breakout strategies usually have the issue with too high buy price because to have the breakout confirmation price shall break some price level. Therefore, in such strategies traders need to set the large stop-loss, which decreases potential reward to risk ratio.
In this strategy we are trying to combine the best features of both types of strategies. Script utilizes ate ATR to setup the stop-loss and trailing profit activation levels. ATR takes into account the current volatility. Therefore, when we setup stop-loss with the user-given number of ATR we increase the probability to decrease the number of false stop outs. The trailing profit concept is trying to add the beat feature from breakout strategies and increase probability to stay in trade while uptrend is developing. When price hit the trailing profit activation level, script started to trail the price with middle line if Bollinger bands indicator. Only when candle closes below the middle line script closes the long trade.
Backtest Results
Operating window: Date range of backtests is 2020.10.01 - 2024.07.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 30%
Maximum Single Position Loss: -9.78%
Maximum Single Profit: +25.62%
Net Profit: +6778.11 USDT (+67.78%)
Total Trades: 111 (48.65% win rate)
Profit Factor: 2.065
Maximum Accumulated Loss: 853.56 USDT (-6.60%)
Average Profit per Trade: 61.06 USDT (+1.62%)
Average Trade Duration: 76 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 4h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Gann Swing Strategy [1 Bar - Multi Layer]Use this Strategy to Fine-tune inputs for your Gann swing strategy.
Strategy allows you to fine-tune the indicator for 1 TimeFrame at a time; cross Timeframe Input fine-tuning is done manually after exporting the chart data.
MEANINGFUL DESCRIPTION:
The Gann Swing Chart using the One-Bar type, also known as the Minor Trend Chart, is designed to follow single-bar movements in the market. It helps identify trends by tracking price movements. When the market makes a higher high than the previous bar from a low price, the One-Bar trend line moves up, indicating a new high and establishing the previous low as a One-Bar bottom. Conversely, when the market makes a lower low than the previous bar from a high price, the One-Bar swing line moves down, marking a new low and setting the previous high as a One-Bar top. The crossing of these swing tops and bottoms indicates a change in trend direction.
HOW TO USE THE INDICATOR / Gann-swing Strategy:
The indicator shows 1, 2, and 3-bar swings. The strategy triggers a buy when the price crosses the previously determined high.
HOW TO USE THE STRATEGY:
Strategy to Fine-Tune Inputs for Your Gann Swing Strategy
This strategy allows for the fine-tuning of indicators for one timeframe at a time. Cross-timeframe input fine-tuning is done manually after exporting the chart data.
Meaningful Description:
The Gann Swing Chart using the One-Bar type, also known as the Minor Trend Chart, is designed to follow single-bar movements in the market. It helps identify trends by tracking price movements. When the market makes a higher high than the previous bar from a low price, the One-Bar trend line moves up, indicating a new high and establishing the previous low as a One-Bar bottom. Conversely, when the market makes a lower low than the previous bar from a high price, the One-Bar swing line moves down, marking a new low and setting the previous high as a One-Bar top. The crossing of these swing tops and bottoms indicates a change in trend direction.
How to Use the Indicator / Gann-Swing Strategy:
The indicator shows 1, 2, and 3-bar swings. The strategy triggers a buy when the price crosses the previously determined high.
How to Use the Strategy:
The strategy initiates a buy if the price breaks 1, 2, or 3-bar highs, or any combination thereof. Use the inputs to determine which highs or lows need to be crossed for the strategy to go long or short.
ORIGINALITY & USEFULNESS:
The One-Bar Swing Chart stands out for its simplicity and effectiveness in capturing minor market trends. Developed by meomeo105, this Gann high and low algorithm forms the basis of the strategy. I used my approach to creating strategy out of Gann swing indicator.
DETAILED DESCRIPTION:
What is a Swing Chart?
Swing charts help traders visualize price movements and identify trends by focusing on price highs and lows. They are instrumental in spotting trend reversals and continuations.
What is the One-Bar Swing Chart?
The One-Bar Swing Chart, also known as the Minor Trend Chart, follows single-bar price movements. It plots upward swings from a low price when a higher high is made, and downward swings from a high price when a lower low is made.
Key Features:
Trend Identification : Highlights minor trends by plotting swing highs and lows based on one-bar movements.
Simple Interpretation : Crossing a swing top indicates an uptrend, while crossing a swing bottom signals a downtrend.
Customizable Periods : Users can adjust the period to fine-tune the sensitivity of the swing chart to market movements.
Practical Application:
Bullish Trend : When the One-Bar Swing line moves above a previous swing top, it indicates a bullish trend.
Bearish Trend : When the One-Bar Swing line moves below a previous swing bottom, it signals a bearish trend.
Trend Reversal : Watch for crossings of swing tops and bottoms to detect potential trend reversals.
The One-Bar Swing Chart is a powerful tool for traders looking to capture and understand market trends. By following the simple rules of swing highs and lows, it provides clear and actionable insights into market direction.
Why the Strategy Uses 100% Allocation of a Portfolio:
This strategy allocates 100% of the portfolio to trading this specific pair, which does not mean 100% of all capital but 100% of the allocated trading capital for this pair. The strategy is swing-based and does not use take profit (TP) or stop losses.
WODIsMA Strategy 3 MA Crossover & Bull-Bear Trend ConfirmationWODIsMA Strategy is a versatile trading strategy designed to leverage the strength of moving averages and volatility indicators to provide clear trading signals for both long and short positions. This strategy is suitable for traders looking for a systematic approach to trading with adjustable parameters to fit various market conditions and personal trading styles.
Key Features
Customizable Moving Averages:
The strategy allows users to select different types of moving averages (SMA, EMA, SMMA, WMA, VWMA) for short-term, mid-term, long-term, and bull-bear trend identification.
Each moving average can be customized with different lengths, sources (e.g., close, high, low), timeframes, and colors.
Position Management:
Users can specify the percentage of capital to use per trade and the percentage to close per partial exit.
The strategy supports both long and short positions with the ability to enable or disable each direction.
Volatility Filter:
Incorporates a volatility filter to ensure trades are only taken when market volatility is above a user-defined threshold, enhancing the strategy's effectiveness in dynamic market conditions.
Bull-Bear Trend Line:
Option to enable a bull-bear trend line that helps identify the overall market trend. Trades are taken based on the relationship between the long-term moving average and the bull-bear trend line.
Partial Exits and Full Close Logic:
The strategy includes logic for partial exits based on the crossing of mid-term and long-term moving averages.
Ensures that positions are fully closed when adverse conditions are detected, such as the price crossing below the bull-bear trend line.
Stop Loss Management:
Implements user-defined stop loss levels to manage risk effectively. The stop loss is dynamically adjusted based on the entry price and user input.
Detailed Description
Moving Average Calculation: The strategy calculates up to six different moving averages, each with customizable parameters. These moving averages help identify the short-term, mid-term, long-term trends, and overall market direction.
Trading Signals:
Long Signal: A long position is opened when the short-term moving average is above the long-term moving average, and the mid-term moving average crosses above the long-term moving average.
Short Signal: A short position is opened when the short-term moving average is below the long-term moving average, and the mid-term moving average crosses below the long-term moving average.
Volatility Condition: The strategy includes a volatility filter that activates trades only when volatility exceeds a specified threshold, ensuring trades are made in favorable market conditions.
Bull-Bear Trend Confirmation: When enabled, trades are filtered based on the relationship between the long-term moving average and the bull-bear trend line, adding another layer of confirmation.
Stop Loss and Exits:
The strategy manages risk by placing stop loss orders based on user-defined percentages.
Positions are partially or fully closed based on the crossing of moving averages and the relationship with the bull-bear trend line.
Originality and Usefulness
This strategy is original as it combines multiple moving averages and volatility indicators in a structured manner to provide reliable trading signals. Its versatility allows traders to adjust the parameters to match their trading preferences and market conditions. The inclusion of a volatility filter and bull-bear trend line adds significant value by reducing false signals and ensuring trades are taken in the direction of the overall market trend. The detailed descriptions and customizable settings make this strategy accessible and understandable for traders, even those unfamiliar with the underlying Pine Script code.
By providing clear entry, exit, and risk management rules, the WODIsMA Strategy enhances the trader's ability to navigate different market environments, making it a valuable addition to the TradingView community scripts.
Multi-Regression StrategyIntroducing the "Multi-Regression Strategy" (MRS) , an advanced technical analysis tool designed to provide flexible and robust market analysis across various financial instruments.
This strategy offers users the ability to select from multiple regression techniques and risk management measures, allowing for customized analysis tailored to specific market conditions and trading styles.
Core Components:
Regression Techniques:
Users can choose one of three regression methods:
1 - Linear Regression: Provides a straightforward trend line, suitable for steady markets.
2 - Ridge Regression: Offers a more stable trend estimation in volatile markets by introducing a regularization parameter (lambda).
3 - LOESS (Locally Estimated Scatterplot Smoothing): Adapts to non-linear trends, useful for complex market behaviors.
Each regression method calculates a trend line that serves as the basis for trading decisions.
Risk Management Measures:
The strategy includes nine different volatility and trend strength measures. Users select one to define the trading bands:
1 - ATR (Average True Range)
2 - Standard Deviation
3 - Bollinger Bands Width
4 - Keltner Channel Width
5 - Chaikin Volatility
6 - Historical Volatility
7 - Ulcer Index
8 - ATRP (ATR Percentage)
9 - KAMA Efficiency Ratio
The chosen measure determines the width of the bands around the regression line, adapting to market volatility.
How It Works:
Regression Calculation:
The selected regression method (Linear, Ridge, or LOESS) calculates the main trend line.
For Ridge Regression, users can adjust the lambda parameter for regularization.
LOESS allows customization of the point span, adaptiveness, and exponent for local weighting.
Risk Band Calculation:
The chosen risk measure is calculated and normalized.
A user-defined risk multiplier is applied to adjust the sensitivity.
Upper and lower bounds are created around the regression line based on this risk measure.
Trading Signals:
Long entries are triggered when the price crosses above the regression line.
Short entries occur when the price crosses below the regression line.
Optional stop-loss and take-profit mechanisms use the calculated risk bands.
Customization and Flexibility:
Users can switch between regression methods to adapt to different market trends (linear, regularized, or non-linear).
The choice of risk measure allows adaptation to various market volatility conditions.
Adjustable parameters (e.g., regression length, risk multiplier) enable fine-tuning of the strategy.
Unique Aspects:
Comprehensive Regression Options:
Unlike many indicators that rely on a single regression method, MRS offers three distinct techniques, each suitable for different market conditions.
Diverse Risk Measures: The strategy incorporates a wide range of volatility and trend strength measures, going beyond traditional indicators to provide a more nuanced view of market dynamics.
Unified Framework:
By combining advanced regression techniques with various risk measures, MRS offers a cohesive approach to trend identification and risk management.
Adaptability:
The strategy can be easily adjusted to suit different trading styles, timeframes, and market conditions through its various input options.
How to Use:
Select a regression method based on your analysis of the current market trend (linear, need for regularization, or non-linear).
Choose a risk measure that aligns with your trading style and the market's current volatility characteristics.
Adjust the length parameter to match your preferred timeframe for analysis.
Fine-tune the risk multiplier to set the desired sensitivity of the trading bands.
Optionally enable stop-loss and take-profit mechanisms using the calculated risk bands.
Monitor the regression line for potential trend changes and the risk bands for entry/exit signals.
By offering this level of customization within a unified framework, the Multi-Regression Strategy provides traders with a powerful tool for market analysis and trading decision support. It combines the robustness of regression analysis with the adaptability of various risk measures, allowing for a more comprehensive and flexible approach to technical trading.
AsianRange, KillZones, RSI Bars, and Supertrend Strategy by VKombinacija AsianRange, KillZones, RSI Bars, and Supertrend Strategy
Chandelier Exit Strategy with 200 EMA FilterStrategy Name and Purpose
Chandelier Exit Strategy with 200EMA Filter
This strategy uses the Chandelier Exit indicator in combination with a 200-period Exponential Moving Average (EMA) to generate trend-based trading signals. The main purpose of this strategy is to help traders identify high-probability entry points by leveraging the Chandelier Exit for stop loss levels and the EMA for trend confirmation. This strategy aims to provide clear rules for entries and exits, improving overall trading discipline and performance.
Originality and Usefulness
This script integrates two powerful indicators to create a cohesive and effective trading strategy:
Chandelier Exit : This indicator is based on the Average True Range (ATR) and identifies potential stop loss levels. The Chandelier Exit helps manage risk by setting stop loss levels at a distance from the highest high or lowest low over a specified period, multiplied by the ATR. This ensures that the stop loss adapts to market volatility.
200-period Exponential Moving Average (EMA) : The EMA acts as a trend filter. By ensuring trades are only taken in the direction of the overall trend, the strategy improves the probability of success. For long entries, the close price must be above the 200 EMA, indicating a bullish trend. For short entries, the close price must be below the 200 EMA, indicating a bearish trend.
Combining these indicators adds layers of confirmation and risk management, enhancing the strategy's effectiveness. The Chandelier Exit provides dynamic stop loss levels based on market volatility, while the EMA ensures trades align with the prevailing trend.
Entry Conditions
Long Entry
A buy signal is generated by the Chandelier Exit.
The close price is above the 200 EMA, indicating a strong bullish trend.
Short Entry
A sell signal is generated by the Chandelier Exit.
The close price is below the 200 EMA, indicating a strong bearish trend.
Exit Conditions
For long positions: The position is closed when a sell signal is generated by the Chandelier Exit.
For short positions: The position is closed when a buy signal is generated by the Chandelier Exit.
Risk Management
Account Size: 1,000,00 yen
Commission and Slippage: 17 pips commission and 1 pip slippage per trade
Risk per Trade: 10% of account equity
Stop Loss: For long trades, the stop loss is placed slightly below the candle that generated the buy signal. For short trades, the stop loss is placed slightly above the candle that generated the sell signal. The stop loss levels are dynamically adjusted based on the ATR.
Settings Options
ATR Period: Set the period for calculating the ATR to determine the Chandelier Exit levels.
ATR Multiplier: Set the multiplier for ATR to define the distance of stop loss levels from the highest high or lowest low.
Use Close Price for Extremums: Choose whether to use the close price for calculating the extremums.
EMA Period: Set the period for the EMA to adjust the trend filter sensitivity.
Show Buy/Sell Labels: Choose whether to display buy and sell labels on the chart for visual confirmation.
Highlight State: Choose whether to highlight the bullish or bearish state on the chart.
Sufficient Sample Size
The strategy has been backtested with a sufficient sample size to evaluate its performance accurately. This ensures that the strategy's results are statistically significant and reliable.
Notes
This strategy is based on historical data and does not guarantee future results.
Thoroughly backtest and validate results before using in live trading.
Market volatility and other external factors can affect performance and may not yield expected results.
Acknowledgment
This strategy uses the Chandelier Exit indicator. Special thanks to the original contributors for their work on the Chandelier Exit concept.
Clean Chart Explanation
The script is published with a clean chart to ensure that its output is readily identifiable and easy to understand. No other scripts are included on the chart, and any drawings or images used are specifically to illustrate how the script works.
RSI Buy-30d Cooldown-AHR999亲爱的数字资产投资者,您是否在寻找一种智能、可靠的方式来积累您的投资组合?我们为您带来了一个革命性的交易策略!
🚀 引入"智慧积累者"策略 🚀
这是一个为长期数字资产投资者量身定制的智能买入策略。它能帮您在最佳时机买入,让您的投资组合稳步增长!
✨ 主要特点:
智能时机选择:结合RSI和创新的AHR999指标,精准捕捉买入机会。
自动防御机制:设有冷却期,避免过度交易,保护您的资金。
底部猎手:专注于市场低迷期,为您寻找最佳入场点。
灵活可定制:根据您的风险偏好,轻松调整各项参数。
可视化决策:直观的图表标记,让您清晰了解每次交易背后的逻辑。
💡 它是如何工作的?
当市场情绪低落(低RSI)且资产被低估(低AHR999)时,策略会自动为您买入。
每次买入固定金额,帮您实现美元成本平均。
智能冷却期确保您不会在短期内过度买入。
📊 实时跟踪您的投资:
随时查看您的总投资额、持有的资产数量和平均买入成本。
清晰记录每次交易,助您分析和优化策略。
🌟 为什么选择"智慧积累者"?
无需盯盘:策略自动为您捕捉最佳买点。
情绪管理:避免人为判断带来的偏差。
长期价值:专注于积累,为未来做准备。
市场洞察:通过AHR999指标,深入了解市场周期。
无论您是经验丰富的投资者,还是刚开始接触数字资产,"智慧积累者"策略都能为您提供一种智能、低风险的方式来增加您的持仓。
准备好开始您的智能积累之旅了吗?立即尝试"智慧积累者"策略,让您的投资更上一层楼!
🚀 智能、安全、高效 - 您的数字资产积累好帮手!🚀
TASC 2024.08 Volume Confirmation For A Trend System█ OVERVIEW
This script demonstrates the use of volume data to validate price movements based on the techniques Buff Pelz Dormeier discusses in his "Volume Confirmation For A Trend System" article from the August 2024 edition of TASC's Traders' Tips . It presents a trend-following system implementation that utilizes a combination of three indicators: the Average Directional Index (ADX), the Trend Thrust Indicator (TTI), and the Volume Price Confirmation Indicator (VPCI).
█ CONCEPTS
In his article, Buff Pelz Dormeier recounts his search for an optimal trend-following strategy enhanced with volume data, starting with a simple system combining the ADX , MACD , and OBV indicators. Even in these early tests, the author observed that the volume confirmation from OBV notably improved trading performance. Subsequently, the author replaced OBV with his VPCI, which considers the proportional weights of volume and price, to enhance the validation of trend momentum. Lastly, the author explored the inclusion of his TTI, a modified MACD that features volume-based enhancements, as a strategy component for improved trend-following performance.
According to the author's research, the ADX+TTI+VPCI system outperformed similar strategies he tested in the article, yielding significantly higher returns and enhanced perceived reliability. Because the system's design revolves around catching pronounced trends, it performs best with a portfolio of individual stocks. The author applies the system in the article by allocating 5% of the equity to long positions in S&P 500 components that meet the ADX+TTI+VPCI entry criteria (see the Calculations section below for details). He uses the proceeds from closing positions to enter new positions in other stocks meeting the screening criteria, holding any excess proceeds in cash.
█ CALCULATIONS
The TTI is similar to the MACD. Its calculation entails the following steps:
Calculate fast (short-term) and slow (long-term) volume-weighted moving averages (VWMAs).
Compute the volume multiple (VM) as the square of the ratio of the fast VWMA to the slow VWMA.
Adjust these averages by multiplying the fast VWMA by the VM and dividing the slow VWMA by the VM.
Calculate the difference between the adjusted VWMAs to determine the TTI value, and take the average of that series to determine the signal line value.
The VPCI utilizes differences and ratios between VWMAs and corresponding simple moving averages (SMAs) to provide an alternative volume-price confirmation tool. Its calculation is as follows:
Subtract the slow SMA from the VWMA of the same length to calculate the volume-price confirmation/contradiction (VPC) value.
Divide the fast VWMA by the corresponding fast SMA to determine the volume-price ratio (VPR).
Divide the short-term VWMA by the long-term VWMA to calculate the VM.
Compute the VPCI as the product of the VPC, VPR, and VM values.
The long entry criteria of the ADX+TTI+VPCI system are as follows:
The ADX is above 30.
The TTI crosses above its signal line.
The VPCI is above 0, confirming the trend.
Signals to close positions occur when the VPCI is below 0, indicating a contradiction .
NOTE: Unlike in the article, this script applies the ADX+TTI+VPCI system to one stock at a time , not a portfolio of S&P 500 constituents.
█ DISCLAIMER
This strategy script educates users on the trading system outlined by the TASC article. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script.
Moving Average Crossover Swing StrategyMoving Average Crossover Swing Strategy
**Overview:**
The basic concept of this strategy is to generate a signal when a faster/shorter length moving average crosses over (for Longs) or crosses under (for Shorts) a medium/longer length moving average. All of which are customizable. This strategy can work on any timeframe, however the daily is the timeframe used for the default settings and screenshots, as it was designed to be a multi-day swing strategy. Once a signal has been confirmed with a candle close, based on user options, the strategy will enter the trade on the open of the next candle.
The crossover strategy is nothing new to trading, but what can make this strategy unique and helpful, is the addition of further confirmation points, ATR based stop loss and take profit targets, optional early exit criteria, customizable to your needs and style, and just about everything visual can be toggled on/off. This strategy is based on a Trend (MA) indicator and a Momentum (MACD) indicator. While a Volume-based indicator is not shown here, one could consider using their favorite from that category to further compliment the signal idea.
It should be noted that depending on the time frame, direction(s) chosen, the signal options, confirmation options, and exit options selected, that a ticker may not produce more than 100 trades on the back test. Depending on your style and frequency, one could consider adjusting options and/or testing multiple tickers. It should also be noted that this strategy simply tests the underlying stock prices, not options contracts. And of course, testing this strategy against historical data does not assume that the same results will occur in future price action.
Shoutout given to Ripster's Clouds Indicator as pieces of that code were taken and modified to create both the Cloud visualization effects, and the Moving Average Pair Plots that are implemented in this strategy.
BASIC DEFAULTS
All can be changed as normal
Initial capital = 10,000
Order Sizing = 25% of equity (use the "Inputs" tab to modify this)
Pyramiding = 0
Commission = 0.65 USD per order
Price Verification = 1 tick
Slippage = 1 tick
RISK MANAGMENT
You will notice two different percentage options and ATR multipliers. This strategy will adjust position sizing by not exceeding either one of those % values based on the ATR (Average True Range) of the symbol and the multipliers selected, should the stock hit the stop loss price.
For Example, lets assume these values are true:
Account size = $10,000,
Max Risk = 1% of account size
Max Position Size = 25% of the account size
Stock Price = 23.45
ATR = 3.5
ATR Stop Loss Multiplier = 1.4
Then the formulas would be:
ACCT_SIZE * MaxRisk_% = 10000 * .01 = $100 (MaxCashRisk)
-----
MaxCashRisk / (ATR * ATR_SL_MULTIPLIER) = 100 / (3.5 * 1.4) = 20.4 Shares based on Max Cash Risk
-----
(ACCT_SIZE * MaxEquity_%) / STOCK_PRICE = (10000 * .25) / 23.45 = 106.61 Shares based on Max Equity Allocation
The minimum value of each of those options is then used, which in this case would be to purchase 20 shares so as not to exceed the max dollar risk should the stock reach the stop loss target. Likewise, if the ATR were to be much lower, say 0.48 cents, and all else the same, then the strategy would purchase the 106 shares based on Max Equity Allocation because the Max Cash Risk would require 149.25 shares.
MOVING AVERAGE OPTIONS
Select between and change the length & type of up to 5 pairs (10 total) of moving averages
The "Show Cloud-x" option will display a fill color between the "a" and "b" pairs
All moving averages lines can be toggled on/off in the "Style" tab, as well as adjusting their colors.
Visualization features do not affect calculations, meaning you could have all or nothing on the chart and the strategy will still produce results
SIGNAL CHOICES
Choose the fast/shorter length MA and the medium/longer length MA to determine the entry signal
CONFIRMATION OPTIONS
Both of these have customizable values and can be toggled on/off
A candle close over a slower/much longer length moving average
An additional cross-over (cross-under for Shorts) on the MACD indicator using default MACD values. While the MACD indicator is not necessary to have on the chart, it can help to add that for visualization. The calculations will perform whether the indicator is on the chart or not.
EARLY EXIT CRITERIA
Both can be toggled on/off with customizable values
MA Cross Exit will exit the trade early if the select moving averages cross-under (for longs) or cross-over (for shorts), indicating a potential reversal.
Max Bars in Trades will act as a last-resort exit by simply calculating the amount of full bars the trade has been open, and exiting on the opening of the next bar. For example: the default value is 8 bars, so after 8 full bars in the trade, if no other exit has been triggered (Stop Loss, Take Profit, or MA Cross(if enabled)), then the trade will exit at the opening of the 9th bar.
Finally, there is a table displaying the amount of trades taken for each side, and the amount & percent of both early exits. This table can be turned off in the "Style" tab
ADDITIONAL PLOTS
MACD (Moving Average Convergence/Divergence):
- The MACD is an optional confirmation indicator for this strategy.
- Plotting the indicator is not necessary for the strategy to work, but it can be helpful to visually see the status and position of the MACD if this feature is enabled in the strategy
- This helps to identify if there is also momentum behind the entry signal
Strategy SEMA SDI WebhookPurpose of the Code:
The strategy utilizes Exponential Moving Averages (EMA) and Smoothed Directional Indicators (SDI) to generate buy and sell signals. It includes features like leverage, take profit, stop loss, and trailing stops. The strategy is intended for backtesting and automating trades based on the specified indicators and conditions.
Key Components and Functionalities:
1.Strategy Settings:
Overlay: The strategy will overlay on the price chart.
Slippage: Set to 1.
Commission Value: Set to 0.035.
Default Quantity Type: Percent of equity.
Default Quantity Value: 50% of equity.
Initial Capital: Set to 1000 units.
Calculation on Order Fills: Enabled.
Process Orders on Close: Enabled.
2.Date and Time Filters:
Inputs for enabling/disabling start and end dates.
Filters to execute strategy only within specified date range.
3.Leverage and Quantity:
Leverage: Adjustable leverage input (default 3).
USD Percentage: Adjustable percentage of equity to use for trades (default 50%).
Initial Capital: Calculated based on leverage and percentage of equity.
4.Take Profit, Stop Loss, and Trailing Stop:
Inputs for enabling/disabling take profit, stop loss, and trailing stop.
Adjustable parameters for take profit percentage (default 25%), stop loss percentage (default 4.8%), and trailing stop percentage (default 1.9%).
Calculations for take profit, stop loss, trailing price, and maximum profit tracking.
5.EMA Calculations:
Fast and slow EMAs.
Smoothed versions of the fast and slow EMAs.
6.SDI Calculations:
Directional movement calculation for positive and negative directional indicators.
Difference between the positive and negative directional indicators, smoothed.
7.Buy/Sell Conditions:
Long (Buy) Condition: Positive DI is greater than negative DI, and fast EMA is greater than slow EMA.
Short (Sell) Condition: Negative DI is greater than positive DI, and fast EMA is less than slow EMA.
8.Strategy Execution:
If buy conditions are met, close any short positions and enter a long position.
If sell conditions are met, close any long positions and enter a short position.
Exit conditions for long and short positions based on take profit, stop loss, and trailing stop levels.
Close all positions if outside the specified date range.
Usage:
This strategy is used to automate trading based on the specified conditions involving EMAs and SDI. It allows backtesting to evaluate performance based on historical data. The strategy includes risk management through take profit, stop loss, and trailing stops to protect gains and limit losses. Traders can customize the parameters to fit their specific trading preferences and risk tolerance. Differently, it can perform leverage analysis and use it as a template.
By using this strategy, traders can systematically execute trades based on technical indicators, helping to remove emotional bias and improve consistency in trading decisions.
Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
All Divergences with trend / SL - Uncle SamThanks to the main inspiration behind this strategy and the hard work of:
"Divergence for many indicators v4 by LonesomeTheBlue"
The "All Divergence" strategy is a versatile approach for identifying and acting upon various divergences in the market. Divergences occur when price and an indicator move in opposite directions, often signaling potential reversals. This strategy incorporates both regular and hidden divergences across multiple indicators (MACD, Stochastics, CCI, etc.) for a comprehensive analysis.
Key Features:
Comprehensive Divergence Analysis: The strategy scans for regular and hidden divergences across a variety of indicators, increasing the probability of identifying potential trade setups.
Trend Filter: To enhance accuracy, a moving average (MA) trend filter is integrated. This ensures trades align with the overall market trend, reducing the risk of false signals.
Customizable Risk Management: Users can adjust parameters for long/short stop-loss and take-profit levels to match their individual risk tolerance.
Additional Risk Management (Optional): An experimental MA-based risk management feature can be enabled to close positions if the market shows consecutive closes against the trend.
Clear Visuals: The script plots pivot points, divergence lines, and stop-loss levels on the chart for easy reference.
Strategy Settings (Defaults):
Enable Long/Short Strategy: True
Long/Short Stop Loss %: 2%
Long/Short Take Profit %: 5%
Enable MA Trend: True
MA Type: HMA (Hull Moving Average)
MA Length: 500
Use MA Risk Management: False (Experimental)
MA Risk Exit Candles: 2 (If enabled)
Pivot Period: 9
Source for Pivot Points: Close
Backtest Details (Example):
The strategy has been backtested on XAUUSD 1H (Goold/USD 1 hour timeframe) with a starting capital of $1,000. The backtest period covers around 2 years. A commission of 0.02% per trade and a 0.1% slippage per trade were factored in to simulate real-world trading costs.
Disclaimer:
This strategy is for educational and informational purposes only. Backtested results are not indicative of future performance. Use this strategy at your own risk. Always conduct your own analysis and consider consulting a financial professional before making any trading decisions.
Important Notes:
The default settings are a good starting point, but feel free to experiment to find optimal parameters for your specific trading style and market.
The MA-based risk management is an experimental feature. Use it with caution and thoroughly test it before deploying in live trading.
Backtest results can vary depending on the market, timeframe, and specific settings used. Always consider slippage and commission fees when evaluating a strategy's potential profitability.
Smoothed Heiken Ashi Strategy Long OnlyThis is a trend-following approach that uses a modified version of Heiken Ashi candles with additional smoothing. Here are the key components and features:
1. Heiken Ashi Modification: The strategy starts by calculating Heiken Ashi candles, which are known for better trend visualization. However, it modifies the traditional Heiken Ashi by using Exponential Moving Averages (EMAs) of the open, high, low, and close prices.
2. Double Smoothing: The strategy applies two layers of smoothing. First, it uses EMAs to calculate the Heiken Ashi values. Then, it applies another EMA to the Heiken Ashi open and close prices. This double smoothing aims to reduce noise and provide clearer trend signals.
3. Long-Only Approach: As the name suggests, this strategy only takes long positions. It doesn't short the market during downtrends but instead exits existing long positions when the sell signal is triggered.
4. Entry and Exit Conditions:
- Entry (Buy): When the smoothed Heiken Ashi candle color changes from red to green (indicating a potential start of an uptrend).
- Exit (Sell): When the smoothed Heiken Ashi candle color changes from green to red (indicating a potential end of an uptrend).
5. Position Sizing: The strategy uses a percentage of equity for position sizing, defaulting to 100% of available equity per trade. This should be tailored to each persons unique approach. Responsible trading would use less than 5% for each trade. The starting capital used is a responsible and conservative $1000, reflecting the average trader.
This strategy aims to provide a smooth, trend-following approach that may be particularly useful in markets with clear, sustained trends. However, it may lag in choppy or ranging markets due to its heavy smoothing. As with any strategy, it's important to thoroughly backtest and forward test before using it with real capital, and to consider using it in conjunction with other analysis tools and risk management techniques.
This has been created mainly to provide data to judge what time frame is most profitable for any single asset, as the volatility of each asset is different. This can bee seen using it on AUXUSD, which has a higher profitable result on the daily time frame, whereas other currencies need a higher or lower time frame. The user can toggle between each time frame and watch for the higher profit results within the strategy tester window.
Other smoothed Heiken Ashi indicators also do not provide buy and sell signals, and only show the change in color to dictate a change in trend. By adding buy and sell signals after the close of the candle in which the candle changes color, alerts can be programmed, which helps this be a more hands off protocol to experiment with. Other smoothed Heiken Ashi indicators do not allow for alarms to be set.
This is a unique HODL strategy which helps identify a change in trend, without the noise of day to day volatility. By switching to a line chart, it removes the candles altogether to avoid even more noise. The goal is to HODL a coin while the color is bullish in an uptrend, but once the indicator gives a sell signal, to sell the holdings back to a stable coin and let the chart ride down. Once the chart gives the next buy signal, use that same capital to buy back into the asset. In essence this removes potential losses, and helps buy back in cheaper, gaining more quantitity fo the asset, and therefore reducing your average initial buy in price.
Most HODL strategies ride the price up, miss selling at the top, then riding the price back down in anticipation that it will go back up to sell. This strategy will not hit the absolute tops, but it will greatly reduce potential losses.
FVG Positioning Average with 200EMA Auto Trading [Pakun]Description
Strategy Name and Purpose
FVG Positioning Average with 200EMA Auto Trading
This strategy uses Fair Value Gaps (FVG) combined with a 200-period Exponential Moving Average (EMA) and Average True Range (ATR) to generate trend-based trading signals. It is designed to help traders identify high-probability entry points by leveraging the gaps between fair value prices and current market prices.
Originality and Usefulness
This script combines multiple indicators to create a cohesive trading strategy that is greater than the sum of its parts. While FVG is a powerful tool on its own, combining it with the EMA and ATR adds layers of confirmation and risk management, enhancing its effectiveness. Here’s how the components work together:
Fair Value Gap (FVG): Identifies gaps in the market where price action has not fully filled, indicating potential reversal or continuation points.
200-period Exponential Moving Average (EMA): Acts as a trend filter to ensure trades are taken in the direction of the overall trend, improving the probability of success.
Average True Range (ATR): Used to filter out insignificant gaps and set dynamic stop-loss levels based on market volatility, enhancing risk management.
Entry Conditions
Long Entry
The close price crosses above the downtrend FVG.
The close price, FVG up average, and down average are all above the 200 EMA, indicating a strong bullish trend.
Short Entry
The close price crosses below the uptrend FVG.
The close price, FVG up average, and down average are all below the 200 EMA, indicating a strong bearish trend.
Exit Conditions
For long positions, the stop loss is set at the recent low, and the take profit is set at a point with a risk-reward ratio of 1:1.5.
For short positions, the stop loss is set at the recent high, and the take profit is set at a point with a risk-reward ratio of 1:1.5.
Risk Management
Account Size: 1,000,000 yen
Commission and Slippage: 2 pips commission and 1 pip slippage per trade
Risk per Trade: 10% of account equity
The stop loss is based on the recent low or recent high, ensuring trades are exited when the market moves against the position.
Settings Options
FVG Lookback: Set the lookback period for calculating FVGs.
Lookback Type: Choose the type of lookback (Bar Count or FVG Count).
ATR Multiplier: Set the multiplier for ATR to filter significant gaps.
EMA Period: Set the period for the EMA to adjust the trend filter sensitivity.
Show FVGs on Chart: Choose whether to display FVGs on the chart for visual confirmation.
Bullish/Bearish Color: Set the color for bullish and bearish FVGs to distinguish them easily.
Show Gradient Areas: Choose whether to display gradient areas to highlight the zones of interest.
Sufficient Sample Size
The strategy has been backtested with 113 trades, providing a sufficient sample size to evaluate its performance.
Notes
This strategy is based on historical data and does not guarantee future results.
Thoroughly backtest and validate results before using in live trading.
Market volatility and other external factors can affect performance and may not yield expected results.
Acknowledgment
This strategy uses the FVG Positioning Average Strategy indicator. Thanks to for their contribution.
Clean Chart Explanation
The script is published with a clean chart to ensure that its output is readily identifiable and easy to understand. No other scripts are included on the chart, and any drawings or images used are specifically to illustrate how the script works.
[INVX] Post-Earnings Announcement DriftWhat does this strategy do?
This Pine Script strategy implements the Post-earnings announcement drift (PEAD) strategy, which is a financial market anomaly where a stock's price tends to drift in the direction of the firm's earnings surprise for an extended period of time.
Ref: en.wikipedia.org
An earnings announcement is an official public statement of a company's profitability for a specific time period, typically a quarter or a year. It includes various financial metrics but the most watched figure is the Earnings Per Share (EPS). Analysts estimate the EPS before the announcement, and the actual EPS is compared to this estimate to determine if there was an earnings surprise.
An earnings surprise occurs when the actual EPS is significantly different from the analysts' estimates. A positive earnings surprise indicates that the actual EPS is higher than the estimate, while a negative earnings surprise suggests the EPS is lower than anticipated.
The script takes the following inputs
" Holding periods (bar) " : This input defines the number of periods (or bars) the script will hold a position after the earnings announcement.
" Surprise threshold (%) ": This input sets the minimum percentage for an earnings surprise, which triggers the strategy to enter either a long or short position. In essence, it represents the minimum deviation between the estimated and actual Earnings Per Share (EPS) that will trigger a trade. A higher threshold may lead to fewer, potentially more significant trades, while a lower threshold might result in more frequent, possibly less impactful trades. This parameter allows you to adjust the sensitivity of the strategy to earnings surprises.
Positive earnings surprise
After the earnings announcement, the script compares the actual EPS with the estimated EPS to identify an earnings surprise. If there is a positive earnings surprise, the script will enter a long position. A long position is a bullish strategy where the investor expects the stock price to rise.
Negative earnings surprise
On the other hand, if there is a negative earnings surprise, the script will enter a short position. A short position is a bearish strategy where the investor expects the stock price to fall.
In both scenarios, the position (either long or short) is held for the number of periods specified in the "Holding periods (bar)" input. This strategy is based on the assumption that the stock price will continue to drift in the direction of the earnings surprise for the specified holding period.
Disclaimer: The script provided herein is for educational purposes only. It should not be considered as investment advice or a recommendation of any particular security, strategy or investment product. Past performance is not indicative of future results.
The results of the Pine Script backtesting are hypothetical and should not be considered as a true reflection of the results that might be achieved in a live trading environment. The backtest results are based on historical data and may not take into account certain factors such as actual transaction costs, taxes, or changes in market conditions.
Investors should consult with their financial advisor before making any investment decisions. All investments involve risk, including the potential loss of all invested capital.
ADX + CCI + MA - Uncle SamStrategy Name: ADX + CCI + MA - Uncle Sam
Overview
This strategy aims to capitalize on trending markets by combining the Average Directional Index (ADX), Commodity Channel Index (CCI), and a customizable Moving Average (MA). It's designed for traders seeking a balanced approach to both long (buy) and short (sell) opportunities. Special thanks to the creators of the ADX and CCI indicators for their invaluable contributions to technical analysis.
Strategy Concept
The core idea is to identify strong trends with the ADX, confirm potential entry points with the CCI, and use the MA to filter trades in the direction of the broader trend. This approach seeks to avoid entering positions during periods of consolidation or when the trend is weak.
Indicator Logic
ADX (Average Directional Index): The ADX measures the strength of a trend, regardless of its direction. A value above the customizable adx_threshold (default 20) signals a strong trend, making it a prime environment for this strategy.
CCI (Commodity Channel Index): The CCI is a momentum oscillator that helps identify overbought (above 100) and oversold (below -100) conditions. We use CCI crossovers to time entries in the direction of the prevailing trend.
MA (Moving Average): The MA acts as a trend filter, ensuring we only enter trades aligned with the overall market direction. You have flexibility in choosing the MA type (SMA, EMA, etc.) and its length to suit your trading style and timeframe.
Entry Conditions
Long (Buy):
ADX is above the adx_threshold.
CCI crosses above 100.
Price is above the chosen Moving Average (if MA trend filtering is enabled).
Short (Sell):
ADX is above the adx_threshold.
CCI crosses below -100.
Price is below the chosen Moving Average (if MA trend filtering is enabled).
Exit Conditions
Stop Loss (SL): Each position has a customizable stop-loss percentage to manage risk. The default setting is 1%.
Take Profit (TP): Each position has a customizable take-profit percentage to secure gains. The default setting is 5%.
MA-Based Risk Management (Optional): This feature allows for early exits if the price closes against the MA trend for a specified number of candles. The default setting is 2 candles.
Default Settings
CCI Period: 15
ADX Length: 10
ADX Threshold: 20
MA Type: HMA
MA Length: 200
MA Source: Close
Commission Fee: $0.0
A commission fee is not added, add your trading/platform commission for realistic trading costs.
Backtest Results
The strategy has been backtested on with the default settings and a starting capital of $1000, with 0.0% commission fee. It shows promising results.
Disclaimer: Backtesting is hypothetical and does not guarantee future performance.
Important Considerations:
Customization: The strategy offers extensive customization to tailor it to your preferences. Experiment with different parameters and settings to find what works best for your trading style.
Risk Management: Always use proper risk management techniques, including position sizing and stop losses, to protect your capital.
Power Hour Money StrategyDescription of the Pine Script Code: "Power Hour Money Strategy"
This Pine Script strategy, "Power Hour Money Strategy," is designed to trade based on the alignment of multiple time frames (month, week, day, and hour). The strategy aims to enter long or short positions depending on whether all selected time frames are in sync (all green for long positions, all red for short positions). Additionally, the script includes configurations for trading during specific sessions and automatically closing positions at the end of the trading day.
Core Features:
1. Time Frame Sync Check:
- The strategy evaluates whether the current price is higher than the opening price for the month, week, day, and hour to determine if each time frame is "green" (bullish) or "red" (bearish).
2. Session Control:
- The user can select between different trading sessions:
- "NY Session 9:30-11:30"
- "Extended NY Session 8-4"
- "All Sessions"
- Trades are only executed if the current time falls within the selected session.
3. Trailing Stop Mechanism:
- The strategy includes an optional trailing stop mechanism for both long and short positions.
- The trailing stop is configured with a percentage loss from the current price to protect gains.
4. End-of-Day Position Management:
- An option is provided to automatically close all positions at the end of the trading day (5:45 PM Eastern Time).
Detailed Code Breakdown:
1. Input Settings:
- **Session Selection**: Allows the user to choose the trading session.
- **End-of-Day Close**: Option to automatically close positions at the end of the day.
- **Trailing Stop Loss**: Enables or disables the trailing stop loss feature and sets the percentage for long and short positions.
2. Time Frame Calculations:
- The script uses `request.security` to get the opening prices for higher time frames (monthly, weekly, daily, and hourly).
- It compares the current close price to these opening prices to determine if each time frame is green or red.
3. Session Time Definitions:
- Defines the start and end times for the NY session (9:30-11:30 AM) and the extended session (8:00 AM - 4:00 PM).
4. Trade Execution:
- The strategy checks if all selected time frames are in sync and if the current time falls within the trading session.
- If all conditions are met, it enters a long or short position.
5. Trailing Stop Loss Implementation:
- Adjusts the stop price based on the trailing percentage and the current position's size.
- Automatically exits positions if the trailing stop condition is met.
6. End-of-Day Close Implementation:
- Uses a timestamp to check if the current time is 5:45 PM Eastern Time.
- Closes all positions if the end-of-day condition is met.
7. Plotting and Logging:
- Plots indicators to visualize the green/red status of each time frame.
- Logs information about the status of each time frame for debugging and analysis.
Example Usage:
Entering a Long Position: If the month, week, day, and hour are all green and the current time is within the selected session, a long position is entered.
Entering a Short Position: If the month, week, day, and hour are all red and the current time is within the selected session, a short position is entered.
Trailing Stop: Protects gains by exiting the position if the price moves against the set trailing stop percentage.
End-of-Day Close: Automatically closes all open positions at 5:45 PM Eastern Time if enabled.
This strategy is particularly useful for traders who want to ensure that multiple time frames are in alignment before entering a trade and who wish to manage positions effectively throughout the trading day with specific session controls and trailing stops.
Gold & EUR/USD LTF liquidity Sweep + Market structure shift on a lower time frame for sniper entries