ThreeCombo_v2
Download scriptThe ThreeCombo script is a custom technical analysis tool designed to provide visual clarity on market trends by synthesizing three distinct types of financial data: price momentum, strength, and relative cycles. Instead of relying on a single piece of information, this indicator looks for "confluence"—a situation where multiple different mathematical models agree on the same direction before signaling a potential move.
How the Logic Works
The script operates by constantly monitoring three core technical components simultaneously:
- Moving Averages (Trend Direction): It compares a fast-moving average against a slower one. This determines the immediate "flow" of the price, identifying whether the trend is currently leaning upward or downward.
- RSI (Relative Strength Index): This measures the speed and change of price movements. The script looks at whether the momentum is currently over the midpoint, helping to confirm if the current buying or selling pressure has enough "gas" behind it.
- ADX (Average Directional Index): This is used to measure the actual strength of a trend. It specifically looks at "Plus" and "Minus" directional movements to see which side is dominating the price action.
Visual Signals
The indicator translates these three complex calculations into a simple, color-coded histogram that appears in a separate window on your chart. It categorizes every market candle into one of three distinct states:
- Buy Signal (Green): This appears only when all three components—the Moving Averages, the RSI, and the ADX—all align perfectly to suggest an upward trend. The green histogram represents a high-confidence "Buy" zone where momentum, strength, and trend are in harmony.
- Sell Signal (Red): Conversely, this appears only when all three components align to suggest a downward trend. The red histogram marks areas where the data suggests a unified move toward lower prices.
- Chill Zone (Yellow): This is arguably the most useful feature for risk management. If the indicators are not in perfect agreement (for example, if the price is moving up but the strength is weak, or vice versa), the script identifies this as a "Chill" zone. The yellow histogram tells you that the market is currently indecisive or lacks a clear direction, suggesting it may be safer to stay out of a trade.
Summary for the User
By using this tool, you are moving away from "guessing" based on one line on a chart. Instead, you are looking for a "Triple Confirmation." You only see a Green signal when the trend is up, the momentum is strong, and the directional power confirms it. If you see Yellow, it serves as a visual warning that the conditions aren't perfect yet, helping you avoid entering trades during choppy or uncertain market phases.
//+------------------------------------------------------------------+
//| ThreeCombo_v2.mq4 |
//| Oje Uadia |
//| moneyinthesack@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Oje Uadia"
#property link "moneyinthesack@yahoo.com"
#property indicator_separate_window
#property indicator_minimum 1
#property indicator_maximum 100
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Yellow
//---- input parameters
extern int short_ma=5;
extern int long_ma=10;
extern int rsi_period=21;
extern int adx_period=14;
//---- buffers
double buy[];
double sell[];
double chill[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
SetIndexBuffer(0,buy);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
SetIndexBuffer(1,sell);
SetIndexEmptyValue(1,0.0);
SetIndexStyle(2,DRAW_HISTOGRAM,0,2);
SetIndexBuffer(2,chill);
SetIndexEmptyValue(2,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if (Bars<0)
return (-1);
if (counted_bars>0)
counted_bars--;
int limit = Bars-counted_bars;
int i;
for (i=0;i<limit;i++)
{
int ma_status;
int rsi_status;
int adx_status;
int trade;
double height = iADX(Symbol(),0,adx_period,0,MODE_MAIN,i);
double fast_ma = iMA(Symbol(),0,short_ma,0,1,0,i);
double slow_ma = iMA(Symbol(),0,long_ma,0,1,0,i);
double rsi = iRSI(Symbol(),0,rsi_period,0,i);
double plusd = iADX(Symbol(),0,adx_period,0,MODE_PLUSDI,i);
double minusd = iADX(Symbol(),0,adx_period,0,MODE_MINUSDI,i);
if(fast_ma>slow_ma)
ma_status=1;
else
ma_status=2;
if (rsi>50)
rsi_status=1;
else
rsi_status=2;
if (plusd>minusd)
adx_status=1;
else
adx_status=2;
if (ma_status==1 && rsi_status==1 && adx_status==1)
buy[i]=height;
else
buy[i]=0.0;
if (ma_status==2 && rsi_status==2 && adx_status==2)
sell[i]=height;
else
sell[i]=0.0;
if (ma_status==1 && rsi_status==1 && adx_status==1)
trade=1;
else
if (ma_status==2 && rsi_status==2 && adx_status==2)
trade=2;
else trade = 3;
if (trade==3)
chill[i]=height;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments