Trinity-Impulse
Download scriptThis script, known as the Trinity-Impulse, is a custom technical analysis tool designed to help traders identify significant market movements by combining momentum and price strength. Instead of looking at just one type of data, it filters out "market noise" by requiring two different mathematical conditions to be met simultaneously before it signals an active trend.
How the Logic Works
The indicator functions by analyzing three distinct layers of market data:
1. Momentum Tracking The tool first calculates the Commodity Channel Index (CCI). This helps the script understand the current "velocity" of the price—essentially determining if the asset is moving significantly above or below its average range.
2. Strength Measurement Simultaneously, the script calculates a smoothed version of market "Force." This measures the weight and volume behind the price action. By using a weighted average, the tool prioritizes more recent price data to ensure it reflects what is happening right now rather than outdated information.
3. The Triple Filter (The Logic Gate) This is where the "Trinity" logic comes into play. For the indicator to show a signal, the script performs a multi-step verification:
- The Threshold Check: It multiplies the Momentum value by the Force value. If the result of this calculation does not reach a specific pre-set level (the "Level" setting), the tool remains neutral and shows no signal. This prevents the indicator from reacting to tiny, insignificant price flickers.
- Directional Alignment: Once the threshold is met, the script checks if both values are moving in the same direction.
- If both Momentum and Force are positive, it identifies a bullish impulse (represented as 1).
- If both Momentum and Force are negative, it identifies a bearish impulse (represented as -1).
- If they disagree or are zero, no signal is shown.
Summary for the Trader
In plain terms, this script acts as a "quality control" filter for your charts. It ignores small price movements and only highlights moments where there is both high velocity and high weight behind a move. When the blue line on your chart moves away from zero, it indicates that the market has reached a sufficient level of power to justify a trend in that specific direction.
/*------------------------------------------------------------------+
| Trinity-Impulse.mq4 |
| basisforex@gmail.com |
+------------------------------------------------------------------*/
#property copyright "Copyright © 2010, basisforex@gmail.com"
//----
#property indicator_separate_window
//----
#property indicator_buffers 1
#property indicator_color1 Blue
//----
extern int nPeriod = 5;
extern int nLevel = 34;
//----
double c[];
double f[];
double iCF[];
//+------------------------------------------------------------------+
int init()
{
string short_name;
IndicatorBuffers(3);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, iCF);
SetIndexBuffer(1, c);
SetIndexBuffer(2, f);
short_name = "Trinity-Impulse("+nPeriod+")";
IndicatorShortName(short_name);
SetIndexLabel(0, short_name);
SetIndexDrawBegin(0, nPeriod);
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int counted_bars = IndicatorCounted();
int j;
j = Bars - nPeriod - 1;
if(counted_bars >= nPeriod) j = Bars - counted_bars - 1;
while(j >= 0)
{
c[j] = iCCI(NULL, 0, nPeriod, PRICE_WEIGHTED, j);
f[j] = iForce(NULL, 0, nPeriod, MODE_LWMA, PRICE_WEIGHTED, j);
//-----
if(c[j] * f[j] >= nLevel)
{
if(c[j] > 0 && f[j] > 0)
{
iCF[j] = 1;
}
if(c[j] < 0 && f[j] < 0)
{
iCF[j] = -1;
}
}
else iCF[j] = 0;
j--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments