Rsi Long-Term Strategy [15min]Hello, I would like to present to you The "RSI Long-Term Strategy" for 15min tf
The "RSI Long-Term Strategy " is designed for traders who prefer a combination of momentum and trend-following techniques. The strategy focuses on entering long positions during significant market corrections within an overall uptrend, confirmed by both RSI and volume. The use of long-term SMAs ensures that trades are made in line with the broader market trend. The stop-loss feature provides risk management by limiting losses on trades that do not perform as expected. This strategy is particularly well-suited for longer-term traders who monitor 15-minute charts but look for substantial trend reversals or continuations.
Indicators and Parameters:
Relative Strength Index (RSI):
- The RSI is calculated using a 10-period length. It measures the magnitude of recent price changes to evaluate overbought or oversold conditions. The script defines oversold conditions when the RSI is at or below 30 and overbought conditions when the RSI is at or above 70.
Volume Condition:
-The strategy incorporates a volume condition where the current volume must be greater than 2.5 times the 20-period moving average of volume. This is used to confirm the strength of the price movement.
Simple Moving Averages (SMA):
- The strategy uses two SMAs: SMA1 with a length of 250 periods and SMA2 with a length of 500 periods. These SMAs help identify long-term trends and generate signals based on their crossover.
Strategy Logic:
Entry Logic:
A long position is initiated when all the following conditions are met:
The RSI indicates an oversold condition (RSI ≤ 30).
SMA1 is above SMA2, indicating an uptrend.
The volume condition is satisfied, confirming the strength of the signal.
Exit Logic:
The strategy closes the long position when SMA1 crosses under SMA2, signaling a potential end of the uptrend (a "Death Cross").
Stop-Loss:
A stop-loss is set at 5% below the entry price to manage risk and limit potential losses.
Buy and sell signals are highlighted with circles below or above bars:
Green Circle : Buy signal when RSI is oversold, SMA1 > SMA2, and the volume condition is met.
Red Circle : Sell signal when RSI is overbought, SMA1 < SMA2, and the volume condition is met.
Black Cross: "Death Cross" when SMA1 crosses under SMA2, indicating a potential bearish signal.
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
;)
Oscillators
Multi-Factor StrategyThis trading strategy combines multiple technical indicators to create a systematic approach for entering and exiting trades. The goal is to capture trends by aligning several key indicators to confirm the direction and strength of a potential trade. Below is a detailed description of how the strategy works:
Indicators Used
MACD (Moving Average Convergence Divergence):
MACD Line: The difference between the 12-period and 26-period Exponential Moving Averages (EMAs).
Signal Line: A 9-period EMA of the MACD line.
Usage: The strategy looks for crossovers between the MACD line and the Signal line as entry signals. A bullish crossover (MACD line crossing above the Signal line) indicates a potential upward movement, while a bearish crossover (MACD line crossing below the Signal line) signals a potential downward movement.
RSI (Relative Strength Index):
Usage: RSI is used to gauge the momentum of the price movement. The strategy uses specific thresholds: below 70 for long positions to avoid overbought conditions and above 30 for short positions to avoid oversold conditions.
ATR (Average True Range):
Usage: ATR measures market volatility and is used to set dynamic stop-loss and take-profit levels. A stop loss is set at 2 times the ATR, and a take profit at 3 times the ATR, ensuring that risk is managed relative to market conditions.
Simple Moving Averages (SMA):
50-day SMA: A short-term trend indicator.
200-day SMA: A long-term trend indicator.
Usage: The strategy uses the relationship between the 50-day and 200-day SMAs to determine the overall market trend. Long positions are taken when the price is above the 50-day SMA and the 50-day SMA is above the 200-day SMA, indicating an uptrend. Conversely, short positions are taken when the price is below the 50-day SMA and the 50-day SMA is below the 200-day SMA, indicating a downtrend.
Entry Conditions
Long Position:
-MACD Crossover: The MACD line crosses above the Signal line.
-RSI Confirmation: RSI is below 70, ensuring the asset is not overbought.
-SMA Confirmation: The price is above the 50-day SMA, and the 50-day SMA is above the 200-day SMA, indicating a strong uptrend.
Short Position:
MACD Crossunder: The MACD line crosses below the Signal line.
RSI Confirmation: RSI is above 30, ensuring the asset is not oversold.
SMA Confirmation: The price is below the 50-day SMA, and the 50-day SMA is below the 200-day SMA, indicating a strong downtrend.
Opposite conditions for shorts
Exit Strategy
Stop Loss: Set at 2 times the ATR from the entry price. This dynamically adjusts to market volatility, allowing for wider stops in volatile markets and tighter stops in calmer markets.
Take Profit: Set at 3 times the ATR from the entry price. This ensures a favorable risk-reward ratio of 1:1.5, aiming for higher rewards on successful trades.
Visualization
SMAs: The 50-day and 200-day SMAs are plotted on the chart to visualize the trend direction.
MACD Crossovers: Bullish and bearish MACD crossovers are highlighted on the chart to identify potential entry points.
Summary
This strategy is designed to align multiple indicators to increase the probability of successful trades by confirming trends and momentum before entering a position. It systematically manages risk with ATR-based stop loss and take profit levels, ensuring that trades are exited based on market conditions rather than arbitrary points. The combination of trend indicators (SMAs) with momentum and volatility indicators (MACD, RSI, ATR) creates a robust approach to trading in various market environments.
RSI Strategy with Adjustable RSI and Stop-LossThis trading strategy uses the Relative Strength Index (RSI) and a Stop-Loss mechanism to make trading decisions. Here’s a breakdown of how it works:
RSI Calculation:
The RSI is calculated based on the user-defined length (rsi_length). This is a momentum oscillator that measures the speed and change of price movements.
Buy Condition:
The strategy generates a buy signal when the RSI value is below a user-defined threshold (rsi_threshold). This condition indicates that the asset might be oversold and potentially due for a rebound.
Stop-Loss Mechanism:
Upon triggering a buy signal, the strategy calculates the Stop-Loss level. The Stop-Loss level is set to a percentage below the entry price, as specified by the user (stop_loss_percent). This level is used to limit potential losses if the price moves against the trade.
Sell Condition:
A sell signal is generated when the current closing price is higher than the highest high of the previous day. This condition suggests that the price has reached a new high, and the strategy decides to exit the trade.
Plotting:
The RSI values are plotted on the chart for visual reference. A horizontal line is drawn at the RSI threshold level to help visualize the oversold condition.
Summary
Buying Strategy: When RSI is below the specified threshold, indicating potential oversold conditions.
Stop-Loss: Set based on a percentage of the entry price to limit potential losses.
Selling Strategy: When the price surpasses the highest high of the previous day, signaling a potential exit point.
This strategy aims to capture potential rebounds from oversold conditions and manage risk using a Stop-Loss mechanism. As with any trading strategy, it’s essential to test and optimize it under various market conditions to ensure its effectiveness.
MACD with 1D Stochastic Confirmation Reversal StrategyOverview
The MACD with 1D Stochastic Confirmation Reversal Strategy utilizes MACD indicator in conjunction with 1 day timeframe Stochastic indicators to obtain the high probability short-term trend reversal signals. The main idea is to wait until MACD line crosses up it’s signal line, at the same time Stochastic indicator on 1D time frame shall show the uptrend (will be discussed in methodology) and not to be in the oversold territory. Strategy works on time frames from 30 min to 4 hours and 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.
Higher time frame confirmation: Strategy utilizes 1D Stochastic to establish the major trend and confirm the local reversals with the higher probability.
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:
MACD line of MACD indicator shall cross over the signal line of MACD indicator.
1D time frame Stochastic’s K line shall be above the D line.
1D time frame Stochastic’s K line value shall be below 80 (not overbought)
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 = 3.25, value multiplied by ATR to be subtracted from position entry price to setup stop loss)
ATR Trailing Profit Activation Level (by default = 4.25, value multiplied by ATR to be added to position entry price to setup trailing profit activation level)
Trailing EMA Length (by default = 20, period for EMA, when price reached trailing profit activation level EMA will stop out of position if price closes below it)
User can choose the optimal parameters during backtesting on certain price chart, in our example we use default settings.
Justification of Methodology
This strategy leverages 2 time frames analysis to have the high probability reversal setups on lower time frame in the direction of the 1D time frame trend. That’s why it’s recommended to use this strategy on 30 min – 4 hours time frames.
To have an approximation of 1D time frame trend strategy utilizes classical Stochastic indicator. The Stochastic Indicator is a momentum oscillator that compares a security's closing price to its price range over a specific period. It's used to identify overbought and oversold conditions. The indicator ranges from 0 to 100, with readings above 80 indicating overbought conditions and readings below 20 indicating oversold conditions.
It consists of two lines:
%K: The main line, calculated using the formula (CurrentClose−LowestLow)/(HighestHigh−LowestLow)×100 . Highest and lowest price taken for 14 periods.
%D: A smoothed moving average of %K, often used as a signal line.
Strategy logic assumes that on 1D time frame it’s uptrend in %K line is above the %D line. Moreover, we can consider long trade only in %K line is below 80. It means that in overbought state the long trade will not be opened due to higher probability of pullback or even major trend reversal. If these conditions are met we are going to our working (lower) time frame.
On the chosen time frame, we remind you that for correct work of this strategy you shall use 30min – 4h time frames, MACD line shall cross over it’s signal line. The MACD (Moving Average Convergence Divergence) is a popular momentum and trend-following indicator used in technical analysis. It helps traders identify changes in the strength, direction, momentum, and duration of a trend in a stock's price.
The MACD consists of three components:
MACD Line: This is the difference between a short-term Exponential Moving Average (EMA) and a long-term EMA, typically calculated as: MACD Line=12-period EMA−26-period
Signal Line: This is a 9-period EMA of the MACD Line, which helps to identify buy or sell signals. When the MACD Line crosses above the Signal Line, it can be a bullish signal (suggesting a buy); when it crosses below, it can be a bearish signal (suggesting a sell).
Histogram: The histogram shows the difference between the MACD Line and the Signal Line, visually representing the momentum of the trend. Positive histogram values indicate increasing bullish momentum, while negative values indicate increasing bearish momentum.
In our script we are interested in only MACD and signal lines. When MACD line crosses signal line there is a high chance that short-term trend reversed to the upside. We use this strategy on 45 min time frame.
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.
Backtest Results
Operating window: Date range of backtests is 2023.01.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: 30%
Maximum Single Position Loss: -4.79%
Maximum Single Profit: +20.14%
Net Profit: +2361.33 USDT (+44.72%)
Total Trades: 123 (44.72% win rate)
Profit Factor: 1.623
Maximum Accumulated Loss: 695.80 USDT (-5.48%)
Average Profit per Trade: 19.20 USDT (+0.59%)
Average Trade Duration: 30 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 between 30 min and 4 hours and chart (optimal performance observed on 45 min 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
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指标,深入了解市场周期。
无论您是经验丰富的投资者,还是刚开始接触数字资产,"智慧积累者"策略都能为您提供一种智能、低风险的方式来增加您的持仓。
准备好开始您的智能积累之旅了吗?立即尝试"智慧积累者"策略,让您的投资更上一层楼!
🚀 智能、安全、高效 - 您的数字资产积累好帮手!🚀
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.
TSI w SuperTrend decision - Strategy [presentTrading]This strategy aims to improve upon the performance of Traidngview's newly published "Trend Strength Index" indicator by incorporating the SuperTrend for better trade execution and risk management. Enjoy :)
█ Introduction and How it is Different
The "TSI with SuperTrend Decision - Strategy" combines the Trend Strength Index (TSI) with SuperTrend indicators to determine entry and exit points. Unlike traditional strategies that rely solely on one indicator, this method leverages the strengths of both TSI and SuperTrend to provide a more nuanced and adaptive trading strategy.
This dual approach allows for capturing trends more effectively, especially in volatile markets.
BTCUSD 8h LS Performance
█ Strategy, How it Works: Detailed Explanation
🔶 Trend Strength Index (TSI)
The TSI is a momentum oscillator that shows both the direction and strength of a trend. It is calculated by comparing the price movement with the bar index over a specified period. The formula for TSI is as follows:
```
TSI = (PC / |PC|)
where:
PC = Change in price over the period
```
In this strategy, TSI is calculated using the closing prices and a default period of 64 bars. The TSI values help identify overbought and oversold conditions, providing signals for potential market reversals.
🔶 SuperTrend Indicator
The SuperTrend is a trend-following indicator based on the average true range (ATR). It helps in identifying the direction of the market trend. The SuperTrend calculation involves:
```
SuperTrend = HLC3 ± (Factor * ATR)
where:
HLC3 = (High + Low + Close) / 3
Factor = User-defined multiplier
ATR = Average True Range over a period
```
The SuperTrend settings in this strategy include a length of 10 bars and a factor of 3.0.
Last Bull Cycle of BTC
🔶 Entry and Exit Conditions
The strategy uses the TSI and SuperTrend together to determine entry and exit points:
- Long Entry: When the SuperTrend indicates a downward trend (st.d < 0) and the TSI is above the oversold level (-0.241).
- Long Exit: When the SuperTrend indicates an upward trend (st.d > 0) and the TSI is below the overbought level (0.241).
- Short Entry: When the SuperTrend indicates an upward trend (st.d > 0) and the TSI is below the overbought level (0.241).
- Short Exit: When the SuperTrend indicates a downward trend (st.d < 0) and the TSI is above the oversold level (-0.241).
█ Trade Direction
The strategy allows users to select the trade direction through the `tradeDirection` input. The options are:
- Both: Enables both long and short trades.
- Long: Enables only long trades.
- Short: Enables only short trades.
█ Default Settings
- TSI Length: 64
- SuperTrend Length: 10
- SuperTrend Factor: 3.0
- Trade Direction: Both
- Take Profit (%): 30.0
- Stop Loss (%): 20.0
Impact of Default Settings
- TSI Length: A longer TSI period smooths out noise but may lag in identifying trends. A shorter period is more responsive but can generate false signals.
- SuperTrend Length: A shorter length provides quicker signals but can be prone to whipsaws. A longer length is more reliable but may delay entries and exits.
- SuperTrend Factor: A higher factor increases the distance of the SuperTrend from the price, reducing sensitivity to minor price fluctuations.
- Trade Direction: Allows flexibility in trading strategies by enabling both long and short trades based on market conditions.
- Take Profit and Stop Loss: These settings manage risk by automatically closing trades at predefined profit or loss levels. Higher percentages provide larger potential gains but also higher risk.
HMA Crossover 1H with RSI, Stochastic RSI, and Trailing StopThe strategy script provided is a trading algorithm designed to help traders make informed buy and sell decisions based on certain technical indicators. Here’s a breakdown of what each part of the script does and how the strategy works:
Key Components:
Hull Moving Averages (HMA):
HMA 5: This is a Hull Moving Average calculated over 5 periods. HMAs are used to smooth out price data and identify trends more quickly than traditional moving averages.
HMA 20: This is another HMA but calculated over 20 periods, providing a broader view of the trend.
Relative Strength Index (RSI):
RSI 14: This is a momentum oscillator that measures the speed and change of price movements over a 14-period timeframe. It helps identify overbought or oversold conditions in the market.
Stochastic RSI:
%K: This is the main line of the Stochastic RSI, which combines the RSI and the Stochastic Oscillator to provide a more sensitive measure of overbought and oversold conditions. It is smoothed with a 3-period simple moving average.
Trading Signals:
Buy Signal:
Generated when the 5-period HMA crosses above the 20-period HMA, indicating a potential upward trend.
Additionally, the RSI must be below 45, suggesting that the market is not overbought.
The Stochastic RSI %K must also be below 39, confirming the oversold condition.
Sell Signal:
Generated when the 5-period HMA crosses below the 20-period HMA, indicating a potential downward trend.
The RSI must be above 60, suggesting that the market is not oversold.
The Stochastic RSI %K must also be above 63, confirming the overbought condition.
Trailing Stop Loss:
This feature helps protect profits by automatically selling the position if the price moves against the trade by 5%.
For sell positions, an additional trailing stop of 100 points is included.
Advanced Gold Scalping Strategy with RSI Divergence# Advanced Gold Scalping Strategy with RSI Divergence
## Overview
This Pine Script implements an advanced scalping strategy for gold (XAUUSD) trading, primarily designed for the 1-minute timeframe. The strategy utilizes the Relative Strength Index (RSI) indicator along with its moving average to identify potential trade setups based on divergences between price action and RSI movements.
## Key Components
### 1. RSI Calculation
- Uses a customizable RSI length (default: 60)
- Allows selection of the source for RSI calculation (default: close price)
### 2. Moving Average of RSI
- Supports multiple MA types: SMA, EMA, SMMA (RMA), WMA, VWMA, and Bollinger Bands
- Customizable MA length (default: 3)
- Option to display Bollinger Bands with adjustable standard deviation multiplier
### 3. Divergence Detection
- Implements both bullish and bearish divergence identification
- Uses pivot high and pivot low points to detect divergences
- Allows for customization of lookback periods and range for divergence detection
### 4. Entry Conditions
- Long Entry: Bullish divergence when RSI is below 40
- Short Entry: Bearish divergence when RSI is above 60
### 5. Trade Management
- Stop Loss: Customizable, default set to 11 pips
- Take Profit: Customizable, default set to 33 pips
### 6. Visualization
- Plots RSI line and its moving average
- Displays horizontal lines at 30, 50, and 70 RSI levels
- Shows Bollinger Bands when selected
- Highlights divergences with "Bull" and "Bear" labels on the chart
## Input Parameters
- RSI Length: Adjusts the period for RSI calculation
- RSI Source: Selects the price source for RSI (close, open, high, low, hl2, hlc3, ohlc4)
- MA Type: Chooses the type of moving average applied to RSI
- MA Length: Sets the period for the moving average
- BB StdDev: Adjusts the standard deviation multiplier for Bollinger Bands
- Show Divergence: Toggles the display of divergence labels
- Stop Loss: Sets the stop loss distance in pips
- Take Profit: Sets the take profit distance in pips
## Strategy Logic
1. **RSI Calculation**:
- Computes RSI using the specified length and source
- Calculates the chosen type of moving average on the RSI
2. **Divergence Detection**:
- Identifies pivot points in both price and RSI
- Checks for higher lows in RSI with lower lows in price (bullish divergence)
- Checks for lower highs in RSI with higher highs in price (bearish divergence)
3. **Trade Entry**:
- Enters a long position when a bullish divergence is detected and RSI is below 40
- Enters a short position when a bearish divergence is detected and RSI is above 60
4. **Position Management**:
- Places a stop loss order at the entry price ± stop loss pips (depending on the direction)
- Sets a take profit order at the entry price ± take profit pips (depending on the direction)
5. **Visualization**:
- Plots the RSI and its moving average
- Draws horizontal lines for overbought/oversold levels
- Displays Bollinger Bands if selected
- Shows divergence labels on the chart for identified setups
## Usage Instructions
1. Apply the script to a 1-minute XAUUSD (Gold) chart in TradingView
2. Adjust the input parameters as needed:
- Increase RSI Length for less frequent but potentially more reliable signals
- Modify MA Type and Length to change the sensitivity of the RSI moving average
- Adjust Stop Loss and Take Profit levels based on current market volatility
3. Monitor the chart for Bull (long) and Bear (short) labels indicating potential trade setups
4. Use in conjunction with other analysis and risk management techniques
## Considerations
- This strategy is designed for short-term scalping and may not be suitable for all market conditions
- Always backtest and forward test the strategy before using it with real capital
- The effectiveness of divergence-based strategies can vary depending on market trends and volatility
- Consider using additional confirmation signals or filters to improve the strategy's performance
Remember to adapt the strategy parameters to your risk tolerance and trading style, and always practice proper risk management.
Chande Momentum Oscillator (CMO) Buy Sell Strategy [TradeDots]The "Chande Momentum Oscillator (CMO) Buy Sell Strategy" leverages the CMO indicator to identify short-term buy and sell opportunities.
HOW DOES IT WORK
The standard CMO indicator measures the difference between recent gains and losses, divided by the total price movement over the same period. However, this version of the CMO has some limitations.
The primary disadvantage of the original CMO is its responsiveness to short-term volatility, making the signals less smooth and more erratic, especially in fluctuating markets. This instability can lead to misleading buy or sell signals.
To address this, we integrated the concept from the Moving Average Convergence Divergence (MACD) indicator. By applying a 9-period exponential moving average (EMA) to the CMO line, we obtained a smoothed signal line. This line acts as a filter, identifying confirmed overbought or oversold states, thereby reducing the number of false signals.
Similar to the MACD histogram, we generate columns representing the difference between the CMO and its signal line, reflecting market momentum. We use this momentum indicator as a criterion for entry and exit points. Trades are executed when there's a convergence of CMO and signal lines during an oversold state, and they are closed when the CMO line diverges from the signal line, indicating increased selling pressure.
APPLICATION
Since the 9-period EMA smooths the CMO line, it's less susceptible to extreme price fluctuations. However, this smoothing also makes it more challenging to breach the original +50 and -50 benchmarks.
To increase trading opportunities, we've tightened the boundary ranges. Users can customize the target benchmark lines in the settings to adjust for the volatility of the underlying asset.
The 'cool down period' is essentially the number of bars that await before the next signal generation. This feature is employed to dodge the occurrence of multiple signals in a short period.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 80%
Signal Cool Down Period: 5
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
Custom Signal Oscillator StrategyThe CSO is made to help traders easily test their theories by subtracting the difference between two customizable plots(indicators) without having to search for strategies. The general purpose is to provide a tool to users without coding knowledge.
How to use :
Apply the indicator(s) to test
Go to the CSO strategy input settings and select the desired plots from the added indicators. (The back test will enter long or short depending on the fast signal crosses on the slow signal)
Pull up the strategy tester
Adjust the input settings on the selected indicator(s) to back test
For example, the published strategy is using the basis lines from two Donchian channels with varying length. This can be utilized with multiple overlays on the chart and oscillators that are operating on the same scale with each other. Since chart glows aren't extremely common, a glow option is included to stand out on the chart as the chain operator. A long only option for is also included for versatility.
Korneev Reverse RSIRethinking the Legendary Relative Strength Index by John Welles Wilder
The essence of the new approach lies in the reverse use of the so-called "overbought" and "oversold" zones. In his 1978 book, "New Concepts in Technical Trading Systems," where the RSI mechanism was thoroughly described, Wilder writes that one way to use the oscillator is to open a long position when the RSI drops into oversold territory (below 30) and to open a short position when the RSI rises to overbought levels (above 70). However, backtesting this strategy with such inputs yields rather mediocre results.
Based on the calculation formula, the RSI calculates the rate of price change over a certain period. Therefore, overbought and oversold zones will have relative significance (relative to the set calculation period). It is no coincidence that the word "relative" was added to the name of the oscillator. It is worth accepting as an axiom the assertion that the price of an asset is fair at every moment in time.
Essentially, the RSI calculates the strength of a trend. If the oscillator value is above 70, it is highly likely that an upward movement is occurring in the market. Therefore, in the current strategy, a long position is opened precisely at the moment of greatest buyer strength (when RSI > 80), i.e., in the direction of the trend, since counter-trend trading with the RSI has proven to be ineffective. The position is closed after the buyers lose their advantage and the RSI drops to 40.
The strategy is recommended to be used only with long positions, as short positions show negative results. The strategy uses a moving average for the RSI with a period of 14 to smooth the oscillator data.
--------------------------------------------------------------------------------------------
Переосмысление легендарного осциллятора Relative strength index Джона Уэллса Уайлдера
Суть нового подхода заключается в реверсивном использовании так называемых зон "перекупленности" и "перепроданности". В своей книге от 1978 года "New concepts in tecnical trading systems", в которой был подробно описан механизм работы RSI, Уайлдер пишет, что один из способов использования осциллятора - открытие длинной позиции при снижении RSI в перепроданность (ниже 30) и открытие короткой позиции при повышении RSI до перекупленности (выше 70). Однако бэктест стратегии с такими вводными дает весьма посредственные результаты.
Исходя из формулы расчета, RSI рассчитывает скорость изменения цены за определенный период. Поэтому зоны перекупленности и перепроданности будут иметь относительное значение (относительно установленного периода расчета). Не зря ведь в названии осциллятора было добавлено слово "относительной". Стоит принять за аксиому утверждение, что цена актива справедлива в каждый момент времени.
По сути, RSI рассчитывает силу тренда. Если значение осциллятора выше 70, то на рынке с высокой долей вероятности происходит восходящее движение. Поэтому в текущей стратегии открытие лонга происходит именно в момент наибольшей силы покупателей (когда RSI > 80), то есть в сторону тренда, поскольку контртрендовая торговля по RSI показала свою несостоятельность. Закрытие позиции происходит после того, как покупатели теряют преимущество и RSI снижается до 40.
Стратегию рекомендуется использовать только с длинными позициями, поскольку короткие позиции показывают отрицательный результат. В стратегии используется скользящая средняя для RSI с периодом 14 для сглаживания данных осциллятора.
Triple EMA + QQE Trend Following Strategy [TradeDots]The "Triple EMA + QQE Trend Following Strategy" harnesses the power of two sophisticated technical indicators, the Triple Exponential Moving Average (TEMA) and the Qualitative Quantitative Estimation (QQE), to generate precise buy and sell signals. This strategy excels in capturing shifts in trends by identifying short-term price momentum and dynamic overbought or oversold conditions.
HOW IT WORKS
This strategy integrates two pivotal indicators:
Triple Exponential Moving Average (TEMA): TEMA enhances traditional moving averages by reducing lag and smoothing the data more effectively. It achieves this by applying the EMA formula three times onto the price, as follows:
tema(src, length) =>
ema1 = ta.ema(src, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
tema = 3*ema1 - 3*ema2 + ema3
This computation helps to sharpen the sensitivity to price movements.
Qualitative Quantitative Estimation (QQE): The QQE indicator improves upon the standard RSI by incorporating a smoothing mechanism. It starts with the standard RSI, overlays a 5-period EMA on this RSI, and then enhances the result using a double application of a 27-period EMA. A slow trailing line is then derived by multiplying the result with a factor number. This approach establishes a more refined and less jittery trend-following signal, complementing the TEMA to enhance overall market timing during fluctuating conditions.
APPLICATION
Referenced from insights on "Trading Tact," the strategy implementation follows:
First of all, we utilize two TEMA lines: one set at a 20-period and the other at a 40-period. Then following the rules below:
40-period TEMA is rising
20-period TEMA is above 40-period TEMA
Price closes above 20-period TEMA
Today is not Monday
RSI MA crosses the Slow trailing line
This strategy does not employ an active take profit mechanism; instead, it utilizes a trailing stop loss to allow the price to reach the stop loss naturally, thereby maximizing potential profit margins.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 80%
Users are advised to adjust and personalize this trading strategy to better match their individual trading preferences and style.
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
Reference:
Trading Tact. What Is the QQE Indicator? Retrieved from: tradingtact.com
Dual RSI Differential - Strategy [presentTrading]█ Introduction and How it is Different
The Dual RSI Differential Strategy introduces a nuanced approach to market analysis and trading decisions by utilizing two Relative Strength Index (RSI) indicators calculated over different time periods. Unlike traditional strategies that employ a single RSI and may signal premature or delayed entries, this method leverages the differential between a shorter and a longer RSI. This approach pinpoints more precise entry and exit points, providing a refined tool for traders to exploit market conditions effectively, particularly in overbought and oversold scenarios.
Most important: it is a good eductional code for swing trading.
For beginners, this Pine Script provides a complete function that includes crucial elements such as holding days and the option to configure take profit/stop loss settings:
- Hold Days: This feature ensures that trades are not exited too hastily, helping traders to ride out short-term market volatility. It's particularly valuable for swing trading where maintaining positions slightly longer can lead to capturing significant trends.
- TPSL Condition (None by default): This setting allows traders to focus solely on the strategy's robust entry and exit signals without being constrained by preset profit or loss limits. This flexibility is crucial for learning to adjust strategy settings based on personal risk tolerance and market observations.
BTCUSD 6h LS Performance
█ Strategy, How It Works: Detailed Explanation
🔶 RSI Calculation:
The RSI is a momentum oscillator that measures the speed and change of price movements. It is calculated using the formula:
RSI = 100 - (100 / (1 + RS))
Where RS (Relative Strength) = Average Gain of up periods / Average Loss of down periods.
🔶 Dual RSI Setup:
This strategy involves two RSI indicators:
RSI_Short (RSI_21): Calculated over a short period (21 days).
RSI_Long (RSI_42): Calculated over a longer period (42 days).
Differential Calculation:
The strategy focuses on the differential between these two RSIs:
RSI Differential = RSI_Long - RSI_Short
This differential helps to identify when the shorter-term sentiment diverges from longer-term trends, signaling potential trading opportunities.
BTCUSD Local picuture
🔶 Signal Triggers:
Entry Signal: A buy (long) signal is triggered when the RSI Differential exceeds -5, suggesting strengthening short-term momentum. Conversely, a sell (short) signal occurs when the RSI Differential falls below +5, indicating weakening short-term momentum.
Exit Signal: Trades are generally exited when the RSI Differential reverses past these thresholds, indicating a potential momentum shift.
█ Trade Direction
This strategy accommodates various trading preferences by allowing selections among long, short, or both directions, thus enabling traders to capitalize on diverse market movements and volatility.
█ Usage
The Dual RSI Differential Strategy is particularly suited for:
Traders who prefer a systematic approach to capture market trends.
Those who seek to minimize risks associated with rapid and unexpected market movements.
Traders who value strategies that can be finely tuned to different market conditions.
█ Default Settings
- Trading Direction: Both — allows capturing of upward and downward market movements.
- Short RSI Period: 21 days — balances sensitivity to market movements.
- Long RSI Period: 42 days — smoothens out longer-term fluctuations to provide a clearer market trend.
- RSI Difference Level: 5 — minimizes false signals by setting a moderate threshold for action.
Use Hold Days: True — introduces a temporal element to trading strategy, holding positions to potentially enhance outcomes.
- Hold Days: 5 — ensures that trades are not exited too hastily, helping to ride out short-term volatility.
- TPSL Condition: None — enables traders to focus solely on the strategy's entry and exit signals without preset profit or loss limits.
- Take Profit Percentage: 15% — aims for significant market moves to lock in profits.
- Stop Loss Percentage: 10% — safeguards against large losses, essential for long-term capital preservation.
Multi Timeframe RSI Buy Sell Strategy [TradeDots]The "Multi Timeframe RSI Buy/Sell Strategy" is a trading strategy that utilizes Relative Strength Index (RSI) indicators from multiple timeframes to provide buy and sell signals.
This strategy allows for extensive customization, supporting up to three distinct RSIs, each configurable with its own timeframe, length, and data source.
HOW DOES IT WORK
This strategy integrates up to three RSIs, each selectable from different timeframes and customizable in terms of length and source. Users have the flexibility to define the number of active RSIs. These selections visualize as plotted lines on the chart, enhancing interpretability.
Users can also manage the moving average of the selected RSI lines. When multiple RSIs are active, the moving average is calculated based on these active lines' average value.
The color intensity of the moving average line changes as it approaches predefined buying or selling thresholds, alerting users to potential signal generation.
A buy or sell signal is generated when all active RSI lines simultaneously cross their respective threshold lines. Concurrently, a label will appear on the chart to signify the order placement.
For those preferring not to display order information or activate the strategy, an "Enable backtest" option is provided in the settings for toggling activation.
APPLICATION
The strategy leverages multiple RSIs to detect extreme market conditions across various timeframes without the need for manual timeframe switching.
This feature is invaluable for identifying divergences across timeframes, such as detecting potential short-term reversals within broader trends, thereby aiding traders in making better trading decisions and potentially avoiding losses.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 60%
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
TradeDots Stochastic Z-Score
Stochastic Z-Score Oscillator Strategy [TradeDots]The "Stochastic Z-Score Oscillator Strategy" represents an enhanced approach to the original "Buy Sell Strategy With Z-Score" trading strategy. Our upgraded Stochastic model incorporates an additional Stochastic Oscillator layer on top of the Z-Score statistical metrics, which bolsters the affirmation of potential price reversals.
We also revised our exit strategy to when the Z-Score revert to a level of zero. This amendment gives a much smaller drawdown, resulting in a better win-rate compared to the original version.
HOW DOES IT WORK
The strategy operates by calculating the Z-Score of the closing price for each candlestick. This allows us to evaluate how significantly the current price deviates from its typical volatility level.
The strategy first takes the scope of a rolling window, adjusted to the user's preference. This window is used to compute both the standard deviation and mean value. With these values, the strategic model finalizes the Z-Score. This determination is accomplished by subtracting the mean from the closing price and dividing the resulting value by the standard deviation.
Following this, the Stochastic Oscillator is utilized to affirm the Z-Score overbought and oversold indicators. This indicator operates within a 0 to 100 range, so a base adjustment to match the Z-Score scale is required. Post Stochastic Oscillator calculation, we recalibrate the figure to lie within the -4 to 4 range.
Finally, we compute the average of both the Stochastic Oscillator and Z-Score, signaling overpriced or underpriced conditions when the set threshold of positive or negative is breached.
APPLICATION
Firstly, it is better to identify a stable trading pair for this technique, such as two stocks with considerable correlation. This is to ensure conformance with the statistical model's assumption of a normal Gaussian distribution model. The ideal performance is theoretically situated within a sideways market devoid of skewness.
Following pair selection, the user should refine the span of the rolling window. A broader window smoothens the mean, more accurately capturing long-term market trends, while potentially enhancing volatility. This refinement results in fewer, yet precise trading signals.
Finally, the user must settle on an optimal Z-Score threshold, which essentially dictates the timing for buy/sell actions when the Z-Score exceeds with thresholds. A positive threshold signifies the price veering away from its mean, triggering a sell signal. Conversely, a negative threshold denotes the price falling below its mean, illustrating an underpriced condition that prompts a buy signal.
Within a normal distribution, a Z-Score of 1 records about 68% of occurrences centered at the mean, while a Z-Score of 2 captures approximately 95% of occurrences.
The 'cool down period' is essentially the number of bars that await before the next signal generation. This feature is employed to dodge the occurrence of multiple signals in a short period.
DEFAULT SETUP
The following is the default setup on EURAUD 1h timeframe
Rolling Window: 80
Z-Score Threshold: 2.8
Signal Cool Down Period: 5
Stochastic Length: 14
Stochastic Smooth Period: 7
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 40%
FURTHER IMPLICATION
The Stochastic Oscillator imparts minimal impact on the current strategy. As such, it may be beneficial to adjust the weightings between the Z-Score and Stochastic Oscillator values or the scale of Stochastic Oscillator to test different performance outcomes.
Alternative momentum indicators such as Keltner Channels or RSI could also serve as robust confirmations of overbought and oversold signals when used for verification.
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
GM-8 and ADX Strategy with Second EMADescription:
This TradingView script implements a trading strategy based on the Moving Average (GM-8), the Average Directional Index (ADX), and the second Exponential Moving Average (EMA). The strategy utilizes these indicators to identify potential buy and sell signals on the chart.
Indicators:
GM-8 (Moving Average 8): This indicator calculates the average price of the last 8 periods and is used to identify trends.
ADX (Average Directional Index): The ADX measures the strength of a trend and is used to determine whether the market is moving in a particular direction or not.
Second EMA (Exponential Moving Average): This is an additional EMA line with a period of 59, which is used to provide additional confirmation signals for the trend.
Trading Conditions:
Buy Condition: A buy signal is generated when the closing price is above the GM-8 and the second EMA, and the ADX value is above the specified threshold.
Sell Condition: A sell signal is generated when the closing price is below the GM-8 and the second EMA, and the ADX value is above the specified threshold.
Trading Logic:
If a buy condition is met, a long position is opened with a user-defined lot size.
If a sell condition is met, a short position is opened with the same user-defined lot size.
Positions are closed when the opposite conditions are met.
User Parameters:
Users can adjust the periods for the GM-8, the second EMA, and the ADX, as well as the threshold for the ADX and the lot size according to their preferences.
Note:
This script has been developed for use on a $100,000 account with FTMO, therefore the account size is set to $100,000. Please ensure that the strategy parameters and settings meet the requirements of your trading strategy and carefully review the results before committing real capital.
--------------------------------------------------------------------------------------------------------------
Beschreibung:
Dieses TradingView-Skript implementiert eine Handelsstrategie, die auf dem gleitenden Mittelwert (GM-8), dem Average Directional Index (ADX) und der zweiten exponentiellen gleitenden Durchschnittslinie (EMA) basiert. Die Strategie verwendet diese Indikatoren, um potenzielle Kauf- und Verkaufssignale auf dem Chart zu identifizieren.
Indikatoren:
GM-8 (Gleitender Mittelwert 8): Dieser Indikator berechnet den Durchschnittspreis der letzten 8 Perioden und wird verwendet, um Trends zu identifizieren.
ADX (Average Directional Index): Der ADX misst die Stärke eines Trends und wird verwendet, um festzustellen, ob sich der Markt in eine bestimmte Richtung bewegt oder nicht.
Zweite EMA (Exponential Moving Average): Dies ist eine zusätzliche EMA-Linie mit einer Periode von 59, die verwendet wird, um zusätzliche Bestätigungssignale für den Trend zu liefern.
Handelsbedingungen:
Kaufbedingung: Es wird ein Kaufsignal generiert, wenn der Schlusskurs über dem GM-8 und der zweiten EMA liegt und der ADX-Wert über dem angegebenen Schwellenwert liegt.
Verkaufsbedingung: Es wird ein Verkaufssignal generiert, wenn der Schlusskurs unter dem GM-8 und der zweiten EMA liegt und der ADX-Wert über dem angegebenen Schwellenwert liegt.
Handelslogik:
Wenn eine Kaufbedingung erfüllt ist, wird eine Long-Position mit einer benutzerdefinierten Losgröße eröffnet.
Wenn eine Verkaufsbedingung erfüllt ist, wird eine Short-Position mit derselben benutzerdefinierten Losgröße eröffnet.
Positionen werden geschlossen, wenn die Gegenbedingungen erfüllt sind.
Benutzerparameter:
Benutzer können die Perioden für den GM-8, die zweite EMA und den ADX sowie den Schwellenwert für den ADX und die Losgröße nach ihren eigenen Präferenzen anpassen.
Hinweis:
Dieses Skript wurde für die Verwendung auf einem $100.000-Konto bei FTMO entwickelt, daher ist die Kontogröße auf $100.000 festgelegt. Bitte stellen Sie sicher, dass die Strategieparameter und -einstellungen den Anforderungen Ihrer Handelsstrategie entsprechen und dass Sie die Ergebnisse sorgfältig überprüfen, bevor Sie echtes Kapital einsetzen.
Fine-tune Inputs: Fourier Smoothed Volume zone oscillator WFSVZ0Use this Strategy to Fine-tune inputs for the (W&)FSVZ0 Indicator.
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.
I suggest using "Close all" input False when fine-tuning Inputs for 1 TimeFrame. When you export data to Excel/Numbers/GSheets I suggest using "Close all" input as True, except for the lowest TimeFrame.
MEANINGFUL DESCRIPTION:
The Volume Zone oscillator breaks up volume activity into positive and negative categories. It is positive when the current closing price is greater than the prior closing price and negative when it's lower than the prior closing price. The resulting curve plots through relative percentage levels that yield a series of buy and sell signals, depending on level and indicator direction.
The Wavelet & Fourier Smoothed Volume Zone Oscillator (W&)FSVZO is a refined version of the Volume Zone Oscillator, enhanced by the implementation of the Discrete Fourier Transform . Its primary function is to streamline price data and diminish market noise, thus offering a clearer and more precise reflection of price trends.
By combining the Wavalet and Fourier aproximation with Ehler's white noise histogram, users gain a comprehensive perspective on volume-related market conditions.
HOW TO USE THE INDICATOR:
The default period is 2 but can be adjusted after backtesting. (I suggest 5 VZO length and NoiceR max length 8 as-well)
The VZO points to a positive trend when it is rising above the 0% level, and a negative trend when it is falling below the 0% level. 0% level can be adjusted in setting by adjusting VzoDifference. Oscillations rising below 0% level or falling above 0% level result in a natural trend.
HOW TO USE THE STRATEGY:
Here you fine-tune the inputs until you find a combination that works well on all Timeframes you will use when creating your Automated Trade Algorithmic Strategy. I suggest 4h, 12h, 1D, 2D, 3D, 4D, 5D, 6D, W and M.
When I ndicator/Strategy returns 0 or natural trend , Strategy Closes All it's positions.
ORIGINALITY & USFULLNESS:
Personal combination of Fourier and Wavalet aproximation of a price which results in less noise Volume Zone Oscillator.
The Wavelet Transform is a powerful mathematical tool for signal analysis, particularly effective in analyzing signals with varying frequency or non-stationary characteristics. It dissects a signal into wavelets, small waves with varying frequency and limited duration, providing a multi-resolution analysis. This approach captures both frequency and location information, making it especially useful for detecting changes or anomalies in complex signals.
The Discrete Fourier Transform (DFT) is a mathematical technique that transforms discrete data from the time domain into its corresponding representation in the frequency domain. This process involves breaking down a signal into its individual frequency components, thereby exposing the amplitude and phase characteristics inherent in each frequency element.
This indicator utilizes the concept of Ehler's Universal Oscillator and displays a histogram, offering critical insights into the prevailing levels of market noise. The Ehler's Universal Oscillator is grounded in a statistical model that captures the erratic and unpredictable nature of market movements. Through the application of this principle, the histogram aids traders in pinpointing times when market volatility is either rising or subsiding.
DETAILED DESCRIPTION:
My detailed description of the indicator and use cases which I find very valuable.
What is oscillator?
Oscillators are chart indicators that can assist a trader in determining overbought or oversold conditions in ranging (non-trending) markets.
What is volume zone oscillator?
Price Zone Oscillator measures if the most recent closing price is above or below the preceding closing price.
Volume Zone Oscillator is Volume multiplied by the 1 or -1 depending on the difference of the preceding 2 close prices and smoothed with Exponential moving Average.
What does this mean?
If the VZO is above 0 and VZO is rising. We have a bullish trend. Most likely.
If the VZO is below 0 and VZO is falling. We have a bearish trend. Most likely.
Rising means that VZO on close is higher than the previous day.
Falling means that VZO on close is lower than the previous day.
What if VZO is falling above 0 line?
It means we have a high probability of a bearish trend.
Thus the indicator returns 0 and Strategy closes all it's positions when falling above 0 (or rising bellow 0) and we combine higher and lower timeframes to gauge the trend.
In the next Image you can see that trend is negative on 4h, negative on 12h and positive on 1D. That means trend is negative.
I am sorry, the chart is a bit messy. The idea is to use the indicator over more than 1 Timeframe.
What is approximation and smoothing?
They are mathematical concepts for making a discrete set of numbers a
continuous curved line.
Fourier and Wavelet approximation of a close price are taken from aprox library.
Key Features:
You can tailor the Indicator/Strategy to your preferences with adjustable parameters such as VZO length, noise reduction settings, and smoothing length.
Volume Zone Oscillator (VZO) shows market sentiment with the VZO, enhanced with Exponential Moving Average (EMA) smoothing for clearer trend identification.
Noise Reduction leverages Euler's White noise capabilities for effective noise reduction in the VZO, providing a cleaner and more accurate representation of market dynamics.
Choose between the traditional Fast Fourier Transform (FFT) , the innovative Double Discrete Fourier Transform (DTF32) and Wavelet soothed Fourier soothed price series to suit your analytical needs.
Image of Wavelet transform with FAST settings, Double Fourier transform with FAST settings. Improved noice reduction with SLOW settings, and standard FSVZO with SLOW settings:
Fast setting are setting by default:
VZO length = 2
NoiceR max Length = 2
Slow settings are:
VZO length = 5 or 7
NoiceR max Length = 8
As you can see fast setting are more volatile. I suggest averaging fast setting on 4h 12h 1d 2d 3d 4d W and M Timeframe to get a clear view on market trend.
What if I want long only when VZO is rising and above 15 not 0?
You have set Setting VzoDifference to 15. That reduces the number of trend changes.
Example of W&FSVZO with VzoDifference 15 than 0:
VZO crossed 0 line but not 15 line and that's why Indicator returns 0 in one case an 1 in another.
What is Smooth length setting?
A way of calculating Bullish or Bearish (W&)FSVZO .
If smooth length is 2 the trend is rising if:
rising = VZO > ta.ema(VZO, 2)
Meaning that we check if VZO is higher that exponential average of the last 2 elements.
If smooth length is 1 the trend is rising if:
rising = VZO_ > VZO_
Use this Strategy to fine-tune inputs for the (W&)FSVZO Indicator.
(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)
I suggest using " Close all " input False when fine-tuning Inputs for 1 TimeFrame . When you export data to Excel/Numbers/GSheets I suggest using " Close all " input as True , except for the lowest TimeFrame . I suggest using 100% equity as your default quantity for fine-tune purposes. I have to mention that 100% equity may lead to unrealistic backtesting results. Be avare. When backtesting for trading purposes use Contracts or USDT.
RSI Strategy with Manual TP and SL 19/03/2024This TradingView script implements a simple RSI (Relative Strength Index) strategy with manual take profit (TP) and stop-loss (SL) levels. Let's break down the script and analyze its components:
RSI Calculation: The script calculates the RSI using the specified length parameter. RSI is a momentum oscillator that measures the speed and change of price movements. It ranges from 0 to 100 and typically values above 70 indicate overbought conditions while values below 30 indicate oversold conditions.
Strategy Parameters:
length: Length of the RSI period.
overSold: Threshold for oversold condition.
overBought: Threshold for overbought condition.
trail_profit_pct: Percentage for trailing profit.
Entry Conditions:
For a long position: RSI crosses above 30 and the daily close is above 70% of the highest close in the last 50 bars.
For a short position: RSI crosses below 70 and the daily close is below 130% of the lowest close in the last 50 bars.
Entry Signals:
Long entry is signaled when both conditions for a long position are met.
Short entry is signaled when both conditions for a short position are met.
Manual TP and SL:
Take profit and stop-loss levels are calculated based on the entry price and the specified percentage.
For long positions, the take profit level is set above the entry price and the stop-loss level is set below the entry price.
For short positions, the take profit level is set below the entry price and the stop-loss level is set above the entry price.
Strategy Exits:
Exit conditions are defined for both long and short positions using the calculated take profit and stop-loss levels.
Chart Analysis:
This strategy aims to capitalize on short-term momentum shifts indicated by RSI crossings combined with daily price movements.
It utilizes manual TP and SL levels, providing traders with flexibility in managing their positions.
The strategy may perform well in ranging or oscillating markets where RSI signals are more reliable.
However, it may encounter challenges in trending markets where RSI can remain overbought or oversold for extended periods.
Traders should backtest this strategy thoroughly on historical data and consider optimizing parameters to suit different market conditions.
Risk management is crucial, so traders should carefully adjust TP and SL percentages based on their risk tolerance and market volatility.
Overall, this strategy provides a structured approach to trading based on RSI signals while allowing traders to customize their risk management. However, like any trading strategy, it should be used judiciously and in conjunction with other forms of analysis and risk management techniques.
NASDAQ 100 Peak Hours StrategyNASDAQ 100 Peak Hours Trading Strategy
Description
Our NASDAQ 100 Peak Hours Trading Strategy leverages a carefully designed algorithm to trade within specific hours of high market activity, particularly focusing on the first two hours of the trading session from 09:30 AM to 11:30 AM GMT-5. This period is identified for its increased volatility and liquidity, offering numerous trading opportunities.
The strategy incorporates a blend of technical indicators to identify entry and exit points for both long and short positions. These indicators include:
Exponential Moving Averages (EMAs) : A short-term 9-period EMA and a longer-term 21-period EMA to determine the market trend and momentum.
Relative Strength Index (RSI) : A 14-period RSI to gauge the market's momentum.
Average True Range (ATR) : A 14-period ATR to assess market volatility and to set dynamic stop losses and trailing stops.
Volume Weighted Average Price (VWAP) : To identify the market's average price weighted by volume, serving as a benchmark for the trading day.
Our strategy uniquely applies a volatility filter using the ATR, ensuring trades are only executed in conditions that favor our setup. Additionally, we consider the direction of the EMAs to confirm the market's trend before entering trades.
Originality and Usefulness
This strategy stands out by combining these indicators within the NASDAQ 100's peak hours, exploiting the specific market conditions that prevail during these times. The inclusion of a volatility filter and dynamic stop-loss mechanisms based on the ATR provides a robust method for managing risk.
By focusing on the early trading hours, the strategy aims to capture the initial market movements driven by overnight news and the opening rush, often characterized by higher volatility. This approach is particularly useful for traders looking to maximize gains from short-term fluctuations while limiting exposure to longer-term market uncertainty.
Strategy Results
To ensure the strategy's effectiveness and reliability, it has undergone rigorous backtesting over a significant dataset to produce a sample size of more than 100 trades. This testing phase helps in identifying the strategy's potential in various market conditions, its consistency, and its risk-to-reward ratio.
Our backtesting adheres to realistic trading conditions, accounting for slippage and commission to reflect actual trading scenarios accurately. The strategy is designed with a conservative approach to risk management, advising not to risk more than 5-10% of equity on a single trade. The default settings in the script align with these principles, ensuring that users can replicate our tested conditions.
Using the Strategy
The strategy is designed for simplicity and ease of use:
Trade Hours : Focuses on 09:30 AM to 11:30 AM GMT-5, during the NASDAQ 100's peak activity hours.
Entry Conditions : Trades are initiated based on the alignment of EMAs, RSI, VWAP, and the ATR's volatility filter within the designated time frame.
Exit Conditions : Includes dynamic trailing stops based on ATR, a predefined time exit strategy, and a trend reversal exit condition for risk management.
This script is a powerful tool for traders looking to leverage the NASDAQ 100's peak hours, providing a structured approach to navigating the early market hours with a robust set of criteria for making informed trading decisions.
Trend Deviation strategy - BTC [IkkeOmar]Intro:
This is an example if anyone needs a push to get started with making strategies in pine script. This is an example on BTC, obviously it isn't a good strategy, and I wouldn't share my own good strategies because of alpha decay.
This strategy integrates several technical indicators to determine market trends and potential trade setups. These indicators include:
Directional Movement Index (DMI)
Bollinger Bands (BB)
Schaff Trend Cycle (STC)
Moving Average Convergence Divergence (MACD)
Momentum Indicator
Aroon Indicator
Supertrend Indicator
Relative Strength Index (RSI)
Exponential Moving Average (EMA)
Volume Weighted Average Price (VWAP)
It's crucial for you guys to understand the strengths and weaknesses of each indicator and identify synergies between them to improve the strategy's effectiveness.
Indicator Settings:
DMI (Directional Movement Index):
Length: This parameter determines the number of bars used in calculating the DMI. A higher length may provide smoother results but might lag behind the actual price action.
Bollinger Bands:
Length: This parameter specifies the number of bars used to calculate the moving average for the Bollinger Bands. A longer length results in a smoother average but might lag behind the price action.
Multiplier: The multiplier determines the width of the Bollinger Bands. It scales the standard deviation of the price data. A higher multiplier leads to wider bands, indicating increased volatility, while a lower multiplier results in narrower bands, suggesting decreased volatility.
Schaff Trend Cycle (STC):
Length: This parameter defines the length of the STC calculation. A longer length may result in smoother but slower-moving signals.
Fast Length: Specifies the length of the fast moving average component in the STC calculation.
Slow Length: Specifies the length of the slow moving average component in the STC calculation.
MACD (Moving Average Convergence Divergence):
Fast Length: Determines the number of bars used to calculate the fast EMA (Exponential Moving Average) in the MACD.
Slow Length: Specifies the number of bars used to calculate the slow EMA in the MACD.
Signal Length: Defines the number of bars used to calculate the signal line, which is typically an EMA of the MACD line.
Momentum Indicator:
Length: This parameter sets the number of bars over which momentum is calculated. A longer length may provide smoother momentum readings but might lag behind significant price changes.
Aroon Indicator:
Length: Specifies the number of bars over which the Aroon indicator calculates its values. A longer length may result in smoother Aroon readings but might lag behind significant market movements.
Supertrend Indicator:
Trendline Length: Determines the length of the period used in the Supertrend calculation. A longer length results in a smoother trendline but might lag behind recent price changes.
Trendline Factor: Specifies the multiplier used in calculating the trendline. It affects the sensitivity of the indicator to price changes.
RSI (Relative Strength Index):
Length: This parameter sets the number of bars over which RSI calculates its values. A longer length may result in smoother RSI readings but might lag behind significant price changes.
EMA (Exponential Moving Average):
Fast EMA: Specifies the number of bars used to calculate the fast EMA. A shorter period results in a more responsive EMA to recent price changes.
Slow EMA: Determines the number of bars used to calculate the slow EMA. A longer period results in a smoother EMA but might lag behind recent price changes.
VWAP (Volume Weighted Average Price):
Default settings are typically used for VWAP calculations, which consider the volume traded at each price level over a specific period. This indicator provides insights into the average price weighted by trading volume.
backtest range and rules:
You can specify the start date for backtesting purposes.
You can can select the desired trade direction: Long, Short, or Both.
Entry and Exit Conditions:
LONG:
DMI Cross Up: The Directional Movement Index (DMI) indicates a bullish trend when the positive directional movement (+DI) crosses above the negative directional movement (-DI).
Bollinger Bands (BB): The price is below the upper Bollinger Band, indicating a potential reversal from the upper band.
Momentum Indicator: Momentum is positive, suggesting increasing buying pressure.
MACD (Moving Average Convergence Divergence): The MACD line is above the signal line, indicating bullish momentum.
Supertrend Indicator: The Supertrend indicator signals an uptrend.
Schaff Trend Cycle (STC): The STC indicates a bullish trend.
Aroon Indicator: The Aroon indicator signals a bullish trend or crossover.
When all these conditions are met simultaneously, the strategy considers it a favorable opportunity to enter a long trade.
SHORT:
DMI Cross Down: The Directional Movement Index (DMI) indicates a bearish trend when the negative directional movement (-DI) crosses above the positive directional movement (+DI).
Bollinger Bands (BB): The price is above the lower Bollinger Band, suggesting a potential reversal from the lower band.
Momentum Indicator: Momentum is negative, indicating increasing selling pressure.
MACD (Moving Average Convergence Divergence): The MACD line is below the signal line, signaling bearish momentum.
Supertrend Indicator: The Supertrend indicator signals a downtrend.
Schaff Trend Cycle (STC): The STC indicates a bearish trend.
Aroon Indicator: The Aroon indicator signals a bearish trend or crossover.
When all these conditions align, the strategy considers it an opportune moment to enter a short trade.
Disclaimer:
THIS ISN'T AN OPTIMAL STRATEGY AT ALL! It was just an old project from when I started learning pine script!
The backtest doesn't promise the same results in the future, always do both in-sample and out-of-sample testing when backtesting a strategy. And make sure you forward test it as well before implementing it!
Furthermore this strategy uses both trend and mean-reversion systems, that is usually a no-go if you want to build robust trend systems .
Don't hesitate to comment if you have any questions or if you have some good notes for a beginner.
How to force strategies fire exit alerts not reversalsPineScript has gone a long way, from very simple and little-capable scripting language to a robust coding platform with reliable execution endpoints. However, this one small intuitivity glitch is still there and is likely to stay, because it is traditionally justified and quite intuitive for significant group of traders. I'm sharing this workaround in response to frequent inquiries about it.
What's the glitch? When setting alerts on strategies to be synchronized with TradingView's Strategy Tester events, using simple alert messages such as "buy" or "sell" based on entry direction seems straightforward by inserting {{strategy.order.action}} into the Create Alert's "Message" field. Because "buy" or "sell" are exactly the strings produced by {{strategy.order.action}} placeholder. However, complications arise when attempting to EXIT positions without reversing, whether triggered by price levels like Stop Loss or Take Profit, or logical conditions to close trades. Those bricks fall apart, because on such events {{strategy.order.action}} sends the same "sell" for exiting buy positions and "buy" for exiting sell positions, instead of something more differentiating like "closebuy" or "closesell". As a result reversal trades are opened, instead of simply closing the open ones.
This convention harkens back to traditional stock market practices, where traders either bought shares to enter positions or sold them to exit. However, modern trading encompasses diverse instruments like CFDs, indices, and Forex, alongside advanced features such as Stop Loss, reshaping the landscape. Despite these advancements, the traditional nomenclature persists.
And is poised to stay on TradingView as well, so we need a workaround to get a simple strategy going. Luckily it is here and is called alert_message . It is a parameter, which needs to be added into each strategy.entry() / strategy.exit() / strategy.close() function call - each call, which causes Strategy Tester to produce entry or exit orders. As in this example script:
line 12: strategy.entry(... alert_message ="buy")
line 14: strategy.entry(... alert_message ="sell")
line 19: strategy.exit(... alert_message ="closebuy")
line 20: strategy.exit(... alert_message ="closesell")
line 24: strategy.close(... alert_message ="closebuy")
line 26: strategy.close(... alert_message ="closesell")
These alert messages are compatible with the Alerts Syntax of TradingConnector - a tool facilitating auto-execution of TradingView alerts in MetaTrader 4 or 5. Yes, simple alert messages like "buy" / "sell" / "closebuy" / "closesell" suffice to carry the execution of simple strategy, without complex JSON files with multiple ids and such. Other parameters can be added (actually plenty), but they are only option and that's not a part of this story :)
Last thing left to do is to replace "Message" in Create Alert popup with {{strategy.order.alert_message}} . This placeholder transmits the string defined in the PineScript alert_message= parameter, as outlined in this publication. With this workaround, executing closing alerts becomes seamless within PineScript strategies on TradingView.
Disclaimer: this content is purely educational, especially please don't pay attention to backtest results on any timeframe/ticker.