Fx Sensor I_

Download script
Author: Copyright � 2008, Eracash.com.
Fx Sensor I_

This indicator is designed to provide traders with a filtered visual representation of market momentum by combining two distinct types of technical analysis: the Commodity Channel Index (CCI) and a smoothed filtering technique known as a T3 moving average.

Core Logic Overview

The script functions by taking standard market price data and processing it through three distinct layers to identify trends and potential reversals. Here is how that logic flows:

1. Initial Momentum Detection (CCI) The script begins by calculating the Commodity Channel Index (CCI). The CCI is a momentum-based oscillator that measures how far the current price of an asset is deviating from its average price. In this context, it serves as the raw "sensor" for market volatility and direction.

2. Multi-Stage Smoothing (The T3 Filter) Rather than showing the raw, often jagged CCI data—which can produce many false signals—the script subjects the data to a sophisticated smoothing process. It utilizes a series of weighted calculations (based on the "T3" logic) that involve several layers of internal memory.

  • It takes the current value and blends it with previous values using specific coefficients.
  • This "multi-pass" approach ensures that the resulting line is significantly smoother than a standard moving average, helping to strip away market "noise" while maintaining a responsive curve that follows the price closely.

3. Dynamic Signal Separation Once the final smoothed value is calculated, the script splits this information into three separate visual components for the user:

  • The Main Trend Line: This displays the primary smoothed momentum value, providing a clear picture of the prevailing market strength.
  • Positive Momentum Histogram: This isolates and highlights only the positive values of the calculation. When this appears, it indicates bullish sentiment or upward pressure.
  • Negative Momentum Histogram: This isolates and highlights only the negative values. When this appears, it indicates bearish sentiment or downward pressure.

Summary for the User

Essentially, this tool acts as a "smart filter." It captures the raw speed of price movement (CCI), cleans out the erratic spikes using a high-performance smoothing algorithm (T3), and then presents the results in a way that clearly separates upward trends from downward trends. This allows a trader to see the "true" direction of market momentum more clearly than by looking at standard price candles alone.

Indicators Used
Commodity channel index
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
12 Views
0 Downloads
0 Favorites
Fx Sensor I_
/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2008, Eracash.com."
#property link      "http://www.eracash.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Blue
#property indicator_color3 Red

extern int CCI_Period = 15;
extern int T3_Period = 5;
extern double b = 0.618;
double gd_92;
double gd_100;
double gd_108;
double gd_116;
double gd_124;
double gd_132;
double gd_140;
double gd_148;
double gd_156;
double gd_164;
double gd_172;
double gd_180;
double gd_188;
double gd_196;
double gd_204;
double g_ibuf_212[];
double g_ibuf_216[];
double g_ibuf_220[];

int init() {
   SetIndexBuffer(0, g_ibuf_212);
   SetIndexBuffer(1, g_ibuf_216);
   SetIndexBuffer(2, g_ibuf_220);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_HISTOGRAM);
   SetIndexStyle(2, DRAW_HISTOGRAM);
   IndicatorShortName("Fx Sensor I (c) Eracash.com");
   SetIndexLabel(0, "FXST3CCI");
   SetIndexLabel(1, NULL);
   SetIndexLabel(2, NULL);
   gd_196 = b * b;
   gd_204 = gd_196 * b;
   gd_140 = -gd_204;
   gd_148 = 3.0 * (gd_196 + gd_204);
   gd_156 = -3.0 * (2.0 * gd_196 + b + gd_204);
   gd_164 = 3.0 * b + 1.0 + gd_204 + 3.0 * gd_196;
   gd_172 = T3_Period;
   if (gd_172 < 1.0) gd_172 = 1;
   gd_172 = (gd_172 - 1.0) / 2.0 + 1.0;
   gd_180 = 2 / (gd_172 + 1.0);
   gd_188 = 1 - gd_180;
   return (0);
}

int start() {
   /*bool l_bool_0 = IsDemo();
   if (!l_bool_0) {
      Alert("You can not use the program with a real account!");
      return (0);
   }*/
   int li_8 = IndicatorCounted();
   if (li_8 < 0) return (-1);
   if (li_8 > 0) li_8--;
   int li_4 = Bars - li_8;
   for (int li_12 = Bars - 1; li_12 >= 0; li_12--) {
      g_ibuf_212[li_12] = iCCI(NULL, 0, CCI_Period, PRICE_TYPICAL, li_12);
      gd_92 = gd_180 * g_ibuf_212[li_12] + gd_188 * gd_92;
      gd_100 = gd_180 * gd_92 + gd_188 * gd_100;
      gd_108 = gd_180 * gd_100 + gd_188 * gd_108;
      gd_116 = gd_180 * gd_108 + gd_188 * gd_116;
      gd_124 = gd_180 * gd_116 + gd_188 * gd_124;
      gd_132 = gd_180 * gd_124 + gd_188 * gd_132;
      g_ibuf_212[li_12] = gd_140 * gd_132 + gd_148 * gd_124 + gd_156 * gd_116 + gd_164 * gd_108;
      if (g_ibuf_212[li_12] >= 0.0) g_ibuf_216[li_12] = g_ibuf_212[li_12];
      else g_ibuf_216[li_12] = 0;
      if (g_ibuf_212[li_12] < 0.0) g_ibuf_220[li_12] = g_ibuf_212[li_12];
      else g_ibuf_220[li_12] = 0;
   }
   return (0);
}

Comments