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.
Exponential Moving Average (EMA)
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.
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.
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.
[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
Double CCI Confirmed Hull Moving Average Reversal StrategyOverview
The Double CCI Confirmed Hull Moving Average Strategy utilizes hull moving average (HMA) in conjunction with two commodity channel index (CCI) indicators: the slow and fast to increase the probability of entering when the short and mid-term uptrend confirmed. The main idea is to wait until the price breaks the HMA while both CCI are showing that the uptrend has likely been already started. Moreover, strategy uses exponential moving average (EMA) to trail the price when it reaches the specific level. The strategy opens only long trades.
Unique Features
Dynamic stop-loss system: Instead of fixed stop-loss level strategy utilizes average true range (ATR) multiplied by user given number subtracted from the position entry price as a dynamic stop loss level.
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Double trade setup confirmation: Strategy utilizes two different period CCI indicators to confirm the breakouts of HMA.
Trailing take profit level: After reaching the trailing profit activation level scrip activate the trailing of long trade using EMA. More information in methodology.
Methodology
The strategy opens long trade when the following price met the conditions:
Short-term period CCI indicator shall be above 0.
Long-term period CCI indicator shall be above 0.
Price shall cross the HMA and candle close above it with the same candle
When long trade is executed, strategy set the stop-loss level at the price ATR multiplied by user-given value below the entry price. This level is recalculated on every next candle close, adjusting to the current market volatility.
At the same time strategy set up the trailing stop validation level. When the price crosses the level equals entry price plus ATR multiplied by user-given value script starts to trail the price with EMA. If price closes below EMA long trade is closed. When the trailing starts, script prints the label “Trailing Activated”.
Strategy settings
In the inputs window user can setup the following strategy settings:
ATR Stop Loss (by default = 1.75)
ATR Trailing Profit Activation Level (by default = 2.25)
CCI Fast Length (by default = 25, used for calculation short term period CCI
CCI Slow Length (by default = 50, used for calculation long term period CCI)
Hull MA Length (by default = 34, period of HMA, which shall be broken to open trade)
Trailing EMA Length (by default = 20)
User can choose the optimal parameters during backtesting on certain price chart.
Justification of Methodology
Before understanding why this particular combination of indicator has been chosen let's briefly explain what is CCI and HMA.
The Commodity Channel Index (CCI) is a momentum-based technical indicator used in trading to measure a security's price relative to its average price over a given period. Developed by Donald Lambert in 1980, the CCI is primarily used to identify cyclical trends in a security, helping traders to spot potential buying or selling opportunities.
The CCI formula is:
CCI = (Typical Price − SMA) / (0.015 × Mean Deviation)
Typical Price (TP): This is calculated as the average of the high, low, and closing prices for the period.
Simple Moving Average (SMA): This is the average of the Typical Prices over a specific number of periods.
Mean Deviation: This is the average of the absolute differences between the Typical Price and the SMA.
The result is a value that typically fluctuates between +100 and -100, though it is not bounded and can go higher or lower depending on the price movement.
The Hull Moving Average (HMA) is a type of moving average that was developed by Alan Hull to improve upon the traditional moving averages by reducing lag while maintaining smoothness. The goal of the HMA is to create an indicator that is both quick to respond to price changes and less prone to whipsaws (false signals).
How the Hull Moving Average is Calculated?
The Hull Moving Average is calculated using the following steps:
Weighted Moving Average (WMA): The HMA starts by calculating the Weighted Moving Average (WMA) of the price data over a period square root of n (sqrt(n))
Speed Adjustment: A WMA is then calculated for half of the period n/2, and this is multiplied by 2 to give more weight to recent prices.
Lag Reduction: The WMA of the full period n is subtracted from the doubled n/2 WMA.
Final Smoothing: To smooth the result and reduce noise, a WMA is calculated for the square root of the period n.
The formula can be represented as:
HMA(n) = WMA(WMA(n/2) × 2 − WMA(n), sqrt(n))
The Weighted Moving Average (WMA) is a type of moving average that gives more weight to recent data points, making it more responsive to recent price changes than a Simple Moving Average (SMA). In a WMA, each data point within the selected period is multiplied by a weight, with the most recent data receiving the highest weight. The sum of these weighted values is then divided by the sum of the weights to produce the WMA.
This strategy leverages HMA of user given period as a critical level which shall be broken to say that probability of trend change to the upside increased. HMA reacts faster than EMA or SMA to the price change, that’s why it increases chances to enter new trade earlier. Long-term period CCI helps to have an approximation of mid-term trend. If it’s above 0 the probability of uptrend increases. Short-period CCI allows to have an approximation of short-term trend reversal from down to uptrend. This approach increases chances to have a long trade setup in the direction of mid-term trend when the short-term trend starts to reverse.
ATR is used to adjust the strategy risk management to the current market volatility. If volatility is low, we don’t need the large stop loss to understand the there is a high probability that we made a mistake opening the trade. User can setup the settings ATR Stop Loss and ATR Trailing Profit Activation Level to realize his own risk to reward preferences, but the unique feature of a strategy is that after reaching trailing profit activation level strategy is trying to follow the trend until it is likely to be finished instead of using fixed risk management settings. It allows sometimes to be involved in the large movements. It’s also important to make a note, that script uses HMA to enter the trade, but for trailing it leverages EMA. It’s used because EMA has no such fast reaction to price move which increases probability not to be stopped out from any significant uptrend move.
Backtest Results
Operating window: Date range of backtests is 2022.07.01 - 2024.08.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 100%
Maximum Single Position Loss: -4.67%
Maximum Single Profit: +19.66%
Net Profit: +14897.94 USDT (+148.98%)
Total Trades: 104 (36.54% win rate)
Profit Factor: 2.312
Maximum Accumulated Loss: 1302.66 USDT (-9.58%)
Average Profit per Trade: 143.25 USDT (+0.96%)
Average Trade Duration: 34 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 2h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Three Anchored Moving Averages (VWAP / SMA / EMA)
This indicator allows users to anchor three types of moving averages (Simple Moving Average (SMA), Exponential Moving Average (EMA), and Volume Weighted Average Price (VWAP)) to specific points in time (anchor points)
Key Features:
Select from three Moving Average Types:
Simple Moving Average (SMA): Averages the closing prices over a specified period.
Exponential Moving Average (EMA): Gives more weight to recent prices, making it more responsive to new information.
Volume Weighted Average Price (VWAP): Averages the price weighted by volume, useful for understanding the average price at which the asset has traded over a period.
Up to Three Anchor Points:
Users can set up to three different anchor points to calculate the moving averages from specific dates and times. This allows for analysis of price action starting from significant points or specific events. For example, you can anchor to the low and high of a move to identify key levels or to points where the price takes off from a previous anchored MA.
Customisable Sentiment Options:
Each anchor point can be associated with a sentiment input (Auto, Bull, Bear, None), which influences if the MAs are displayed as lines or zones/bands:
Auto: Automatically determines the sentiment based on whether anchor points are on pivot highs and lows. If anchored to a pivot high, the system will assume a bearish sentiment and display a red band or zone between the MA OHLC4 and High. Anchoring to a pivot low will display a green band (OHLC4 - Low).
Bull: Forces a bullish sentiment (Green Band - OHLC4 to Low)
Bear: Forces a bearish sentiment (Red Band - OHLC4 to High)
None: Ignores sentiment and displays a single line (OHLC4)
Chart Matching:
The indicator includes an option to display the moving averages only if the chart symbol matches a specified ticker. This feature ensures that the indicator is relevant to the specific asset being analysed.
How to Use the Indicator:
1. Set Anchor Points: When added to your chart, select three anchor points by point and click. If you only wish to anchor to a single point, click on that point three times and disable the other two in settings once the indicator is applied.
2. Select Moving Average Type: Choose between SMA, EMA, or VWAP using the dropdown menu. EMAs are the most responsive.
3. Enable/Disable Anchor Points: Use the checkboxes to enable or disable each anchor point.
4. Select Sentiment Type: Choose between Auto, Bull, Bear, or None.
5. Chart Matching: Optionally, specify a chart symbol to restrict the indicator's display to that particular asset.
6. Interpret the Plots: The indicator plots the high, mid, and low values of the selected moving average type from each anchor point. The fills between these plots help identify potential support and resistance zones. These should be used as points of interest for pullback reversals or potential continuation if the price breaks through.
Practical Applications:
Trend Analysis: Identify the overall trend direction from specific historical points.
Support and Resistance: Determine key dynamic support and resistance levels based on anchored moving averages.
Event-Based Analysis: Anchor the moving averages to significant events (e.g., earnings releases, economic data) to study their impact on price trends.
Multi Timeframe Analysis: Higher Timeframe Anchors can be used to identify longer term trend analysis. Switching to a lower timeframe for execution triggers at these points wont distort the MA levels as they are anchored to a specific point in time
Intraday or Swing Trading: trend analysis using anchor points can be used for any style of trading (Intraday / Swing / Invest). Use anchored levels as points of interest and wait for hints in price action to try and catch the next move.
Harmonic Trading Tachometer [Pinescriptlabs]Key Features:
Visual Tachometer:
Represents market harmony through a speedometer on the chart.
The tachometer displays a range of harmony from "Highly Bearish" to "Highly Bullish."
Harmony Calculation:
Harmony Score: Based on ATR (Average True Range) range calculations for short, medium, and long periods. The harmony score is a weighted combination of these scores.
Interpretation: Harmony is translated into an interpretive category that can be "Highly Bearish," "Bearish," "Neutral," "Bullish," or "Highly Bullish."
Price Projection:
Estimates future price movement considering the current trend and the weight of each trend period (short, medium, and long).
Harmonic Change Detection:
Identifies significant changes in market harmony and adjusts sensitivity with predefined thresholds.
Confirmation and Divergence Signals:
Detects bullish or bearish confirmation signals as well as divergences, based on market harmony and price projection.
Additional Visualization:
Includes an optional market pentagram chart to visualize harmony on a broader scale.
Provides detailed information in a table about harmony, price projection, and harmonic changes.
How the Script Works:
Initial Calculations:
Ranges and Scores: Calculates ATR ranges for different periods (short, medium, and long). Then, evaluates the harmony score using the given formula.
Harmony: Obtained through the weighted combination of short, medium, and long-term scores.
Price Projection:
The projection is adjusted based on the difference between the current closing price and the exponential moving averages (EMAs) for different periods, weighted by the defined factors.
How to Use :
Tachometer Interpretation:
Observe the needle's position on the tachometer to assess the current market harmony.
Use the colors and labels to quickly interpret the market's state.
Projection and Changes:
Use the price projection to identify potential support or resistance levels.
Monitor harmonic changes and their strengths to adjust your trading strategies.
Confirmations and Divergences:
Pay attention to confirmation and divergence signals to decide on potential entries or exits.
Customization:
Adjust the indicator parameters, such as base length, harmony factor, change detection period, and trend weights, to fit your trading style and timeframe.
Español:
**Tacómetro Visual:
- Representa la armonía del mercado mediante un velocímetro en el gráfico.
- El tacómetro muestra un rango de armonía desde "Altamente Bajista" hasta "Altamente Alcista."
Cálculo de Armonía:
- Puntuación de Armonía:** Basada en los cálculos del rango ATR (Average True Range) para períodos cortos, medios y largos. La puntuación de armonía es una combinación ponderada de estas puntuaciones.
- Interpretación: La armonía se traduce en una categoría interpretativa que puede ser "Altamente Bajista," "Bajista," "Neutral," "Alcista," o "Altamente Alcista."
**Proyección de Precios:
- Estima el movimiento futuro de los precios considerando la tendencia actual y el peso de cada período de tendencia (corto, medio y largo).
**Detección de Cambios Armonicos:
- Identifica cambios significativos en la armonía del mercado y ajusta la sensibilidad con umbrales predefinidos.
**Señales de Confirmación y Divergencia:
- Detecta señales de confirmación alcista o bajista, así como divergencias, basadas en la armonía del mercado y la proyección de precios.
**Visualización Adicional:**
- Incluye un gráfico opcional de un pentagrama de mercado para visualizar la armonía en una escala más amplia.
- Proporciona información detallada en una tabla sobre la armonía, la proyección de precios y los cambios armónicos.
**Cómo Funciona el Script:**
Cálculos Iniciales:
- **Rangos y Puntuaciones:** Calcula los rangos del ATR para diferentes períodos (corto, medio y largo). Luego, evalúa la puntuación de armonía utilizando la fórmula dada.
- **Armonía:** Se obtiene a través de la combinación ponderada de las puntuaciones de corto, medio y largo plazo.
**Proyección de Precios:**
- La proyección se ajusta según la diferencia entre el precio de cierre actual y las medias móviles exponenciales (EMA) para diferentes períodos, ponderadas por los factores definidos.
**Cómo Usar:**
**Interpretación del Tacómetro:**
- Observa la posición de la aguja en el tacómetro para evaluar la armonía actual del mercado.
- Usa los colores y las etiquetas para interpretar rápidamente el estado del mercado.
**Proyección y Cambios:**
- Usa la proyección de precios para identificar posibles niveles de soporte o resistencia.
- Monitorea los cambios armónicos y sus fortalezas para ajustar tus estrategias de trading.
**Confirmaciones y Divergencias:**
- Presta atención a las señales de confirmación y divergencia para decidir posibles entradas o salidas.
**Personalización:**
- Ajusta los parámetros del indicador, como la longitud base, el factor de armonía, el período de detección de cambios y los pesos de tendencia, para adaptarlo a tu estilo de trading y marco de tiempo.
Dysmen signalsDysmen Signals Indicator
The "Dysmen Signals" indicator is designed to provide clear buy and sell signals based on the crossover of various Exponential Moving Averages (EMAs). This indicator employs a combination of short-term and long-term EMA crossovers to identify potential trading opportunities, while also highlighting significant market movements through specific signals such as the Golden Cross and Death Cross.
Indicator Components
1. Exponential Moving Averages (EMAs)
- EMA 14: A short-term EMA calculated over 14 periods.
- EMA 20: Another short-term EMA calculated over 20 periods.
- EMA 50: A mid-term EMA used as a trend filter.
- EMA 200: A long-term EMA representing the overall trend.
2. Buy and Sell Signals
- Buy Signal: This is triggered when the EMA 14 crosses above the EMA 20 and the closing price is above the EMA 50. This suggests a bullish trend in the market.
- Sell Signal: This is triggered when the EMA 14 crosses below the EMA 20 and the closing price is below the EMA 50. This indicates a bearish trend in the market.
3. Golden Cross and Death Cross
- Golden Cross (GC): Occurs when the EMA 50 crosses above the EMA 200. This is a strong bullish signal indicating a potential long-term upward trend.
- Death Cross (DC): Occurs when the EMA 50 crosses below the EMA 200. This is a strong bearish signal suggesting a potential long-term downward trend.
4. Signal Visualization
- Buy and Sell signals are marked on the chart with green and red triangles respectively. These signals help traders identify potential entry and exit points.
- Golden Cross and Death Cross signals are indicated with yellow and purple diamonds respectively, providing insight into major market trend shifts.
5. Candle Coloring
- Candles are colored green if a buy signal is active and red if a sell signal is active. This visual aid helps in quickly identifying the prevailing market sentiment.
6. EMA 200 Plotting
- The EMA 200 is plotted as a white, semi-thick line on the chart. This line serves as a reference for the overall long-term trend.
Detailed Code Explanation
- EMA Calculations: The script calculates the EMA for 14, 20, 50, and 200 periods using the ta.ema function.
- Crossover Conditions: It uses the ta.crossover and ta.crossunder functions to detect when the EMAs cross each other, triggering buy and sell signals.
- Plotting Signals: The plotshape function is utilized to display BUY and SELL signals as well as Golden Cross and Death Cross signals on the chart.
- Candle Coloring Logic: A variable direction is used to store the current market direction based on the latest signal, which then determines the candle colors using the barcolor function.
- EMA 200 Display: The plot function is used to draw the EMA 200 line on the chart with the specified color and thickness.
By employing this indicator, traders can gain valuable insights into potential market trends and make more informed trading decisions based on the crossover of key EMAs.
Support and resistance levels (Day, Week, Month) + EMAs + SMAs(ENG): This Pine 5 script provides various tools for configuring and displaying different support and resistance levels, as well as moving averages (EMA and SMA) on charts. Using these tools is an essential strategy for determining entry and exit points in trades.
Support and Resistance Levels
Daily, weekly, and monthly support and resistance levels play a key role in analyzing price movements:
Daily levels: Represent prices where a cryptocurrency has tended to bounce within the current trading day.
Weekly levels: Reflect strong prices that hold throughout the week.
Monthly levels: Indicate the most significant levels that can influence price movement over the month.
When trading cryptocurrencies, traders use these levels to make decisions about entering or exiting positions. For example, if a cryptocurrency approaches a weekly resistance level and fails to break through it, this may signal a sell opportunity. If the price reaches a daily support level and starts to bounce up, it may indicate a potential long position.
Market context and trading volumes are also important when analyzing support and resistance levels. High volume near a level can confirm its significance and the likelihood of subsequent price movement. Traders often combine analysis across different time frames to get a more complete picture and improve the accuracy of their trading decisions.
Moving Averages
Moving averages (EMA and SMA) are another important tool in the technical analysis of cryptocurrencies:
EMA (Exponential Moving Average): Gives more weight to recent prices, allowing it to respond more quickly to price changes.
SMA (Simple Moving Average): Equally considers all prices over a given period.
Key types of moving averages used by traders:
EMA 50 and 200: Often used to identify trends. The crossing of the 50-day EMA with the 200-day EMA is called a "golden cross" (buy signal) or a "death cross" (sell signal).
SMA 50, 100, 150, and 200: These periods are often used to determine long-term trends and support/resistance levels. Similar to the EMA, the crossings of these averages can signal potential trend changes.
Settings Groups:
EMA Golden Cross & Death Cross: A setting to display the "golden cross" and "death cross" for the EMA.
EMA 50 & 200: A setting to display the 50-day and 200-day EMA.
Support and Resistance Levels: Includes settings for daily, weekly, and monthly levels.
SMA 50, 100, 150, 200: A setting to display the 50, 100, 150, and 200-day SMA.
SMA Golden Cross & Death Cross: A setting to display the "golden cross" and "death cross" for the SMA.
Components:
Enable/disable the display of support and resistance levels.
Show level labels.
Parameters for adjusting offset, display of EMA and SMA, and their time intervals.
Parameters for configuring EMA and SMA Golden Cross & Death Cross.
EMA Parameters:
Enable/disable the display of 50 and 200-day EMA.
Color and style settings for EMA.
Options to use bar gaps and the "LookAhead" function.
SMA Parameters:
Enable/disable the display of 50, 100, 150, and 200-day SMA.
Color and style settings for SMA.
Options to use bar gaps and the "LookAhead" function.
Effective use of support and resistance levels, as well as moving averages, requires an understanding of technical analysis, discipline, and the ability to adapt the strategy according to changing market conditions.
(RUS) Данный Pine 5 скрипт предоставляет разнообразные инструменты для настройки и отображения различных уровней поддержки и сопротивления, а также скользящих средних (EMA и SMA) на графиках. Использование этих инструментов является важной стратегией для определения точек входа и выхода из сделок.
Уровни поддержки и сопротивления
Дневные, недельные и месячные уровни поддержки и сопротивления играют ключевую роль в анализе движения цен:
Дневные уровни: Представляют собой цены, на которых криптовалюта имела тенденцию отскакивать в течение текущего торгового дня.
Недельные уровни: Отражают сильные цены, которые сохраняются в течение недели.
Месячные уровни: Указывают на наиболее значимые уровни, которые могут влиять на движение цены в течение месяца.
При торговле криптовалютами трейдеры используют эти уровни для принятия решений о входе в позицию или закрытии сделки. Например, если криптовалюта приближается к недельному уровню сопротивления и не удается его преодолеть, это может стать сигналом для продажи. Если цена достигает дневного уровня поддержки и начинает отскакивать вверх, это может указывать на возможность открытия длинной позиции.
Контекст рынка и объемы торговли также важны при анализе уровней поддержки и сопротивления. Высокий объем при приближении к уровню может подтвердить его значимость и вероятность последующего движения цены. Трейдеры часто комбинируют анализ различных временных рамок для получения более полной картины и улучшения точности своих торговых решений.
Скользящие средние
Скользящие средние (EMA и SMA) являются еще одним важным инструментом в техническом анализе криптовалют:
EMA (Exponential Moving Average): Экспоненциальная скользящая средняя, которая придает большее значение последним ценам. Это позволяет более быстро реагировать на изменения в ценах.
SMA (Simple Moving Average): Простая скользящая средняя, которая равномерно учитывает все цены в заданном периоде.
Основные виды скользящих средних, которые используются трейдерами:
EMA 50 и 200: Часто используются для выявления трендов. Пересечение 50-дневной EMA с 200-дневной EMA называется "золотым крестом" (сигнал на покупку) или "крестом смерти" (сигнал на продажу).
SMA 50, 100, 150 и 200: Эти периоды часто используются для определения долгосрочных трендов и уровней поддержки/сопротивления. Аналогично EMA, пересечения этих средних могут сигнализировать о возможных изменениях тренда.
Группы настроек:
EMA Golden Cross & Death Cross: Настройка для отображения "золотого креста" и "креста смерти" для EMA.
EMA 50 & 200: Настройка для отображения 50-дневной и 200-дневной EMA.
Уровни поддержки и сопротивления: Включает настройки для дневных, недельных и месячных уровней.
SMA 50, 100, 150, 200: Настройка для отображения 50, 100, 150 и 200-дневных SMA.
SMA Golden Cross & Death Cross: Настройка для отображения "золотого креста" и "креста смерти" для SMA.
Компоненты:
Включение/отключение отображения уровней поддержки и сопротивления.
Показ ярлыков уровней.
Параметры для настройки смещения, отображения EMA и SMA, а также их временных интервалов.
Параметры для настройки EMA и SMA Golden Cross & Death Cross.
Параметры EMA:
Включение/отключение отображения 50 и 200-дневных EMA.
Настройки цвета и стиля для EMA.
Опции для использования разрыва баров и функции "LookAhead".
Параметры SMA:
Включение/отключение отображения 50, 100, 150 и 200-дневных SMA.
Настройки цвета и стиля для SMA.
Опции для использования разрыва баров и функции "LookAhead".
Эффективное использование уровней поддержки и сопротивления, а также скользящих средних, требует понимания технического анализа, дисциплины и умения адаптировать стратегию в зависимости от изменяющихся условий рынка.
Multi-Timeframe Trend IndicatorMulti-Timeframe Trend Indicator
The “Multi-Timeframe Trend Indicator” is a versatile tool designed to help traders identify trends across multiple timeframes using Exponential Moving Averages (EMAs). This indicator is suitable for both novice and experienced traders. It allows users to customize the lengths of the short and long EMAs, providing a clear visualization of the trend direction (UP, DOWN, SIDE) for various intervals including 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, and 4 hours. The indicator offers extensive customization options, enabling adjustments for table position, colors, and more to suit individual trading preferences.
How the Calculation Works
The Multi-Timeframe Trend Indicator uses EMAs to calculate trends. EMAs give more weight to recent prices, making them responsive to new information. The short EMA, calculated over a shorter period, reacts quickly to price changes, while the long EMA, calculated over a longer period, smooths out fluctuations to show the overall trend.
For each timeframe, the indicator calculates both the short EMA and the long EMA. If the short EMA is above the long EMA, the trend is considered “UP”. If the short EMA is below the long EMA, the trend is “DOWN”. If the absolute difference between the short and long EMAs is within a user-defined threshold, the trend is classified as “SIDE” (sideways).
This calculation is repeated for multiple timeframes: 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, and 4 hours. The results are displayed in a table, providing a comprehensive view of the trend direction across different timeframes.
How the Code Works
Input Parameters: Users can input the lengths of the short and long EMAs and the threshold for identifying sideways trends. These inputs allow for a high degree of customization to match individual trading strategies.
Trend Calculation Function: The trend function calculates the trend direction based on the EMAs. It uses the math.abs function to find the absolute difference between the EMAs and determines if the trend is “UP”, “DOWN”, or “SIDE” based on the threshold.
Requesting Data for Multiple Timeframes: The script uses the request.security function to fetch price data and calculate the EMAs for different timeframes independently of the current chart timeframe. This ensures consistency in trend analysis regardless of the displayed timeframe.
Creating and Updating the Table: A table is created to display the trend directions for each timeframe. The table’s position and appearance can be customized. The trend data for each timeframe is color-coded (green for UP, red for DOWN, gray for SIDE) and displayed in the table.
Customization Options: Users can customize the colors, table position, and EMA lengths through the indicator settings, providing flexibility to adapt the indicator to their trading style.
Disclaimer
This indicator is for informational purposes only and should not be considered financial advice. It does not predict future price movements and does not guarantee accurate trend calculations, as market conditions can vary. Trading involves substantial risk and is not suitable for everyone. Always conduct your own research before making any trading decisions.
Perfect Order Alert USDJPY/BTCUSD/XAUUSDPerfect Order Alert USDJPY/BTCUSD/XAUUSD 日本語解説は下記
This indicator detects the perfect order of three moving averages and displays on the Panel in an easy-to-understand visual manner whether there is an uptrend, downtrend, or non-trend for each time leg.
This indicator detects perfect orders for the three currency pairs USDJPY/BTCUSD/XAUUSD on the 5-minute, 15-minute, 1-hour, and 4-hour time frames, and displays them on the Panel on the chart, with “▲” for up, “▼” for down, and “ー” for non-trend, so that you can quickly determine the trend. The panel is displayed on the chart.
In order to check for perfect orders without missing them, it is also possible to set up alerts that notify you of all the time frames and currency pairs as well.
Functions
Displaying 4H, 1H, 15M, 5M, up (▲), down (▼), other (-), of USDJPY/BTCUSD/XAUUSD on the panel.
*(By default, 20EMA, 75EMA, and 200EMA are hidden.)
Display position setting of the panel (You can choose from upper left, upper top, upper right, lower left, lower bottom, or lower right).
Panel color and text color change function
The moving average line can be hidden by default.
Moving average period change
Moving average color and thickness can be changed.
EMA/SMA switchable
Alert function - One alert can be set for each currency pair and time frame ▲▼, which is very useful.
Perfect Order Alert
You can use it even if you have a free account with only one alert setting.
To use the alert function, go to the Tradingview default alert settings, select “USDJPY/BTCUSD/XAUUSD” for the top item of conditions, and select “Call Alert() function” in the frame just below it!
_* Supplementary explanation: ____________
Please note that due to the limitation of the script, only 3 currency pairs and 4 time frames are displayed with 12 items (Panels for currency pairs other than USDJPY/BTCUSD/XAUUSD are also created, but they are indicators for other scripts, so if you are interested in other currency pairs, please use those. If you are interested in other currency pairs, please use them.)
Please note that we may change the functions or delete the indicator itself without prior notice.
Translated with DeepL.com (free version)
Reference image of the setting screenReference image of the setting screen
設定画面参考画像
3本の移動平均線のパーフェクトオーダーを検知し、時間足ごとに上昇トレンドか下降トレンドかノントレンドかを視覚的にわかりやすくPanelに表示するインジゲーターです。
このインジゲーターは、USDJPY/BTCUSD/XAUUSDの3通貨ペアの5分足、15分足、1時間足、4時間足のパーフェクトオーダーを検知して、チャートに表示されるPanelに、上昇は「▲」下降は「▼」ノントレンドは「ー」と、すぐに判断できる表示にしてあります。
パーフェクトオーダーを逃さずチェックできるように、それぞれの時間足や通貨ペアも全てを通知してくれるアラート設定が可能なのも特徴です。
機能紹介
・USDJPY/BTCUSD/XAUUSDの4H,1H,15M,5M,の上昇(▲),下降(▼),その他(-),をパネルに表示
※(デフォルトでは20EMA,75EMA,200EMAの3本で非表示にしてあります)
・パネルの表示位置設定(左上、上、右上、左下、下、右下、から選択できます。)
・パネルの色とテキスト色変更機能
・移動平均線表示非表示機能(デフォルトでは表示OFFにしてあります。)
・移動平均線期間変更
・移動平均線色と太さ変更
・EMA/SMA切り替え可能
・アラート機能ー1つのアラート設定で通貨ペアと時間足▲▼一つ一つを細かく教えてくれるので便利。
※パーフェクト オーダーアラート
無料アカウントで1つしかアラート設定できなくても使えます。
アラート機能はTradingviewデフォルトのアラート設定から、条件の一番上の項目を「USDJPY/BTCUSD/XAUUSD」選択、そのすぐ下の枠に「Alert()関数の呼び出し」を選択でOK!
_※ 補足説明____________
・スクリプトの制限の為、3通貨ペアと4つの時間足の12項目で表示させていますのでご了承ください
(USDJPY/BTCUSD/XAUUSD以外の通貨ペアのPanelも作成していますが別スクリプトのインジゲーターになりますので他の通貨ペアも興味がある方はそちらをお使いください)
・予告なしで機能の変更やインジゲーター自体の削除等行う事もあるかもなのでご了承ください。
Moving Average Crossover Swing StrategyMoving Average Crossover Swing Strategy
**Overview:**
The basic concept of this strategy is to generate a signal when a faster/shorter length moving average crosses over (for Longs) or crosses under (for Shorts) a medium/longer length moving average. All of which are customizable. This strategy can work on any timeframe, however the daily is the timeframe used for the default settings and screenshots, as it was designed to be a multi-day swing strategy. Once a signal has been confirmed with a candle close, based on user options, the strategy will enter the trade on the open of the next candle.
The crossover strategy is nothing new to trading, but what can make this strategy unique and helpful, is the addition of further confirmation points, ATR based stop loss and take profit targets, optional early exit criteria, customizable to your needs and style, and just about everything visual can be toggled on/off. This strategy is based on a Trend (MA) indicator and a Momentum (MACD) indicator. While a Volume-based indicator is not shown here, one could consider using their favorite from that category to further compliment the signal idea.
It should be noted that depending on the time frame, direction(s) chosen, the signal options, confirmation options, and exit options selected, that a ticker may not produce more than 100 trades on the back test. Depending on your style and frequency, one could consider adjusting options and/or testing multiple tickers. It should also be noted that this strategy simply tests the underlying stock prices, not options contracts. And of course, testing this strategy against historical data does not assume that the same results will occur in future price action.
Shoutout given to Ripster's Clouds Indicator as pieces of that code were taken and modified to create both the Cloud visualization effects, and the Moving Average Pair Plots that are implemented in this strategy.
BASIC DEFAULTS
All can be changed as normal
Initial capital = 10,000
Order Sizing = 25% of equity (use the "Inputs" tab to modify this)
Pyramiding = 0
Commission = 0.65 USD per order
Price Verification = 1 tick
Slippage = 1 tick
RISK MANAGMENT
You will notice two different percentage options and ATR multipliers. This strategy will adjust position sizing by not exceeding either one of those % values based on the ATR (Average True Range) of the symbol and the multipliers selected, should the stock hit the stop loss price.
For Example, lets assume these values are true:
Account size = $10,000,
Max Risk = 1% of account size
Max Position Size = 25% of the account size
Stock Price = 23.45
ATR = 3.5
ATR Stop Loss Multiplier = 1.4
Then the formulas would be:
ACCT_SIZE * MaxRisk_% = 10000 * .01 = $100 (MaxCashRisk)
-----
MaxCashRisk / (ATR * ATR_SL_MULTIPLIER) = 100 / (3.5 * 1.4) = 20.4 Shares based on Max Cash Risk
-----
(ACCT_SIZE * MaxEquity_%) / STOCK_PRICE = (10000 * .25) / 23.45 = 106.61 Shares based on Max Equity Allocation
The minimum value of each of those options is then used, which in this case would be to purchase 20 shares so as not to exceed the max dollar risk should the stock reach the stop loss target. Likewise, if the ATR were to be much lower, say 0.48 cents, and all else the same, then the strategy would purchase the 106 shares based on Max Equity Allocation because the Max Cash Risk would require 149.25 shares.
MOVING AVERAGE OPTIONS
Select between and change the length & type of up to 5 pairs (10 total) of moving averages
The "Show Cloud-x" option will display a fill color between the "a" and "b" pairs
All moving averages lines can be toggled on/off in the "Style" tab, as well as adjusting their colors.
Visualization features do not affect calculations, meaning you could have all or nothing on the chart and the strategy will still produce results
SIGNAL CHOICES
Choose the fast/shorter length MA and the medium/longer length MA to determine the entry signal
CONFIRMATION OPTIONS
Both of these have customizable values and can be toggled on/off
A candle close over a slower/much longer length moving average
An additional cross-over (cross-under for Shorts) on the MACD indicator using default MACD values. While the MACD indicator is not necessary to have on the chart, it can help to add that for visualization. The calculations will perform whether the indicator is on the chart or not.
EARLY EXIT CRITERIA
Both can be toggled on/off with customizable values
MA Cross Exit will exit the trade early if the select moving averages cross-under (for longs) or cross-over (for shorts), indicating a potential reversal.
Max Bars in Trades will act as a last-resort exit by simply calculating the amount of full bars the trade has been open, and exiting on the opening of the next bar. For example: the default value is 8 bars, so after 8 full bars in the trade, if no other exit has been triggered (Stop Loss, Take Profit, or MA Cross(if enabled)), then the trade will exit at the opening of the 9th bar.
Finally, there is a table displaying the amount of trades taken for each side, and the amount & percent of both early exits. This table can be turned off in the "Style" tab
ADDITIONAL PLOTS
MACD (Moving Average Convergence/Divergence):
- The MACD is an optional confirmation indicator for this strategy.
- Plotting the indicator is not necessary for the strategy to work, but it can be helpful to visually see the status and position of the MACD if this feature is enabled in the strategy
- This helps to identify if there is also momentum behind the entry signal
Strategy SEMA SDI WebhookPurpose of the Code:
The strategy utilizes Exponential Moving Averages (EMA) and Smoothed Directional Indicators (SDI) to generate buy and sell signals. It includes features like leverage, take profit, stop loss, and trailing stops. The strategy is intended for backtesting and automating trades based on the specified indicators and conditions.
Key Components and Functionalities:
1.Strategy Settings:
Overlay: The strategy will overlay on the price chart.
Slippage: Set to 1.
Commission Value: Set to 0.035.
Default Quantity Type: Percent of equity.
Default Quantity Value: 50% of equity.
Initial Capital: Set to 1000 units.
Calculation on Order Fills: Enabled.
Process Orders on Close: Enabled.
2.Date and Time Filters:
Inputs for enabling/disabling start and end dates.
Filters to execute strategy only within specified date range.
3.Leverage and Quantity:
Leverage: Adjustable leverage input (default 3).
USD Percentage: Adjustable percentage of equity to use for trades (default 50%).
Initial Capital: Calculated based on leverage and percentage of equity.
4.Take Profit, Stop Loss, and Trailing Stop:
Inputs for enabling/disabling take profit, stop loss, and trailing stop.
Adjustable parameters for take profit percentage (default 25%), stop loss percentage (default 4.8%), and trailing stop percentage (default 1.9%).
Calculations for take profit, stop loss, trailing price, and maximum profit tracking.
5.EMA Calculations:
Fast and slow EMAs.
Smoothed versions of the fast and slow EMAs.
6.SDI Calculations:
Directional movement calculation for positive and negative directional indicators.
Difference between the positive and negative directional indicators, smoothed.
7.Buy/Sell Conditions:
Long (Buy) Condition: Positive DI is greater than negative DI, and fast EMA is greater than slow EMA.
Short (Sell) Condition: Negative DI is greater than positive DI, and fast EMA is less than slow EMA.
8.Strategy Execution:
If buy conditions are met, close any short positions and enter a long position.
If sell conditions are met, close any long positions and enter a short position.
Exit conditions for long and short positions based on take profit, stop loss, and trailing stop levels.
Close all positions if outside the specified date range.
Usage:
This strategy is used to automate trading based on the specified conditions involving EMAs and SDI. It allows backtesting to evaluate performance based on historical data. The strategy includes risk management through take profit, stop loss, and trailing stops to protect gains and limit losses. Traders can customize the parameters to fit their specific trading preferences and risk tolerance. Differently, it can perform leverage analysis and use it as a template.
By using this strategy, traders can systematically execute trades based on technical indicators, helping to remove emotional bias and improve consistency in trading decisions.
Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
Moving Average Trend Meter [UkutaLabs]█ OVERVIEW
The Moving Average Trend Meter is a powerful trading indicator that visualizes current market strength. This indicator uses a series of four EMAs (Exponential Moving Averages) to determine short, medium and long term market strength. Each of the three rows of boxes corresponds to an EMA, with the top being the fast, the middle being the medium and the bottom being the slow. Depending on whether each EMA is above or below the source EMA, its corresponding row will be colored accordingly, with the boxes appearing green if the source is above it or red if it is below.
This indicator also displays when the strength of the market is transitioning between bullish and bearish, indicating that there may be an upcoming reversal.
The purpose of this script is to simplify the trading experience of users by providing an easier way to visualize current market strength using a series of EMAs.
█ USAGE
This indicator provides an easy to understand method of visualizing the current market strength based on the positioning of four EMAs. By default, the period for these EMAs are selected based on key Fibonacci levels, and the period of each one can be customized in the indicator settings.
Depending on whether or not the source EMA is above or below each of the other three EMAs, the boxes of the corresponding rows will be colored to indicate the current strength of the market.
If all three boxes are drawn the same color, a dot of the same color will be drawn above the boxes.
█ SETTINGS
Configuration
• Source EMA: Determines the period of the source EMA.
• Fast EMA: Determines the period of the fast EMA.
• Med EMA: Determines the period of the medium EMA.
• Slow EMA: Determines the period of the slow EMA.
Colors
• Bullish Color: Determines the color of boxes when the source EMA is above the respective EMA.
• Bearish Color: Determines the color of boxes when the source EMA is below the respective EMA.
• Bullish Transition Color: Determines the color of boxes when the current bar closes above the respective EMA while the source is below it.
• Bearish Transition Color: Determines the color of boxes when the current bar closes below the respective EMA while the source is above it.
Heiken Ashi Ribbon [UkutaLabs]█ OVERVIEW
The Heiken Ashi Ribbon is a powerful trading tool that creates a strong ribbon that indicates market strength. This ribbon is created using four moving averages that use Heiken Ashi values (high, low, open and close) as its input values.
The ribbon will also be colored green, red or grey depending on whether or not its direction aligns with current market strength.
█ USAGE
The Heiken Ashi Ribbon is created using a series of four moving averages that uses values from the Heiken Ashi bars as its inputs. The user has the ability to select whether the moving averages are EMAs or SMAs, as well as the ability to control the period of the moving averages.
If the moving average calculated using the Heiken Ashi Open is below the moving average calculated using the Heiken Ashi Close, the ribbon will be colored green, indicating a bullish trend. If the moving average calculated using the Heiken Ashi Open is above the moving average calculated using the Heiken Ashi Open, the ribbon will be colored red, indicating a bearish trend.
This indicator also uses a series of hidden EMAs to determine market strength. If these EMAs do not align with the direction of the Heiken Ashi Ribbon, the Ribbon will instead be colored grey, indicating uncertainty in the market, as well as a possible reversal.
█ SETTINGS
Configuration
• Moving Average Type: Determines whether or not the Heiken Ashi Moving Averages will be drawn as EMAs or SMAs.
• Moving Average Period: Determines the period of the Heiken Ashi Moving Averages.
Moving Average
• Moving Average Input: Determines the input values for the hidden EMAs.
GMMA Toolkit [QuantVue]The GMMA Toolkit is designed to leverage the principles of the Guppy Multiple Moving Average (GMMA). This indicator is equipped with multiple features to help traders identify trends, reversals, and periods of market compression.
The Guppy Multiple Moving Average (GMMA) is a technical analysis tool developed by Australian trader and author Daryl Guppy in the late 1990s.
It utilizes two sets of Exponential Moving Averages (EMAs) to capture both short-term and long-term market trends. The short-term EMAs represent the activity of traders, while the long-term EMAs reflect the behavior of investors.
By analyzing the interaction between these two groups of EMAs, traders can identify the strength and direction of trends, as well as potential reversals.
Due to the nature of GMMA, charts can become cluttered with numerous lines, making analysis challenging.
However, this indicator simplifies visualization by using clouds to represent the short-term and long-term EMA groups, determined by filling the area between the maximum and minimum EMAs in each group.
The GMMA Toolkit goes a step further and includes an oscillator that measures the difference between the average short-term and long-term EMAs, providing a clear visual representation of trend strength and direction.
The farther the oscillator is from the 0 level, the stronger the trend. It is plotted on a separate panel with values above zero indicating bullish conditions and values below zero indicating bearish conditions.
The inclusion of the oscillator in the GMMA Toolkit allows traders to identify earlier buy and sell signals based on the GMMA oscillator crossing the zero line compared to traditional crossover methods.
Lastly, the GMMA Toolkit features compression dots that indicate periods of market consolidation.
By measuring the spread between the maximum and minimum EMAs within both short-term and long-term groups, the indicator identifies when these spreads are significantly narrower than average by comparing the current spread to the average spread over a lookback period.
This visual cue helps traders anticipate potential breakout or breakdown scenarios, enhancing their ability to react to imminent trend changes.
By simplifying the visualization of the Guppy Multiple Moving Averages with clouds, providing earlier buy and sell signals through the oscillator, and highlighting periods of market consolidation with compression dots, this toolkit offers traders insightful tools for navigating market trends and potential reversals.
Give this indicator a BOOST and COMMENT your thoughts below!
We hope you enjoy.
Cheers!
Smoothed Heiken Ashi Candles with Delayed SignalsThis is a trend-following approach that uses a modified version of Heiken Ashi candles with additional smoothing. Here are the key components and features:
1. Heiken Ashi Modification: The strategy starts by calculating Heiken Ashi candles, which are known for better trend visualization. However, it modifies the traditional Heiken Ashi by using Exponential Moving Averages (EMAs) of the open, high, low, and close prices.
2. Double Smoothing: The strategy applies two layers of smoothing. First, it uses EMAs to calculate the Heiken Ashi values. Then, it applies another EMA to the Heiken Ashi open and close prices. This double smoothing aims to reduce noise and provide clearer trend signals.
3. Long-Only Approach: As the name suggests, this strategy only takes long positions. It doesn't short the market during downtrends but instead exits existing long positions when the sell signal is triggered.
4. Entry and Exit Conditions:
- Entry (Buy): When the smoothed Heiken Ashi candle color changes from red to green (indicating a potential start of an uptrend).
- Exit (Sell): When the smoothed Heiken Ashi candle color changes from green to red (indicating a potential end of an uptrend).
5. Position Sizing: The strategy uses a percentage of equity for position sizing, defaulting to 100% of available equity per trade. This should be tailored to each persons unique approach. Responsible trading would use less than 5% for each trade. The starting capital used is a responsible and conservative $1000, reflecting the average trader.
This strategy aims to provide a smooth, trend-following approach that may be particularly useful in markets with clear, sustained trends. However, it may lag in choppy or ranging markets due to its heavy smoothing. As with any strategy, it's important to thoroughly back test and forward test before using it with real capital, and to consider using it in conjunction with other analysis tools and risk management techniques.
Other smoothed Heiken Ashi indicators do not provide buy and sell signals, and only show the change in color to dictate a change in trend. By adding buy and sell signals after the close of the changing candle, alerts can be programmed, which helps this be a more hands off protocol to experiment with. Other smoothed Heiken Ashi indicators do not allow for alarms to be set.
This is a unique HODL strategy which helps identify a change in trend, without the noise of day to day volatility. By switching to a line chart, it removes the candles altogether to avoid even more noise. The goal is to HODL a coin while the color is bullish in an uptrend, but once the indicator gives a sell signal, to sell the holdings back to a stable coin and let the chart ride down. Once the chart gives the next buy signal, use that same capital to buy back into the asset. In essence this removes potential losses, and helps buy back in cheaper, gaining more quantitity fo the asset, and therefore reducing your average initial buy in price.
Most HODL strategies ride the price up, miss selling at the top, then riding the price back down in anticipation that it will go back up to sell. This strategy will not hit the absolute tops, but it will greatly reduce potential losses.
Smoothed Heiken Ashi Strategy Long OnlyThis is a trend-following approach that uses a modified version of Heiken Ashi candles with additional smoothing. Here are the key components and features:
1. Heiken Ashi Modification: The strategy starts by calculating Heiken Ashi candles, which are known for better trend visualization. However, it modifies the traditional Heiken Ashi by using Exponential Moving Averages (EMAs) of the open, high, low, and close prices.
2. Double Smoothing: The strategy applies two layers of smoothing. First, it uses EMAs to calculate the Heiken Ashi values. Then, it applies another EMA to the Heiken Ashi open and close prices. This double smoothing aims to reduce noise and provide clearer trend signals.
3. Long-Only Approach: As the name suggests, this strategy only takes long positions. It doesn't short the market during downtrends but instead exits existing long positions when the sell signal is triggered.
4. Entry and Exit Conditions:
- Entry (Buy): When the smoothed Heiken Ashi candle color changes from red to green (indicating a potential start of an uptrend).
- Exit (Sell): When the smoothed Heiken Ashi candle color changes from green to red (indicating a potential end of an uptrend).
5. Position Sizing: The strategy uses a percentage of equity for position sizing, defaulting to 100% of available equity per trade. This should be tailored to each persons unique approach. Responsible trading would use less than 5% for each trade. The starting capital used is a responsible and conservative $1000, reflecting the average trader.
This strategy aims to provide a smooth, trend-following approach that may be particularly useful in markets with clear, sustained trends. However, it may lag in choppy or ranging markets due to its heavy smoothing. As with any strategy, it's important to thoroughly backtest and forward test before using it with real capital, and to consider using it in conjunction with other analysis tools and risk management techniques.
This has been created mainly to provide data to judge what time frame is most profitable for any single asset, as the volatility of each asset is different. This can bee seen using it on AUXUSD, which has a higher profitable result on the daily time frame, whereas other currencies need a higher or lower time frame. The user can toggle between each time frame and watch for the higher profit results within the strategy tester window.
Other smoothed Heiken Ashi indicators also do not provide buy and sell signals, and only show the change in color to dictate a change in trend. By adding buy and sell signals after the close of the candle in which the candle changes color, alerts can be programmed, which helps this be a more hands off protocol to experiment with. Other smoothed Heiken Ashi indicators do not allow for alarms to be set.
This is a unique HODL strategy which helps identify a change in trend, without the noise of day to day volatility. By switching to a line chart, it removes the candles altogether to avoid even more noise. The goal is to HODL a coin while the color is bullish in an uptrend, but once the indicator gives a sell signal, to sell the holdings back to a stable coin and let the chart ride down. Once the chart gives the next buy signal, use that same capital to buy back into the asset. In essence this removes potential losses, and helps buy back in cheaper, gaining more quantitity fo the asset, and therefore reducing your average initial buy in price.
Most HODL strategies ride the price up, miss selling at the top, then riding the price back down in anticipation that it will go back up to sell. This strategy will not hit the absolute tops, but it will greatly reduce potential losses.
Exponential Smoothing FilterThe digital exponential filter, in finance known as Exponential Moving Average (EMA) , can be used as a technical indicator for chart analysis to visualize uptrends and downtrends in the market. Unlike the classic simple moving average, the EMA requires only two values for its calculation: the last calculated exponential average price and the current price. This is a simple and fast calculation - even for wide smoothing windows. For further details and the math please refer to the "exponential smoothing" article on Wikipedia.
Here are some additional key points about the exponential moving average:
The EMA can react more quickly to price changes because it can give more weight to current prices - depending on your parameter settings.
Short-term, disruptive price fluctuations are smoothed out well, making prevailing trends more visible.
Despite good smoothing properties, it delays the input values slightly, so it can follow sudden trend changes well.
The EMA is well suited to dynamic markets and trading strategies.
The filter is a good basis for further processing such as gradient analysis.
How to use
When you add the script to your charts, you'll immediately see a thin orange line across your time series, smoothing out price fluctuations.
There are only two parameters to set
smoothing factor between 0.0000 = no smoothing and 0.9999 = strong smoothing
input source : open, high, low, close hl2, etc.
Chart output
In the example chart above, you can see that the orange line follows the highs and lows better than the blue line , which is a simple moving average (SMA).
Additionally, the orange line has a shorter lag, or reacts faster when the trend of the original price data suddenly changes. These characteristics are critical for buying and selling decisions: quickly reacting and tracking highs and lows while providing a smooth line that filters out distracting noise.