Uptrick: Imbalance MA Trailing System
### **Overview**
The "Uptrick: Imbalance MA Trailing System" is a complex trading indicator designed to help traders identify potential bullish and bearish imbalances in the market, coupled with a trailing stop mechanism to manage trades. The indicator uses a combination of moving averages, Average True Range (ATR), and custom logic to detect trading signals and plot various levels on the chart to assist traders in making informed decisions.
### **Key Components and Functionality**
#### 1. **Inputs and Configuration**
- **Imbalance Filter (`imbalanceFilter`)**: This input sets the filter for detecting imbalances based on the difference between two price points. The value is a float and can be adjusted to fine-tune the sensitivity of imbalance detection. The default value is `0.0`, with a step size of `0.1`.
- **Moving Average Settings (`maLength1`, `maLength2`, `maColor1`, `maColor2`)**:
- `maLength1` and `maLength2` define the lengths of the two moving averages used in the indicator. By default, they are set to `50` and `200` periods, respectively.
- `maColor1` and `maColor2` specify the colors of these moving averages on the chart. The first MA is colored blue, and the second is red.
- **Take Profit and Stop Loss Settings (`displayTP`, `tpMultiplier`, `tpColor`, `displaySL`, `slMultiplier`, `slColor`)**:
- `displayTP` and `displaySL` are boolean inputs that control whether the TP and SL areas are displayed on the chart.
- `tpMultiplier` and `slMultiplier` are multipliers used to calculate the TP and SL levels relative to the detected imbalance level using the ATR value.
- `tpColor` and `slColor` define the colors of these areas. The TP area is green (with a transparency of 50), and the SL area is red (with a transparency of 50).
- **Trailing Stop Settings (`trailMultiplier`)**: This setting determines the multiplier used to calculate the trailing stop level based on the ATR value. The default multiplier is `2.5`.
- **Style Settings (`bullishColor`, `bearishColor`)**:
- `bullishColor` and `bearishColor` set the colors for bullish and bearish zones created when an imbalance is detected. The bullish zone is green, and the bearish zone is red.
- **Signal Label Size (`labelSizeOption`)**: The size of the signal labels displayed on the chart can be adjusted. The options include `Tiny`, `Small`, `Normal`, `Large`, and `Huge`. The selected size affects the visual prominence of the labels.
#### 2. **ATR Calculation (`atrValue`)**
- The ATR value is calculated using a period of 14, which is a standard setting for measuring market volatility. This value is used extensively throughout the indicator to calculate TP, SL, and trailing stop levels.
#### 3. **Imbalance Detection and Zone Creation**
- The indicator detects potential imbalances in the market by comparing certain price points, using a custom function (`imbalanceCondition`).
- **Bullish Imbalance Detection (`bullishSignal`)**:
- A bullish imbalance is detected when the low of three bars ago is higher than the high of one bar ago, and the current close is above the low of three bars ago.
- Additional conditions include checking that the current close is above the calculated average of the two moving averages (`ma1` and `ma2`), and that the imbalance exceeds the threshold set by the `imbalanceFilter`.
- **Bearish Imbalance Detection (`bearishSignal`)**:
- A bearish imbalance is detected under conditions where the low of one bar ago is higher than the high of three bars ago, and the current close is below the high of three bars ago.
- Like the bullish signal, the close must also be below the average of the two moving averages, and the imbalance must exceed the `imbalanceFilter` threshold.
- Upon detection of an imbalance (either bullish or bearish), the indicator creates a zone using `box.new` that highlights the price range of the imbalance. The box color corresponds to the bullish or bearish nature of the signal.
- The center of the imbalance range is marked with a dashed line, and a corresponding label (`🔴` for bearish and `🟢` for bullish) is placed on the chart to indicate the detected signal.
#### 4. **Take Profit and Stop Loss Calculation (`calculateTPSL`)**
- When an imbalance is detected, the indicator calculates potential TP and SL levels based on the ATR value and the respective multipliers.
- If the TP or SL areas are enabled, the indicator plots these areas as colored boxes on the chart.
- The function also tracks whether these levels are hit by subsequent price action, updating the status (`reached`) as appropriate.
#### 5. **Trailing Stop Logic (`applyTrailingStop`)**
- The trailing stop feature is a dynamic mechanism that adjusts the stop level as the price moves in the trader's favor.
- The trailing stop is calculated using the ATR value multiplied by the `trailMultiplier`.
- If the trailing stop is triggered (i.e., the price crosses the trailing stop level), the indicator marks the trade as stopped out.
#### 6. **Plotting and Visualization**
- The indicator plots the two moving averages on the chart with the specified colors and line width.
- If a trailing stop is active, it plots the trailing stop level on the chart, updating as the stop moves.
- The bar color changes based on the status of the current signal and whether the trailing stop or TP/SL levels have been hit.
### **Detailed Execution Flow**
1. **Initialization**: The indicator initializes several variables, including lines, boxes, and the current signal state. This setup ensures that the script can dynamically update these elements as new price data comes in.
2. **Moving Average Calculation**: The moving averages (`ma1` and `ma2`) are calculated using simple moving average (SMA) functions, which are foundational for many of the indicator's conditions.
3. **Imbalance Detection**: The script evaluates price action to detect potential bullish or bearish imbalances, applying filters based on the user-defined `imbalanceFilter`.
4. **Zone Creation and Labeling**: Upon detecting an imbalance, the script creates visual zones on the chart using the `box.new` function and labels the zones for easy identification.
5. **Take Profit and Stop Loss Logic**: The TP and SL areas are calculated and plotted if the relevant settings are enabled. The script continuously checks if these levels are reached as new bars form.
6. **Trailing Stop Calculation**: The script dynamically adjusts the trailing stop level based on the price movement and ATR value. The trailing stop helps lock in profits as the trade progresses.
7. **Plotting**: The moving averages, trailing stop levels, and bar colors are plotted on the chart, providing a visual representation of the indicator's signals and trade management levels.
8. **Final Checks and Updates**: The script concludes each bar's processing by updating the status of various elements, such as whether levels have been reached or if the trailing stop has been triggered.
### **Conclusion**
The "Uptrick: Imbalance MA Trailing System" is a highly versatile indicator designed for traders who want to identify market imbalances and manage their trades effectively using a combination of moving averages, ATR-based calculations, and custom logic. The indicator offers a wide range of customization options, allowing traders to adjust the sensitivity of imbalance detection, the size of the signal labels, and the visibility of various trade management levels (TP, SL, and trailing stop).
The combination of these features makes it a powerful tool for both novice and experienced traders, providing clear visual cues and robust trade management capabilities directly on the chart.
Moving Averages
Lockin Strength Indicator (LSI)How It Works:
RSI Calculation: The standard RSI is calculated using a 14-period by default.
Volume Weighting: If enabled, the LSI modifies the RSI by weighting it based on the volume relative to its moving average. This emphasizes periods of high or low volume, which can be particularly useful for Solana-based assets that might have unique volume profiles.
Plotting: The LSI is plotted with standard overbought and oversold levels, and background highlighting makes these areas visually distinct.
Customization:
RSI Length: You can adjust the length of the RSI period.
Overbought/Oversold Levels: You can modify the levels for overbought and oversold signals.
Volume Weighting: You can toggle volume weighting on or off.
This indicator is designed to give you a more nuanced view of Solana cryptocurrencies by combining RSI with volume dynamics.
ChartArt-Bankniftybuying5minName: ChartArt-BankNifty Buying Strategy (5-Minute)
Timeframe: 5-Minute Candles
Asset: BankNifty (Indian Stock Market Index)
Trading Hours: 9:30 AM - 2:45 PM IST (Indian Standard Time)
This strategy is designed for BankNifty intraday traders who want to capitalize on short-term price movements within a defined trading window. It combines technical indicators like Simple Moving Averages (SMA), Relative Strength Index (RSI), and candlestick patterns to identify potential buy signals during intraday downtrends. The strategy employs specific entry, stop-loss, and target conditions to manage trades effectively and minimize risk.
Technical Indicators Used
Simple Moving Averages (SMA):
EMA7: 7-period SMA on closing price.
EMA5: 5-period SMA on closing price.
Purpose: Used to identify the intraday trend by comparing short-term moving averages. The strategy focuses on situations where the market is in a minor downtrend, indicated by EMA5 being below EMA7.
Relative Strength Index (RSI):
RSI14: 14-period RSI, a momentum oscillator that measures the speed and change of price movements.
SMA14: 14-period SMA of the RSI.
Purpose: RSI is used to identify potential reversal points. The strategy looks for situations where the RSI is below its own moving average, suggesting weakening momentum in the downtrend.
Candlestick Patterns:
Relaxed Hammer or Doji (2nd Candle): A pattern where the second candle in a 3-candle sequence shows a potential reversal signal (Hammer or Doji), indicating indecision or a potential turning point.
Bearish 1st Candle: The first candle is bearish, setting up the context for a potential reversal.
Bullish 3rd Candle: The third candle must be bullish with specific characteristics (closing near the high, surpassing the previous high), confirming the reversal.
Strategy Conditions
Time Condition:
The strategy is only active during specific hours (9:30 AM to 2:45 PM IST). This ensures that trades are only taken during the most liquid hours of the trading day, avoiding potential volatility or lack of liquidity towards market close.
Intraday Downtrend Condition:
EMA5 < EMA7: Indicates that the market is in a minor downtrend. The strategy looks for reversal opportunities within this trend.
RSI Condition:
RSI14 <= SMA14: Indicates that the current RSI value is below its 14-period SMA, suggesting potential weakening momentum, which can precede a reversal.
Candlestick Patterns:
1st Candle: Must be bearish, setting up the context for a potential reversal.
2nd Candle: Must either be a Hammer or Doji, indicating a potential reversal pattern.
3rd Candle: Must be bullish, with specific characteristics (closing near the high, breaking the previous high, etc.), confirming the reversal.
RSI Crossover Condition:
A crossover of the RSI over its SMA in the last 5 periods is also checked, adding further confirmation to the reversal signal.
Entry and Exit Rules
Entry Signal:
A buy signal is generated when all the conditions (time, intraday downtrend, bearish 1st candle, hammer/doji 2nd candle, bullish 3rd candle, and RSI condition) are met. The trade is entered at the high of the bullish third candle.
Stop Loss:
The stop loss is calculated based on the difference between the entry price and the low of the second candle. If this difference is greater than 90 points, the stop loss is placed at the midpoint of the second candle's range (average of high and low). Otherwise, it is placed at the low of the second candle.
Target 1:
The first target is set at 1.8 times the difference between the entry price and the stop loss. When this target is hit, half of the position is exited to lock in partial profits.
Target 2:
The second target is set at 3 times the difference between the entry price and the stop loss. The remaining position is exited at this point, or if the price hits the stop loss.
Originality and Usefulness
This strategy is original in its combination of multiple technical indicators and candlestick patterns to identify potential reversals in a specific intraday timeframe. By focusing on minor downtrends and utilizing a 3-candle reversal pattern, the strategy seeks to capture quick price movements with a structured approach to risk management.
Key Benefits:
High Precision: The strategy’s multi-step filtering process (time condition, trend confirmation, candlestick pattern analysis, and momentum evaluation via RSI) increases the likelihood of accurate trade signals.
Risk Management: The use of a dynamic stop-loss based on candle characteristics, combined with partial profit-taking, allows traders to lock in profits while still giving the trade room to develop further.
Structured Approach: The strategy provides a clear, rule-based system for entering and exiting trades, which can help remove emotional decision-making from the trading process.
Charts and Signals
The strategy produces signals in the form of labels on the chart:
Buy Signal: A green label is plotted below the candle that meets all entry conditions, indicating a potential buy opportunity.
Stop Loss (SL): A red dashed line is drawn at the stop-loss level with a label indicating "SL".
Target 1 (1st TG): A blue dashed line is drawn at the first target level with a label indicating "1st TG".
Target 2 (2nd TG): Another blue dashed line is drawn at the second target level with a label indicating "2nd TG".
These visual aids help traders quickly identify entry points, stop loss levels, and target levels on the chart, making the strategy easy to follow and implement.
Backtesting and Optimization
Backtesting: The strategy can be backtested on TradingView using historical data to evaluate its performance. Traders should consider testing across different market conditions to ensure the strategy's robustness.
Optimization: Parameters such as the RSI period, moving averages, and target multipliers can be optimized based on backtesting results to refine the strategy further.
Conclusion
The ChartArt-BankNifty Buying Strategy offers a well-rounded approach to intraday trading, focusing on capturing reversals in minor downtrends. With a strong emphasis on technical analysis, precise entry and exit rules, and robust risk management, this strategy provides a solid framework for traders looking to engage in intraday trading on BankNifty.
Close Price - EMA Percentage Difference
Title: Close Price - EMA Percentage Difference Indicator
Description:
The Close Price - EMA Percentage Difference Indicator is an essential tool designed to calculate and display the percentage difference between the closing price of a security and its Exponential Moving Average (EMA). This indicator is particularly useful for traders and analysts who want to understand how far the current price is from its EMA, providing insights into potential price trends and reversals.
Key Features:
Customizable EMA Period: Easily adjust the EMA period to match your trading strategy. Whether you're focusing on short-term trends with a 20-period EMA or analyzing long-term trends with a 200-period EMA, this indicator is flexible to suit your needs.
Percentage Difference Calculation: The indicator computes the percentage difference between the closing price and the selected EMA, allowing you to see how much the current price deviates from its moving average in percentage terms. This calculation helps in identifying potential buying or selling opportunities based on price movements relative to the EMA.
Zero Line Reference: A dotted red line at the zero level is included for quick visual reference. This line helps you instantly identify when the closing price is equal to the EMA, and whether the price is above or below the EMA.
Visual Representation: The percentage difference is plotted on a separate panel below the price chart, providing a clear and intuitive visualization that aids in decision-making.
How to Use:
Adjust the EMA period to fit your analysis or trading strategy.
Observe the percentage difference to understand the strength of the current price in relation to the EMA.
Use the zero line as a reference point to determine whether the price is above (positive values) or below (negative values) the EMA, which can help in identifying overbought or oversold conditions.
This indicator is suitable for all types of traders, from day traders to long-term investors, offering valuable insights into the price dynamics relative to the EMA.
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.
Raj - Mark Minervini Stage 2 with RSTitle: Mark Minervini Stage 2 Screener with Custom RS
Description:
This script is designed to identify stocks that meet the criteria for Mark Minervini's Stage 2 trend setup, incorporating custom relative strength (RS) ranking.
Key Features:
Moving Averages: Tracks the 50-day, 150-day, and 200-day Simple Moving Averages (SMA) to identify trend alignment.
Price Conditions: Ensures the stock price is above key moving averages, is within 25% of its 52-week high, and is at least 25% above its 52-week low.
Custom Relative Strength (RS): Compares the stock's performance against a benchmark (e.g., S&P 500) to ensure it has a strong relative strength. The RS is normalized on a 0-100 scale, and only stocks with an RS above 70 are highlighted.
Visual Indicators: The script plots moving averages on the chart and labels points where all conditions for the Stage 2 setup are met.
Usage:
Apply this script to your charts to find stocks that are in a strong uptrend and meet Mark Minervini's Stage 2 criteria.
Customize the benchmark symbol for the RS calculation to fit your market or preference
Custom EMA Multi-Timeframe Indicator [Pineify]
This innovative indicator combines Exponential Moving Averages (EMAs) across multiple timeframes to provide traders with a comprehensive view of market trends and potential trading opportunities. By analyzing short, medium, and long-term EMAs simultaneously, this indicator offers valuable insights into market dynamics and helps identify high-probability entry and exit points.
Key Features
Multi-timeframe analysis using customizable EMAs
Visual representation of trend alignment across different timeframes
Customizable EMA lengths and sources for each timeframe
Buy and sell signals based on EMA crossovers
Alert functionality for real-time trade notifications
How It Works
The Custom EMA Multi-Timeframe Indicator calculates three separate EMAs:
1. Short-term EMA: Represents immediate market sentiment
2. Medium-term EMA: Captures intermediate trend direction
3. Long-term EMA: Reflects the overall market trend
These EMAs are plotted on the chart using different colors for easy identification. The indicator generates buy and sell signals based on the relative positions of these EMAs, providing traders with clear visual cues for potential trade entries and exits.
Trading Ideas and Insights
This indicator offers several powerful trading concepts:
Trend Alignment: When all three EMAs are aligned (short above medium above long), it indicates a strong trend. Traders can look for pullbacks to enter in the direction of the trend.
Trend Reversal: When the short-term EMA crosses above or below both the medium and long-term EMAs, it may signal a potential trend reversal. This can be used to exit existing positions or enter new trades in the opposite direction.
Range-bound Markets: When the EMAs are tightly grouped together, it suggests a consolidation phase. Traders can wait for a breakout or use range-trading strategies.
Momentum Confirmation: The speed at which the short-term EMA diverges from or converges with the longer-term EMAs can indicate the strength of the current move.
Unique Aspects
What sets this indicator apart is its ability to synthesize information from multiple timeframes into a single, easy-to-interpret visual display. Unlike traditional single-timeframe EMAs, this indicator provides a more holistic view of market trends, reducing false signals and improving trade timing.
The customizable nature of the indicator allows traders to adapt it to various trading styles and market conditions. By adjusting the EMA lengths and sources, traders can fine-tune the indicator to their specific needs and preferences.
How to Use
1. Apply the indicator to your chart
2. Customize the timeframes and EMA settings as desired
3. Look for buy signals when the short and medium EMAs cross above the long EMA
4. Look for sell signals when the short and medium EMAs cross below the long EMA
5. Use the relative positions of the EMAs to gauge overall trend strength and direction
6. Combine with other technical analysis tools for confirmation
Customization
The indicator offers extensive customization options:
Short, medium, and long timeframes can be adjusted
EMA lengths for each timeframe are customizable
EMA source (close, open, high, low, etc.) can be selected for each timeframe
Colors and line styles can be modified to suit personal preferences
Alert settings can be configured for automated trade notifications
Conclusion
The Custom EMA Multi-Timeframe Indicator is a powerful tool for traders seeking to gain a comprehensive understanding of market trends across different time horizons. By combining multiple EMAs and timeframes, it provides a unique perspective on market dynamics, helping traders make more informed decisions and potentially improve their trading results.
Whether you're a day trader looking for short-term opportunities or a swing trader focusing on longer-term trends, this indicator offers valuable insights that can enhance your trading strategy. Its flexibility and customization options make it suitable for a wide range of trading styles and market conditions.
Remember: While this indicator can be a valuable tool in your trading arsenal, it should not be used in isolation. Always combine it with other forms
Uptrick: EMA Trend Indicator
### Overview
The goal of this script is to visually indicate on a trading chart whether all three Exponential Moving Averages (EMAs) are trending upwards (i.e., their slopes are positive). If all EMAs are trending upwards, the script will color the bars green. If not, the bars will be colored red.
### Key Concepts
1. **Exponential Moving Average (EMA)**: An EMA is a type of moving average that places more weight on recent data, making it more responsive to price changes compared to a simple moving average (SMA). In this script, we use three different EMAs with different lengths (20, 50, and 200 periods).
2. **Slope of an EMA**: The slope of an EMA refers to the direction in which the EMA is moving. If the current value of the EMA is higher than its value in the previous bar, the slope is positive (upward). Conversely, if the current value is lower than its previous value, the slope is negative (downward).
3. **Bar Color Coding**: The script changes the color of the bars on the chart to provide a visual cue:
- **Green Bars**: Indicate that all three EMAs are trending upwards.
- **Red Bars**: Indicate that one or more EMAs are not trending upwards.
### Detailed Breakdown
#### 1. Input Fields
- **EMA Lengths**: The script starts by allowing the user to input the lengths for the three EMAs. These lengths determine how many periods (e.g., days) are used to calculate each EMA.
- `ema20_length` is set to 20, meaning the first EMA uses the last 20 bars of data.
- `ema50_length` is set to 50, meaning the second EMA uses the last 50 bars of data.
- `ema200_length` is set to 200, meaning the third EMA uses the last 200 bars of data.
#### 2. EMA Calculation
- The script calculates the values of the three EMAs:
- **EMA 20**: This is calculated using the last 20 bars of closing prices.
- **EMA 50**: This is calculated using the last 50 bars of closing prices.
- **EMA 200**: This is calculated using the last 200 bars of closing prices.
These calculations result in three values for each bar on the chart, each representing the EMA value at that point in time.
#### 3. Determining EMA Slopes
- **EMA Slopes**: To understand the trend of each EMA, the script compares the current value of each EMA to its value in the previous bar:
- For the 20-period EMA, the script checks if today’s EMA value is higher than yesterday’s EMA value.
- This process is repeated for the 50-period and 200-period EMAs.
- If today’s EMA value is greater than yesterday’s value, the slope is positive (upward).
- If today’s EMA value is not greater (it is either equal to or less than yesterday’s value), the slope is not positive.
#### 4. Evaluating All Slopes
- **All Slopes Positive Condition**: The script combines the results of the individual slope checks into a single condition. It uses a logical "AND" operation:
- The condition will be `true` only if all three EMAs (20, 50, and 200) have positive slopes.
- If any one of the EMAs does not have a positive slope, the condition will be `false`.
#### 5. Coloring the Bars
- **Bar Coloring Logic**: Based on the above condition, the script decides the color of each bar on the chart:
- If all slopes are positive (condition is `true`), the bar is colored green.
- If any slope is not positive (condition is `false`), the bar is colored red.
- **Visual Cue**: This provides a quick, visual indication to traders:
- Green bars suggest that the market is in an upward trend across all three EMAs, which might indicate a strong bullish trend.
- Red bars suggest that the trend is not uniformly upward, which could be a sign of weakening momentum or a potential reversal.
#### 6. Alerts
- **Alert Conditions**: The script also allows for alert conditions to be set based on the slope analysis:
- An alert can be triggered when all EMA slopes are positive. This might be useful for traders who want to be notified when the market shows strong upward momentum.
### Summary
- The script essentially takes the market data and applies three different EMAs to it, each with a different time frame.
- It then checks the direction (slope) of each of these EMAs to determine if they are all trending upwards.
- If they are, the script colors the bar green, signaling a potentially strong bullish trend.
- If any of the EMAs is not trending upwards, it colors the bar red, indicating a potential issue with the strength of the trend.
This approach helps traders quickly assess market conditions based on multiple EMAs, providing a clearer picture of the overall trend across different time frames.
Buy and Sell Alerts using VWAPThis is my first script, which I hope you'll enjoy.
The script generates alerts for buy and sell trades using VWAP and volume threshold that you select.
Indicators and Moving Averages :
This script allows you to choose which moving averages like VWAP, 9EMA, 10, 20, 50, 100, 200, and 325 SMAs you want to see on your chart.
Volume Threshold :
You can set a volume threshold, which is the minimum required volume required for buy and sell signals to be considered valid. (For example, I like 60,000 on SPY, 5 minute chart.)
Buy and Sell Signals :
The script checks if the stock prices crosses above or below the VWAP and if the trading volume is above the threshold you set.
If the price crosses above the VWAP and the volume is sufficient, a "Buy" signal is generated.
If the price crosses below the VWAP and the volume is sufficient, a "Sell" signal is generated.
This hopefully user-friendly indicator will alert you when certain conditions trading conditions are met, helping to make it a little easier to make informed trading decisions.
Negroni Opening Range StrategyStrategy Summary:
This tool can be used to help identify breakouts from a range during a time-zone of your choosing. It plots a pre-market range, an opening range, it also includes moving average levels that can be used as confluence, as well as plotting previous day SESSION highs and lows.
There are several options on how you wish to close out the trades, all described in more detail below.
Back-testing Inputs:
You define your timezone.
You define how many trades to open on any given day.
You decide to go: long only, short only, or long & short (CAREFUL: "Long & Short" can open trades that effectively closes-out existing ones, for better AND worse!)
You define between which times the strategy will open trades.
You define when it closes any open trades (preventing overnight trades, or leaving trades open into US data times!!).
This hopefully helps make back-testing reflect YOUR trading hours.
NOTE: Renko or Heikin-Ashi charts
For ALL strategies, don’t use Renko or Heikin-Ashi charts unless you know EXACTLY the implications.
Specific to my strategy, using a renko chart can make this 85-90% profitable (I wish it was!!) Although they can be useful, renko charts don’t always capture real wicks, so the renko chart may show your trade up-only but your broker (who is not using renko!!) will have likely stopped you out on a wick somewhere along the line.
NOTE: TradingView ‘Deep backtesting’
For ALL strategies, be cynical of all backtesting (e.g. repainting issues etc) as well as ‘Deep backtesting’ results.
Specific to this strategy, the default settings here SHOULD BE OK, but unfortunately at the time of writing, we can’t see on the chart what exactly ‘deep backtesting’ is calculating. In the past I have noted a number of trades that were not closed at the end of the day, despite my ‘end of day’ trade closing being enabled, so there were big winners and losers that would not have materialized otherwise. As I say, this seems ok at these settings but just always be cynical!!
Opening Range Inputs
You define a pre-market range (example: 08:00 - 09:00).
You define an opening range (example: 09:00 - 09:30).
The strategy will give an update at the close of the opening range to let you know if the opening range has broken out the pre-market range (OR Breakout), or if it has remained inside (OR Inside). The label appears at the end of the opening range NOT at the bar that ‘broke-out’.
This is just a visual cue for you, it has no bearing on what the strategy will do.
The strategy default will trade off the pre-market range, but you can untick this if you prefer to trade off the opening range.
Opening Trades:
Strategy goes long when the bar (CLOSE) crosses-over the ‘pre-market’ high (not the ‘opening range’ high); and the time is within your trading session, and you have not maxed out your number of trades for the day!
Strategy goes short when the bar (CLOSE) crosses-under the ‘pre-market’ low (not the ‘opening range low); and the time is within your trading session, and you have not maxed out your number of trades for the day!
Remember, you can untick this if you prefer to trade off the opening range instead.
NOTES:
Using momentum indicators can help (RSI and MACD): especially to trade range plays in failed breakouts, when momentum shifts… but the strategy won’t do this for you!
Using an anchored vwap at the session open can also provide nice confluence, as well as take-profit levels at the upper/lower of 3x standard deviation.
CLOSING TRADES:
You have 6 take-profit (TP) options:
1) Full TP: uses ATR Multiplier - Full TP at the ATR parameters as defined in inputs.
2) Take Partial profits: ATR Multiplier - Takes partial profits based on parameters as defined in inputs (i.e close 40% of original trade at TP1, close another 40% of original trade at TP2, then the remainder at Full TP as set in option 1.).
3) Full TP: Trailing Stop - Applies a Trailing Stop at the number of points, as defined in inputs.
4) Full TP: MA cross - Takes profit when price crosses ‘Trend MA’ as defined in inputs.
5) Scalp: Points - closes at a set number of points, as defined in inputs.
6) Full TP: PMKT Multiplier - places a SL at opposite pre-market Hi/Low (we go long at a break-out of the pre-market high, 50% would place a SL at the pre-market range mid-point; 100% would place a SL at the pre-market low)'. This takes profit at the input set in option 1).
Multi-Timeframe EMA Distance & % Change TableDescription of Multi-Timeframe EMA Distance & % Change Table
The Multi-Timeframe EMA Distance & % Change Table indicator is designed to display the distance and percentage change between the current price and the Exponential Moving Averages (EMAs) on multiple timeframes. It creates a table to show these values, with customizable options for decimal precision .
Key Features:
Inputs:
- Timeframes (tf1, tf2, tf3, tf4): User-defined timeframes for EMA calculations (e.g., 1 minute, 15 minutes, daily, etc.).
- EMA Levels (emaLevel, emaLevel2, emaLevel3): User-defined periods for three different EMAs.
EMA Calculations:
- Computes EMAs for the specified levels (50, 100, 200) on each of the user-selected timeframes.
Plotting:
- Plots the EMAs on the chart with distinct colors: Orange, Teal, and Green for different EMAs.
Display Options:
- Checkbox (displayAsPercentage): Allows the user to toggle between displaying distances or percentage changes.
- Decimal Precision:
- decimalPlacesDistance: Specifies the number of decimal places for rounded distance values.
- decimalPlacesPercentage: Specifies the number of decimal places for rounded percentage values.
Table Creation:
- Location: Table is placed in the top-right corner of the chart.
- Headers: Includes columns for each timeframe and EMA distance/percentage.
Distance and Percentage Calculations:
- Distances: Calculated as the difference between the current price and the EMA values for each timeframe.
- Percentages: Calculated as the distance divided by the EMA value, converted to a percentage.
Decimal Rounding:
- Custom Rounding Function: Ensures that distance and percentage values are displayed with the user-specified number of decimal places.
Color Coding:
- Distance Values: Colored green if positive, red if negative.
- Table Entries: Display either the rounded distance or percentage, based on user selection.
Table Update:
- The table is dynamically updated with either distance or percentage values based on the user's choice and rounded to the specified number of decimal places.
This indicator provides a comprehensive overview of EMA distances and percentage changes across multiple timeframes, with detailed control over the precision of the displayed values.
Bollinger Band + Mid BandBollinger Band + Mid Band
This indicator combines the classic Bollinger Bands with enhanced customization options, allowing traders to fine-tune the settings according to their specific strategies.
Key Features:
Moving Average Flexibility: Choose between Simple Moving Average (SMA), Exponential Moving Average (EMA), or Weighted Moving Average (WMA) as the central basis for the Bollinger Bands. This flexibility allows you to align the indicator with your preferred method of trend analysis.
Dual Band Deviation: The indicator includes two sets of upper and lower bands based on different standard deviation multipliers. This helps you analyze both the tightness of price action and potential breakout zones.
Customizable Colors: The mid-band, upper bands, and lower bands can be fully customized in terms of color, allowing you to personalize the visual representation of the indicator on your charts.
Dynamic Transparency: The space between the outer Bollinger Bands can be filled with a customizable transparent color, making it easy to visualize price movements within the bands.
Alerts for Crossovers: Alerts are triggered whenever the price crosses above the upper band or below the lower band, giving you timely notifications of potential breakout or breakdown scenarios.
Overbought/Oversold Visualization: The background of the chart changes color when the price crosses above the upper band (indicating overbought conditions) or below the lower band (indicating oversold conditions), providing a visual cue to help you identify market extremes.
Labeling for Significant Events: Labels appear on the chart whenever the price crosses the upper or lower bands, helping you quickly identify key moments for further analysis.
This script is designed for traders who want to leverage Bollinger Bands in their technical analysis but require additional flexibility and customization options. Whether you're using it for trend analysis, volatility assessment, or identifying overbought and oversold conditions, this tool can be tailored to fit a wide variety of trading styles.
Usage:
Ideal for traders looking to enhance the standard Bollinger Bands with more dynamic and customizable features.
Suitable for any market, including stocks, forex, and cryptocurrencies.
Useful in identifying volatility squeezes, breakouts, and potential reversal points.
EMAs for D W M TimeframesEMAs for D W M Timeframes
Description:
The “EMAs for D W M Timeframes” indicator allows users to set specific Exponential Moving Averages (EMAs) for Daily, Weekly, and Monthly timeframes. The script utilizes these user-defined EMA settings based on the chart’s current timeframe, ensuring that the appropriate EMAs are always displayed.
Please note that for timeframes other than specified, it defaults to daily EMA values.
EMA : The Exponential Moving Average (EMA) is a type of moving average that places greater weight and significance on the most recent data points. This makes the EMA more responsive to recent price changes compared to a simple moving average (SMA), making it a popular tool for identifying trends in financial markets.
Features:
Daily and Default EMAs: Users can specify two EMAs for the Daily timeframe, which also act as the default EMAs for any unspecified timeframe. The default values are set to 10 and 20.
Weekly EMAs: For Weekly charts, the indicator plots two EMAs with default values of 10 and 30. These EMAs help in tracking medium-term trends.
Monthly EMAs: On Monthly charts, the indicator plots EMAs with default values of 5 and 10, providing insights into long-term trends.
Timeframe-Based Display: The indicator automatically uses the EMA settings corresponding to the current chart’s timeframe, whether it is Daily, Weekly, or Monthly.
If the chart is set to any other timeframe, the Daily EMA settings are used by default.
How to Use:
Inputs:
* Daily and Default EMA 1 & 2: Adjust the values for the short-term and long-term EMAs on the Daily chart, which are also used for any other unspecified timeframe.
* Weekly EMA 1 & 2: Set the values for the EMAs that will be shown on Weekly charts.
* Monthly EMA 1 & 2: Specify the values for the EMAs to be displayed on Monthly charts.
Visualization:
* Depending on the current chart timeframe, the script will automatically display the relevant EMAs.
Default Values:
* Daily and Default EMAs: 10 (EMA 1), 20 (EMA 2)
* Weekly EMAs: 10 (EMA 1), 30 (EMA 2)
* Monthly EMAs: 5 (EMA 1), 10 (EMA 2)
This indicator is designed for users who want to monitor EMAs across different timeframes, using specific settings for Daily, Weekly, and Monthly charts.
Curious Buy - Sell Indicator - Institutional Zones (Smart Money)How the Script Works:
1. The Scripts identifies Institutional Demand , Supply & Neutral Zones with FIBS on the scripts with Rectangle BOX with labels in advance. User can insert desired start and end value to plot institutional zones
2. Script generates BUY - SELL signals shape based on candle stick formation in live market and labels with BUY - SELL image for easy identification
3. Script gives pop message EXIT SHORT once Buy spotted and candle close above the buy signal and same way EXIT LONG once Sell spotted and candle close below the buy signal
4. Scripts identifies the candle closing above the BUY - SELL signals Eg - If buy spotted the candle closing above the BUY signal with display with BLUE color Candle same way for sell signal the candle closing below the sell signal candle with display with BLACK color candle.
5. Script spots fake signals which are not valid and can be ignored by the end user
6. Three EMA's 20,50,200 has implemented to identify the strength of the market
7. Scripts identifies OPEN = LOW & OPEN = HIGH candle stick to spot the Institutional BUY - SELL activity
8. The script provides visual clues on the chart to help users identify potential trading opportunities.
9. The script provides visual clues on the chart to help users identity potential trading opportunities in live market
10. The looks and parameters of the script can be modified by end user to customize and adapt to different strategy.
11. With the script user can check higher time frame DAILY \ WEEKLY BUY - SELL signals to plan intraday trades and plan safe BUY - SELL positions.
How Users Can Make Profit Using This Script:
1. Identify potential BUY - LONG opportunities: When a valid BUY is detected and condition is met, it is suggested to opening BUY position with stoploss below the BUY signal spotted candle.
Safe users can execute BUY position once BLUE COLOR candle is formed, Wait for pull back to reduce the stoploss
2. Identify potential SELL - SHORT opportunities: When a valid SELL is detected and condition is met, it suggests a potential opening SELL positions with stoploss above the BUY signal spotted candle. Safe users can execute SELL position once BLACK COLOR candle is formed, Wait for pull back to reduce the stoploss.
3. Script generated BUY - SELL signal met target with the Institutional zone. Eg if BUY spotted at demand zone target will be neutral zone & Supply zone.
4. Script designed for user to spot high probability trades when BUY SIGNAL SPOTTED at the Institutional Demand zone same way SELL SIGNAL SPOTTED AT INSTITUTIONAL supply zone.
5. Combine with additional analysis: Users can utilize this script as a tool in their overall trading strategy. They can combine the signals with fundament analysis , market sentiment to make more informed trading decision
6.Set risk management measures: It is important for users to implement proper risk management strategies when trading based on the scripts signals. To avoid potential losses user once spotted BUY - SELL execute the long or short position. Ensure to place the stoploss to avoid potential losses and place the target. Once your trade is moving in your favor
can trial your stoploss to cost and protect the profits.
Timeframe WatermarkA small indicator designed for the minimalist chartist which prints the timeframe on your chart. The color of the text is based on whether the currency is trending (using the 8 and 21 EMAs) in that timeframe. Trending here is simply defined as the direction in which the 8 is above or below the 21. When used in a multi-timeframe layout, this indicator lets you easily scan multiple charts to see if they are trending across multiple timeframes by looking at the color of each chart's timeframe stamp.
This is designed to be used in a multi-timeframe window layout to efficiently and minimally present trending information across multiple timeframes.
Features:
adjustable colors
adjustable text position within the chart (top left/middle/right, bottom left/middle/right)
Altcoin Total Average Divergence (YavuzAkbay)The "Average Price and Divergence" indicator is a strong tool built exclusively for cryptocurrency traders who understand the significance of comparing altcoins to Bitcoin (BTC). While traditional research frequently focusses on the value of cryptocurrencies against fiat currencies such as the US dollar, this indicator switches the focus to the value of altcoins against Bitcoin itself, allowing you to detect potential market opportunities and divergences.
The indicator allows you to compare the price of an altcoin to Bitcoin (e.g., ETHBTC, SOLBTC), which is critical for determining how well an altcoin performs against the main cryptocurrency. This is especially important for investors who expect Bitcoin's price will continue to rise logarithmically and want to ensure that their altcoin holdings retain or expand in market capitalisation compared to Bitcoin.
The indicator computes the average price of the chosen cryptocurrency relative to Bitcoin over the viewable portion of the chart. This average acts as a benchmark, indicating the normal value around which the altcoin's price moves.
The primary objective of this indicator is to calculate and plot the divergence, which is the difference between the altcoin's current price relative to Bitcoin and its average value. This divergence can reveal probable overbought or oversold conditions, allowing traders to make better decisions about entry and exit points.
The divergence is represented as a histogram, with bars representing the magnitude of the difference between the current and average prices. Positive values indicate that the altcoin is trading above its average value in comparison to Bitcoin, whereas negative values indicate that it is trading below its average.
The indicator automatically adjusts to the chart's visible range, ensuring that the average price and divergence are always calculated using the most relevant data. This makes the indicator extremely sensitive to changes in the chart view and market conditions.
How to Use:
A significant positive divergence may imply that the cryptocurrency is overbought in comparison to Bitcoin and is headed for a correction. A significant negative divergence, on the other hand, may indicate that the cryptocurrency has been oversold and is cheap in comparison to Bitcoin.
Tracking how an altcoin's price deviates from its average relative to Bitcoin can provide insights about the market's opinion towards that altcoin. Persistent positive divergence may suggest high market confidence, whilst constant negative divergence may imply a lack of interest or eroding fundamentals.
Use divergence data to better time your trades, either by entering when a cryptocurrency is discounted in comparison to its average (negative divergence) or departing when it is overpriced (positive divergence). This allows you to capture value as the price returns to its mean.
Ideal For:
Cryptocurrency Traders who want to understand how altcoins are performing relative to Bitcoin rather than just against fiat currencies.
Long-term Investors looking to ensure their altcoin investments are maintaining or growing their value relative to Bitcoin.
Market Analysts interested in identifying potential reversals or continuations in altcoin prices based on divergence from their average value relative to Bitcoin.
Fear/Greed Zone Reversals [UAlgo]The "Fear/Greed Zone Reversals " indicator is a custom technical analysis tool designed for TradingView, aimed at identifying potential reversal points in the market based on sentiment zones characterized by fear and greed. This indicator utilizes a combination of moving averages, standard deviations, and price action to detect when the market transitions from extreme fear to greed or vice versa. By identifying these critical turning points, traders can gain insights into potential buy or sell opportunities.
🔶 Key Features
Customizable Moving Averages: The indicator allows users to select from various types of moving averages (SMA, EMA, WMA, VWMA, HMA) for both fear and greed zone calculations, enabling flexible adaptation to different trading strategies.
Fear Zone Settings:
Fear Source: Select the price data point (e.g., close, high, low) used for Fear Zone calculations.
Fear Period: This defines the lookback window for calculating the Fear Zone deviation.
Fear Stdev Period: This sets the period used to calculate the standard deviation of the Fear Zone deviation.
Greed Zone Settings:
Greed Source: Select the price data point (e.g., close, high, low) used for Greed Zone calculations.
Greed Period: This defines the lookback window for calculating the Greed Zone deviation.
Greed Stdev Period: This sets the period used to calculate the standard deviation of the Greed Zone deviation.
Alert Conditions: Integrated alert conditions notify traders in real-time when a reversal in the fear or greed zone is detected, allowing for timely decision-making.
🔶 Interpreting Indicator
Greed Zone: A Greed Zone is highlighted when the price deviates significantly above the chosen moving average. This suggests market sentiment might be leaning towards greed, potentially indicating a selling opportunity.
Fear Zone Reversal: A Fear Zone is highlighted when the price deviates significantly below the chosen moving average of the selected price source. This suggests market sentiment might be leaning towards fear, potentially indicating a buying opportunity. When the indicator identifies a reversal from a fear zone, it suggests that the market is transitioning from a period of intense selling pressure to a more neutral or potentially bullish state. This is typically indicated by an upward arrow (▲) on the chart, signaling a potential buy opportunity. The fear zone is characterized by high price volatility and overselling, making it a crucial point for traders to consider entering the market.
Greed Zone Reversal: Conversely, a Greed Zone is highlighted when the price deviates significantly above the chosen moving average. This suggests market sentiment might be leaning towards greed, potentially indicating a selling opportunity. When the indicator detects a reversal from a greed zone, it indicates that the market may be moving from an overbought condition back to a more neutral or bearish state. This is marked by a downward arrow (▼) on the chart, suggesting a potential sell opportunity. The greed zone is often associated with overconfidence and high buying activity, which can precede a market correction.
🔶 Why offer multiple moving average types?
By providing various moving average types (SMA, EMA, WMA, VWMA, HMA) , the indicator offers greater flexibility for traders to tailor the indicator to their specific trading strategies and market preferences. Different moving averages react differently to price data and can produce varying signals.
SMA (Simple Moving Average): Provides an equal weighting to all data points within the specified period.
EMA (Exponential Moving Average): Gives more weight to recent data points, making it more responsive to price changes.
WMA (Weighted Moving Average): Allows for custom weighting of data points, providing more flexibility in the calculation.
VWMA (Volume Weighted Moving Average): Considers both price and volume data, giving more weight to periods with higher trading volume.
HMA (Hull Moving Average): A combination of weighted moving averages designed to reduce lag and provide a smoother curve.
Offering multiple options allows traders to:
Experiment: Traders can try different moving averages to see which one produces the most accurate signals for their specific market.
Adapt to different market conditions: Different market conditions may require different moving average types. For example, a fast-moving market might benefit from a faster moving average like an EMA, while a slower-moving market might be better suited to a slower moving average like an SMA.
Personalize: Traders can choose the moving average that best aligns with their personal trading style and risk tolerance.
In essence, providing a variety of moving average types empowers traders to create a more personalized and effective trading experience.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
[TR] Engulf Patterns by SM
Engulf Pattern by SM
Overview:
The " Engulf Pattern by SM" script is designed to identify bullish and bearish engulfing candlestick patterns on TradingView charts. Engulfing patterns are significant in technical analysis as they often indicate potential reversals in market trends.
Features:
- Bullish Engulfing Pattern Detection: The script identifies bullish engulfing patterns, which occur when a larger bullish candle completely engulfs the body of the previous smaller bearish candle.
- Bearish Engulfing Pattern Detection: Similarly, it detects bearish engulfing patterns, where a larger bearish candle engulfs the body of the preceding smaller bullish candle.
- Body Size Filtering: The script includes a feature to filter patterns based on the size of the candle bodies, allowing for more precise marking of significant patterns.
- Visual Markers: The script plots visual markers on the chart to highlight the detected engulfing patterns, making it easy for traders to spot them.
How It Works:
1. Bullish Engulfing Pattern:
- The script checks for a smaller bearish candle followed by a larger bullish candle.
- The body of the bullish candle must completely cover the body of the bearish candle.
- The size of the bullish candle's body must meet a specified threshold to be considered significant.
2. Bearish Engulfing Pattern:
- The script looks for a smaller bullish candle followed by a larger bearish candle.
- The body of the bearish candle must completely engulf the body of the bullish candle.
- The size of the bearish candle's body must meet a specified threshold to be considered significant.
Usage:
- Add the Script: Apply the " Engulf Pattern by SM" script to your TradingView chart.
- Configure Settings: Customize the script settings to suit your trading strategy, including visual marker styles and body size thresholds.
- Monitor Visual Markers: Keep an eye on the visual markers to identify potential trading opportunities based on engulfing patterns.
Disclaimer:
This script is not intended to be used as a direct entry signal. It should be used as a confluence in your overall trading plan. Always conduct your own analysis and consider multiple factors before making any trading decisions.
Feel free to customize this writeup further to match your specific needs! If you have any other requests or need additional details, just let me know.
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
MACD Divergence StrategyStrategy Description: MACD Divergence with SMA Crossover Strategy
Overview:
The MACD Divergence with SMA Crossover Strategy is designed to identify high-probability trading opportunities based on the interaction of the MACD (Moving Average Convergence Divergence) indicator and key moving averages. This strategy focuses on detecting divergences between the MACD line and the signal line, combined with specific conditions related to the 50-period and 800-period SMAs. It ensures that the MACD and signal lines do not cross the zero line between the current and previous divergence points, thereby filtering out weaker signals and enhancing the accuracy of trade entries.
Key Components:
Simple Moving Averages (SMAs):
50-period SMA: A short-term trend indicator that helps identify the prevailing market direction.
800-period SMA: A long-term trend indicator used to gauge the overall market trend.
MACD Indicator:
MACD Line: Represents the difference between the 12-period EMA and the 26-period EMA.
Signal Line: A 9-period EMA of the MACD line.
Histogram: The difference between the MACD line and the signal line, used to visualize the strength of the signal.
Trade Conditions:
Long Position (Buy):
The 50 SMA is above the 800 SMA, indicating a bullish market trend.
The MACD line and signal line are both below zero, signifying a potential bullish reversal.
A bullish divergence is detected when the MACD line crosses above the signal line below zero, without either line crossing the zero level between the current and previous cross.
Short Position (Sell):
The 50 SMA is below the 800 SMA, indicating a bearish market trend.
The MACD line and signal line are both above zero, signaling a potential bearish reversal.
A bearish divergence is detected when the MACD line crosses below the signal line above zero, without either line crossing the zero level between the current and previous cross.
Signal Plotting:
Long Signals: Displayed when the conditions for a bullish divergence and SMA alignment are met, marked with a green upward arrow on the chart.
Short Signals: Displayed when the conditions for a bearish divergence and SMA alignment are met, marked with a red downward arrow on the chart.
MACD Trail | Flux Charts💎 GENERAL OVERVIEW
Introducing our new MACD Trail indicator! Moving average convergence/divergence (MACD) is a well-known indicator among traders. It's a trend-following indicator that uses the relationship between two exponential moving averages (EMAs). This indicator aims to use MACD to generate a trail that follows the current price of the ticker, which can act as a support / resistance zone. More info about the process in the "How Does It Work" section.
Features of the new MACD Trail Indicator :
A Trail Generated Using MACD Calculation
Customizable Algorithm
Customizable Styling
📌 HOW DOES IT WORK ?
First of all, this indicator calculates the current MACD of the ticker using the user's input as settings. Let X = MACD Length setting ;
MACD ~= X Period EMA - (X * 2) Period EMA
Then, two MACD Trails are generated, one being bullish and other being bearish. Let ATR = 30 period ATR (Average True Range)
Bullish MACD Trail = Current Price + MACD - (ATR * 1.75)
Bearish MACD Trail = Current Price + MACD + (ATR * 1.75)
The indicator starts by rendering only the Bullish MACD Trail. Then if it's invalidated (candlestick closes below the trail) it switches to Bearish MACD Trail. The MACD trail switches between bullish & bearish as they get invalidated.
The trail type may give a hint about the current trend of the price action. The trail itself also can act as a support / resistance zone, here is an example :
🚩 UNIQUENESS
While MACD is one of the most used indicators among traders, this indicator aims to add another functionality to it by rendering a trail based on it. This trail may act as a support / resistance zone as described above, and gives a glimpse about the current trend. The indicator also has custom MACD Length and smoothing options, as well as various style options.
⚙️ SETTINGS
1. General Configuration
MACD Length -> This setting adjusts the EMA periods used in MACD calculation. Increasing this setting will make MACD more responseive to longer trends, while decreasing it may help with detection of shorter trends.
Smoothing -> The smoothing of the MACD Trail. Increasing this setting will help smoothen out the MACD Trail line, but it can also make it less responsive to the latest changes.
Dual Chain StrategyDual Chain Strategy - Technical Overview
How It Works:
The Dual Chain Strategy is a unique approach to trading that utilizes Exponential Moving Averages (EMAs) across different timeframes, creating two distinct "chains" of trading signals. These chains can work independently or together, capturing both long-term trends and short-term price movements.
Chain 1 (Longer-Term Focus):
Entry Signal: The entry signal for Chain 1 is generated when the closing price crosses above the EMA calculated on a weekly timeframe. This suggests the start of a bullish trend and prompts a long position.
bullishChain1 = enableChain1 and ta.crossover(src1, entryEMA1)
Exit Signal: The exit signal is triggered when the closing price crosses below the EMA on a daily timeframe, indicating a potential bearish reversal.
exitLongChain1 = enableChain1 and ta.crossunder(src1, exitEMA1)
Parameters: Chain 1's EMA length is set to 10 periods by default, with the flexibility for user adjustment to match various trading scenarios.
Chain 2 (Shorter-Term Focus):
Entry Signal: Chain 2 generates an entry signal when the closing price crosses above the EMA on a 12-hour timeframe. This setup is designed to capture quicker, shorter-term movements.
bullishChain2 = enableChain2 and ta.crossover(src2, entryEMA2)
Exit Signal: The exit signal occurs when the closing price falls below the EMA on a 9-hour timeframe, indicating the end of the shorter-term trend.
exitLongChain2 = enableChain2 and ta.crossunder(src2, exitEMA2)
Parameters: Chain 2's EMA length is set to 9 periods by default, and can be customized to better align with specific market conditions or trading strategies.
Key Features:
Dual EMA Chains: The strategy's originality shines through its dual-chain configuration, allowing traders to monitor and react to both long-term and short-term market trends. This approach is particularly powerful as it combines the strengths of trend-following with the agility of momentum trading.
Timeframe Flexibility: Users can modify the timeframes for both chains, ensuring the strategy can be tailored to different market conditions and individual trading styles. This flexibility makes it versatile for various assets and trading environments.
Independent Trade Logic: Each chain operates independently, with its own set of entry and exit rules. This allows for simultaneous or separate execution of trades based on the signals from either or both chains, providing a robust trading system that can handle different market phases.
Backtesting Period: The strategy includes a configurable backtesting period, enabling thorough performance assessment over a historical range. This feature is crucial for understanding how the strategy would have performed under different market conditions.
time_cond = time >= startDate and time <= finishDate
What It Does:
The Dual Chain Strategy offers traders a distinctive trading tool that merges two separate EMA-based systems into one cohesive framework. By integrating both long-term and short-term perspectives, the strategy enhances the ability to adapt to changing market conditions. The originality of this script lies in its innovative dual-chain design, providing traders with a unique edge by allowing them to capitalize on both significant trends and smaller, faster price movements.
Whether you aim to capture extended market trends or take advantage of more immediate price action, the Dual Chain Strategy provides a comprehensive solution with a high degree of customization and strategic depth. Its flexibility and originality make it a valuable tool for traders seeking to refine their approach to market analysis and execution.
How to Use the Dual Chain Strategy
Step 1: Access the Strategy
Add the Script: Start by adding the Dual Chain Strategy to your TradingView chart. You can do this by searching for the script by name or using the link provided.
Select the Asset: Apply the strategy to your preferred trading pair or asset, such as #BTCUSD, to see how it performs.
Step 2: Configure the Settings
Enable/Disable Chains:
The strategy is designed with two independent chains. You can choose to enable or disable each chain depending on your trading style and the market conditions.
enableChain1 = input.bool(true, title='Enable Chain 1')
enableChain2 = input.bool(true, title='Enable Chain 2')
By default, both chains are enabled. If you prefer to focus only on longer-term trends, you might disable Chain 2, or vice versa if you prefer shorter-term trades.
Set EMA Lengths:
Adjust the EMA lengths for each chain to match your trading preferences.
Chain 1: The default EMA length is 10 periods. This chain uses a weekly timeframe for entry signals and a daily timeframe for exits.
len1 = input.int(10, minval=1, title='Length Chain 1 EMA', group="Chain 1")
Chain 2: The default EMA length is 9 periods. This chain uses a 12-hour timeframe for entries and a 9-hour timeframe for exits.
len2 = input.int(9, minval=1, title='Length Chain 2 EMA', group="Chain 2")
Customize Timeframes:
You can customize the timeframes used for entry and exit signals for both chains.
Chain 1:
Entry Timeframe: Weekly
Exit Timeframe: Daily
tf1_entry = input.timeframe("W", title='Chain 1 Entry Timeframe', group="Chain 1")
tf1_exit = input.timeframe("D", title='Chain 1 Exit Timeframe', group="Chain 1")
Chain 2:
Entry Timeframe: 12 Hours
Exit Timeframe: 9 Hours
tf2_entry = input.timeframe("720", title='Chain 2 Entry Timeframe (12H)', group="Chain 2")
tf2_exit = input.timeframe("540", title='Chain 2 Exit Timeframe (9H)', group="Chain 2")
Set the Backtesting Period:
Define the period over which you want to backtest the strategy. This allows you to see how the strategy would have performed historically.
startDate = input.time(timestamp('2015-07-27'), title="StartDate")
finishDate = input.time(timestamp('2026-01-01'), title="FinishDate")
Step 3: Analyze the Signals
Understand the Entry and Exit Signals:
Buy Signals: When the price crosses above the entry EMA, the strategy generates a buy signal.
bullishChain1 = enableChain1 and ta.crossover(src1, entryEMA1)
Sell Signals: When the price crosses below the exit EMA, the strategy generates a sell signal.
bearishChain2 = enableChain2 and ta.crossunder(src2, entryEMA2)
Review the Visual Indicators:
The strategy plots buy and sell signals on the chart with labels for easy identification:
BUY C1/C2 for buy signals from Chain 1 and Chain 2.
SELL C1/C2 for sell signals from Chain 1 and Chain 2.
This visual aid helps you quickly understand when and why trades are being executed.
Step 4: Optimize the Strategy
Backtest Results:
Review the strategy’s performance over the backtesting period. Look at key metrics like net profit, drawdown, and trade statistics to evaluate its effectiveness.
Adjust the EMA lengths, timeframes, and other settings to see how changes affect the strategy’s performance.
Customize for Live Trading:
Once satisfied with the backtest results, you can apply the strategy settings to live trading. Remember to continuously monitor and adjust as needed based on market conditions.
Step 5: Implement Risk Management
Use Realistic Position Sizing:
Keep your risk exposure per trade within a comfortable range, typically between 1-2% of your trading capital.
Set Alerts:
Set up alerts for buy and sell signals, so you don’t miss trading opportunities.
Paper Trade First:
Consider running the strategy in a paper trading account to understand its behavior in real market conditions before committing real capital.
This dual-layered approach offers a distinct advantage: it enables the strategy to adapt to varying market conditions by capturing both broad trends and immediate price action without one chain's activity impacting the other's decision-making process. The independence of these chains in executing transactions adds a level of sophistication and flexibility that is rarely seen in more conventional trading systems, making the Dual Chain Strategy not just unique, but a powerful tool for traders seeking to navigate complex market environments.
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
;)