MT5 Indicator with alerts and labels for HTF Engulfing or HTF Hammer/Shooting Star Bar Play (EHBP) with Multi-Timeframe Validation

Job finished

Execution time 8 days

Specification

Only apply if you have experience in building multitimeframe indicator. Do not use any software to generate the code automatically.

Code should be concise and proper as per best practices and typed by you.


MQL5 Indicator Requirements: HTF Engulfing or HTF Hammer/Shooting Star Bar Play (EHBP) with Multi-Timeframe Validation


1. Input Parameters

Timeframe Selection

  • Higher Timeframe (HTF):

    • Options:  1 Month ,  1 Week ,  1 Day ,  8 Hour ,  4 Hour ,  2 Hour ,  1  Hour , 15 Minute

    • Default:  1 Day

  • Lower Timeframe (LTF):

    • Options:  1 Month ,  1 Week ,  1 Day ,  8 Hour ,  4 Hour ,  2 Hour ,  1  Hour , 15 Minute

    • Default:  4 Hour

  • Validation:

    • Ensure  LTF < HTF  (e.g., if HTF= 4 Hour , LTF cannot be  8 Hour ).

    • Show error message and disable calculations if invalid.


2. Core Logic

Step 1: Detect HTF Engulfing or Hammer Candle closure + PO3 Signals

  • Bullish Signal (HTF candle):

    • low < previous low   AND   close > previous open AND close >  Previous close  AND   close in Lower Timeframe above  retracement level of selected Fib after breaching below it in lower timeframe but closing above it in lower timeframe candle . Its not necessary that the HTF candle High will be above the high of its previous candle. Still it should be considered if other conditions are met.

  • Bearish Signal (HTF candle):

    • high > previous high  AND  close < previous open AND CLOSE < PREV close  AND   close in Lower Timeframe below retracement level of selected Fib after breaching above it in lower timeframe but closing below it in lower timeframe candle

      Its not necessary that the HTF candle Low will be below the low of its previous HTF candle. Still it should be considered if other conditions are met.

Step 2: Calculate Retracement Levels

For each HTF signal, compute Fibonacci levels as per selection multiple Fib levels can be selected like 26 percent, 38 percent, 50%, 61.8 percent etc:

  • Bullish:

    Copy

    25% = HTF High - (HTF High - HTF Low) * 0.25 38.2% = HTF High - (HTF High - HTF Low) * 0.382 50% = (HTF High + HTF Low) / 2 ...

  • Bearish:

    Copy

    25% = HTF Low + (HTF High - HTF Low) * 0.25 38.2% = HTF Low + (HTF High - HTF Low) * 0.382 ...

Step 3: Track LTF Candle Closes

For each LTF candle close:

  • Bullish Signal Check:
    If LTF candle:

    • Breached below a retracement level (intra-candle  low < level ).

    • Closed above the same level ( close > level ).
      → Trigger alert/label.

  • Bearish Signal Check:
    If LTF candle:

    • Breached above a retracement level (intra-candle  high > level ).

    • Closed below the same level ( close < level ).
      → Trigger alert/label.


3. Visualization & Alerts

Labels

  • Display only after LTF candle closes and conditions are met.

  • Format:

    • EBP [Level] Held (LTF)

    • Example:  EBP 38.2% Held (4H)

  • Placement:

    • Below/above the LTF candle that triggered the condition.

Retracement Lines

  • Plot horizontal lines for all active levels.

  • Color Coding:

    • Bullish: Shades of green.

    • Bearish: Shades of red.

Alerts

  • Trigger only after LTF candle closes. Give meaningful alerts which are descriptive and easy to understand. Print symbol name in alerts. In Chart labels show small labels like Green Up traingle for Bullish Setup and Red down triangle for Bearish setup.

  • Message Examples:

    • XAUUSD Bullish 38.2% Level Held on 4H LTF on 1 Day HTF at time 09:00 AM Swing Low in LTF price is 2912.

    • XAUUSD Bearish 61.8% Level Held on 2H LTF on 1 Day HTF  at time 02:00 PM Swing High in LTF price is 2952.


4. Technical Implementation

Key Functions

  1. Timeframe Validation:

    mql5
    Copy

    bool validateTimeframes() { int htfMinutes = convertToMinutes(htfInput); int ltfMinutes = convertToMinutes(ltfInput); return (ltfMinutes < htfMinutes); }

  2. Track Active Signals:
    Use arrays/structs to store:

    • HTF signal type (bullish/bearish).

    • Retracement levels.

    • Corresponding LTF candle timestamps.

  3. Check LTF Closes:

    mql5 code example just for reference

    void checkLTFCloses() {  
      for (int i = 0; i < arraySize(activeSignals); i++) {  
        // Get retracement levels for signal[i]  
        for (int j = 0; j < levelsCount; j++) {  
          double level = activeSignals[i].levels[j];  
          if (isBullish) {  
            bool breached = ltfLow < level;  
            bool closedAbove = ltfClose > level;  
            if (breached && closedAbove) triggerAlert();  
          } else {  
            bool breached = ltfHigh > level;  
            bool closedBelow = ltfClose < level;  
            if (breached && closedBelow) triggerAlert();  
          }  
        }  
      }  
    }  

No Repainting

  • All labels/alerts are tied to closed LTF candles (confirmed price action).


5. Example Workflow

  1. HTF Signal: Bullish Engulfing + PO3 on  1D  candle.

  2. Calculate Levels: 25% = 1900, 38.2% = 1850, 50% = 1800.

  3. LTF Candle (4H):

    • Candle 1: Low = 1845 (breaches 38.2%), Close = 1855 → Triggers alert/label.

    • Candle 2: Close = 1895 (no breach) → No action.

  4. Labels: Display  EBP 38.2% Held (4H)  below Candle 1 after it closes.


6. Deliverables

  1. Indicator Code:

    • .mq5  file with input validation, multi-timeframe logic, and alerts. Source code and executable both for MT5. Strategy should work in Strategy tester also when replaying.

  2. Documentation:

    • Clear comments explaining HTF/LTF interaction. Inline comments and Header comments.

  3. Testing:

    • Verify on  EURUSD  (HTF=1D, LTF=4H). XAUUSD, USOIL, US30, BTCUSD on various timeframe combinations.

    • Ensure labels/alerts never repaint.






Example of 50% fib retracement after a Bearish Engulfing HTF candle.











































Responded

1
Developer 1
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
2
Developer 2
Rating
(104)
Projects
169
24%
Arbitration
23
9% / 78%
Overdue
16
9%
Working
3
Developer 3
Rating
(3)
Projects
4
0%
Arbitration
0
Overdue
0
Free
4
Developer 4
Rating
(64)
Projects
77
55%
Arbitration
4
0% / 50%
Overdue
1
1%
Working
Published: 6 codes
5
Developer 5
Rating
(14)
Projects
14
14%
Arbitration
8
0% / 88%
Overdue
2
14%
Loaded
6
Developer 6
Rating
(9)
Projects
11
18%
Arbitration
4
0% / 100%
Overdue
4
36%
Free
7
Developer 7
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
8
Developer 8
Rating
(312)
Projects
559
35%
Arbitration
79
32% / 43%
Overdue
203
36%
Working
9
Developer 9
Rating
(2)
Projects
3
0%
Arbitration
8
13% / 88%
Overdue
1
33%
Free
Similar orders
Pro firm setup 30+ USD
Hi, I am starting a futures prop firm. Are you able to help me get data feed for this with no delays and can handle many traders on the platform. Additionally, are you able to handle charts for us
Mam kody EA Bot. Chciałbym je dokończyć, dopracować i ukończyć projekty. Chciałbym otrzymać pliki SET po ukończeniu EA. Jeśli jesteś zainteresowany, skontaktuj się ze mną. Szukam doświadczonego programisty do stworzenia dedykowanego doradcy eksperckiego (EA) do tradingu. Programista powinien posiadać solidną wiedzę z zakresu MT5, logiki strategii, wskaźników, zarządzania ryzykiem i backtestingu. Doświadczenie w
I am looking for an experienced developer to create a custom Expert Advisor (EA) for trading. The developer should have strong knowledge of MT4/MT5, strategy logic, indicators, risk management, and backtesting. Experience in building reliable and professional trading robots is preferred. Please contact me if you have done similar projects before. 9817724000
5.20buy-20.5sell 50 - 1000 USD
⸻ 🧠 Professional AI Prompt (Clear English Version) Act as a professional algorithmic trading engineer with deep expertise in developing automated trading systems for TradingView and MetaTrader. You have strong knowledge of market behavior, trend analysis, and risk management. Your task is to design a fully automated trading strategy based on the following requirements: ⸻ 🎯 Entry Conditions: • Open a BUY trade
I need a skilled MQL5 developer to build a fully functional Expert Advisor (EA) for MetaTrader 5 based on a simple but strict trading strategy. The EA will use EMA 50/200 trend detection combined with breakout and retest logic for entries. It must operate only during London and New York sessions and include solid risk management (fixed % risk, SL/TP, trade limits, and basic protection rules). APPLY ONLY IF YOU HAVE
VWAP BB Sniper EA Quantum VWAP Scalper SmartFlow FX Bot Institutional Edge EA 🧠 PRODUCT OVERVIEW VWAP + Bollinger Bands Auto Trading System A high-precision forex scalping bot designed to capture institutional price movements using: VWAP (fair value tracking) Bollinger Bands (volatility & entry timing) 👉 Built for fast, consistent intraday profits
Hello traders, I have Quantum queen v3.52, which is the latest version, available for $500 only. The price on the platform is around $1800, but I am offering it for a much lower price for serious buyers. Details: Product: Quantum queen Version: v3.52 Price: $500 Condition: Serious buyers only
EA for prop firms 30 - 500 USD
Hi, I am looking to purchase a MT5 EA that can show consistent profitability 5% each month with drawdown less than 9%. I am not ready to build a new one from scratch as i do not have the strategy in mind yet so i do not want to take the risk of building one but not sure if it works. Only apply if you have an existing proven and tested EA that can sell to me together with the source code. The Ea is for prop firm even
Early Killer EA 30+ USD
It must have automated stop loss. Something that can end poverty and kill the market early.It must take the trades for me whenever I start it it must work on tradeport ea
I WANT TO CONVERT MY INDICATOR TO ROBOT, BUT I DONT HAVE THE SOURCE CODE , THE PROGRAMMER WILL DEVELOP THE SOURCE CODE FOR THE JOB. THE STRAGY IS SIMPLE , THE ROBOT WILL EXECUTE A TRADE WHEN THE SIGNAL FROM THE INDICATOR APPEARS. BUY SIGNAL IS WHEN THE ARROW APPEAS ON THE LOWER ZONE ( SUPPORT ZONE) SELL SIGNAL WHEN THE ARROW APPEARS ON THE UPPER ZONE ( RESISTANCE ZONE).THE ROBOT WILL HAVE THE FOLLWING FEATURES (1)

Project information

Budget
30+ USD
Deadline
from 1 to 2 day(s)