HA-T3_Signal_AO_HA_TL_4H_Bars

Download script
HA-T3_Signal_AO_HA_TL_4H_Bars

This tool is designed to provide a visual summary of market conditions by synthesizing data from multiple advanced technical indicators. Rather than looking at a single price movement, it aggregates information from several different types of analysis—specifically trend following, momentum, and price smoothing—to generate clear signals on your chart.

How the Logic Works

The script functions by scanning historical data to identify specific "confluence" moments. It looks for instances where three distinct types of market conditions align simultaneously:

  • Trend Identification: The tool references a "TrendLord" analysis to determine the overarching direction of the market. It specifically checks for active buy or sell signals while ensuring that opposing signals are absent, helping to filter out conflicting data.
  • Momentum Analysis: It incorporates an Awesome Oscillator (AO) calculation. This allows the tool to understand the strength behind a price move, ensuring that a trend isn't just moving sideways but has actual momentum.
  • Price Smoothing (Heiken Ashi): The logic uses Heiken Ashi calculations to filter out "market noise." By comparing the open and close prices of these smoothed candles, the tool can more accurately identify whether the current sentiment is bullish or bearish.

Visual Output

The script processes all this information and translates it into three distinct visual bars in a separate window:

  1. Bullish Signals (Blue): A signal is triggered when the price smoothing shows an upward movement, the momentum oscillator is positive, and the trend analysis confirms a valid buy state without any sell interference.
  2. Bearish Signals (Crimson): A signal is triggered when the price smoothing shows a downward movement, the momentum oscillator is negative, and the trend analysis confirms a valid sell state without any buy interference.
  3. Neutral/No Signal (Gold): If neither of the above conditions are met—meaning the market is not showing a clear, high-confluence move in either direction—the indicator marks this as a neutral zone.

By combining these three layers of verification, the tool aims to highlight high-probability trading zones where trend, momentum, and price action are all moving in the same direction.

Indicators Used
Bill Williams Awesome oscillator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
HA-T3_Signal_AO_HA_TL_4H_Bars
//+------------------------------------------------------------------+
//|                                                       SRM-TL.mq4 |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+


#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 3
#property indicator_color1 Crimson
#property indicator_color2 MediumBlue
#property indicator_color3 Gold
//---- input parameters


//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
string TimeFrameStr;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
  SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,5,Crimson);
  SetIndexBuffer(0,ExtMapBuffer1);
  SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,5, MediumBlue);
  SetIndexBuffer(1,ExtMapBuffer2);
  SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,5, Gold);
  SetIndexBuffer(2,ExtMapBuffer3);


  IndicatorShortName("HAT34H");  

 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----

for (int i = 0; i < 2500; i++){
   ExtMapBuffer1[i]=0;
   ExtMapBuffer2[i]=0;
   ExtMapBuffer3[i]=0;

      double tlbuy=iCustom(NULL,PERIOD_H4,"TrendLord",50,1,i);
      double tlsell=iCustom(NULL,PERIOD_H4,"TrendLord",50,2,i); 
      
// if (iAO(Symbol(), 0, 0) >= iAO(Symbol(), 0, 1)) AoColour = green;
//   else AoColour = red;

      double aobuy=iAO(Symbol(),PERIOD_H4,i);
      double aosell=iAO(Symbol(),PERIOD_H4,i);

      double haOpen = iCustom(NULL,PERIOD_H4,"Heiken Ashi",2,i);
      double haClose = iCustom(NULL,PERIOD_H4,"Heiken Ashi",3,i);         
  
//      double wbuy=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,6,i);
//      double wsell=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,7,i);
 
  
//   if((haOpen<haClose && (tlbuy>0 && tlsell==EMPTY_VALUE) && wbuy!=EMPTY_VALUE)) ExtMapBuffer2[i] = 1;
   if((haOpen<haClose && (aobuy > 0) && (tlbuy > 0 && tlsell==EMPTY_VALUE))) ExtMapBuffer2[i] = 1;
//   if((haOpen>haClose && (tlbuy==EMPTY_VALUE && tlsell>0)&& wsell!=EMPTY_VALUE ))ExtMapBuffer1[i] = 1;
   if((haOpen>haClose && (aosell < 0)&& (tlsell > 0 && tlbuy==EMPTY_VALUE)))ExtMapBuffer1[i] = 1;
   if (ExtMapBuffer2[i]==0 && ExtMapBuffer1[i]==0) ExtMapBuffer3[i]=1;  
 
}
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments