MTF EHMA & HMA Insights [FibonacciFlux]MTF EHMA & HMA Insights
Overview
The Multi-Timeframe EHMA, HMA, and Midline with Fill script is a powerful technical analysis tool designed for traders seeking to enhance their market insights and decision-making processes. By integrating two advanced moving averages—Exponential Hull Moving Average (EHMA) and Hull Moving Average (HMA)—along with a dynamic midline, this indicator provides a comprehensive view of market trends across multiple timeframes.
Key Features
1. Dual Moving Averages
- Exponential Hull Moving Average (EHMA) :
- Offers a rapid response to price changes, making it particularly useful for identifying short-term trends.
- Utilizes a unique calculation method that reduces lag, allowing traders to react quickly to market movements.
- Hull Moving Average (HMA) :
- Known for its smoothness and ability to filter out noise, the HMA presents a clear picture of the underlying trend.
- The HMA is specifically designed to achieve a balance between responsiveness and smoothness, enabling traders to make informed decisions.
2. Midline Calculation
- Dynamic Midline (m) :
- The midline is calculated as the average of EHMA and HMA, providing a neutral reference point for evaluating price movements.
- It visually represents market sentiment; a rising midline suggests bullish conditions, while a declining midline indicates bearish trends.
3. Visual Components
- Fill Areas :
- Color-coded fills between the EHMA and HMA enhance visual clarity by indicating the relative position of these moving averages.
- The fill color dynamically changes based on the relationship between the two averages (green for EHMA below HMA and red for EHMA above HMA), allowing traders to quickly assess market conditions.
4. Signal Generation and Alerts
- Buy/Sell Signals :
- The indicator generates buy signals when the midline crosses above its previous value, indicating a potential upward trend.
- Conversely, sell signals are triggered when the midline crosses below its previous value, suggesting a possible downward movement.
- Alert Conditions :
- Built-in alerts notify traders in real-time when significant changes occur, allowing them to act swiftly on potential trading opportunities.
- Customizable alert messages ensure traders receive relevant information tailored to their strategies.
Technical Details
Input Parameters
- Timeframe Settings :
- Traders can customize the timeframes for both EHMA and HMA, enabling them to adapt the indicator to different trading styles and market conditions.
- Length Settings :
- Adjustable lengths for both moving averages impact their sensitivity, allowing traders to optimize their performance based on volatility and market dynamics.
Plotting and Visualization
- Plotting :
- The script plots the EHMA, HMA, and midline directly on the chart for easy visualization.
- Signal labels (BUY and SELL) are displayed prominently, helping traders to identify potential entry and exit points without ambiguity.
Benefits
1. Clarity and Insight
- The combination of EHMA, HMA, and midline provides a clear and concise visual representation of market trends, aiding traders in making informed decisions.
2. Flexibility
- Customizable parameters allow traders to tailor the indicator to their specific needs, making it suitable for various market conditions and trading styles.
3. Efficiency
- Real-time alerts and visual signals minimize response times, enabling traders to capitalize on opportunities as they arise.
4. Enhanced Trading Conditions
- When utilizing the Fibonacci number 144 on a daily chart, the indicator facilitates optimal trading conditions:
- "The entry was made before the bubble began, using 144 as the Fibonacci variable."
- "The exit occurred right before the bubble burst, or alternatively, a short position was initiated."
- "When the next bubble started, a long entry was made again."
- "Despite some lag, the position was exited and a long entry was made."
- "The exit or short entry took place at the second double top peak."
- "A short position was already established before the double top formation occurred."
- On a 4-hour chart, traders can effectively set stop losses at HMA levels, achieving a risk-reward ratio between 4 and 8.
- Additionally, analyzing the 15-minute chart with a multi-timeframe approach allows for more precise entry points.
Conclusion
The Multi-Timeframe EHMA, HMA, and Midline with Fill script is a robust tool for traders looking to enhance their technical analysis capabilities. By combining multiple moving averages with a dynamic midline and alert system, this indicator offers a comprehensive approach to understanding market trends. Its flexibility, clarity, and efficiency make it an invaluable asset for both novice and experienced traders alike.
Important Note
As with any trading tool, it is crucial to conduct thorough analysis and risk management when using this indicator. Past performance does not guarantee future results, and traders should always be prepared for potential market fluctuations.
Profitfactor
Replica of TradingView's Backtesting Engine with ArraysHello everyone,
Here is a perfectly replicated TradingView backtesting engine condensed into a single library function calculated with arrays. It includes TradingView's calculations for Net profit, Total Trades, Percent of Trades Profitable, Profit Factor, Max Drawdown (absolute and percent), and Average Trade (absolute and percent). Here's how TradingView defines each aspect of its backtesting system:
Net Profit: The overall profit or loss achieved.
Total Trades: The total number of closed trades, winning and losing.
Percent Profitable: The percentage of winning trades, the number of winning trades divided by the total number of closed trades.
Profit Factor: The amount of money the strategy made for every unit of money it lost, gross profits divided by gross losses.
Max Drawdown: The greatest loss drawdown, i.e., the greatest possible loss the strategy had compared to its highest profits.
Average Trade: The sum of money gained or lost by the average trade, Net Profit divided by the overall number of closed trades.
Here's how each variable is defined in the library function:
_backtest(bool _enter, bool _exit, float _startQty, float _tradeQty)
bool _enter: When the strategy should enter a trade (entry condition)
bool _exit: When the strategy should exit a trade (exit condition)
float _startQty: The starting capital in the account (for BTCUSD, it is the amount of USD the account starts with)
float _tradeQty: The amount of capital traded (if set to 1000 on BTCUSD, it will trade 1000 USD on each trade)
Currently, this library only works with long strategies, and I've included a commented out section under DEMO STRATEGY where you can replicate my results with TradingView's backtesting engine. There's tons I could do with this beyond what is shown, but this was a project I worked on back in June of 2022 before getting burned out. Feel free to comment with any suggestions or bugs, and I'll try to add or fix them all soon. Here's my list of thing to add to the library currently (may not all be added):
Add commission calculations.
Add support for shorting
Add a graph that resembles TradingView's overview graph.
Clean and optimize code.
Clean up in a way that makes it easy to add other TradingView calculations (such as Sharpe and Sortino ratio).
Separate all variables, so they become accessible outside of calculations (such as gross profit, gross loss, number of winning trades, number of losing trades, etc.).
Thanks for reading,
OztheWoz