FDM Fast Trend

Author: Copyright � 2008, Forex Day Monster
FDM Fast Trend

This script functions as a technical analysis tool designed to track and visualize price trends in real-time. Rather than simply looking at the raw price of an asset, it processes historical price data to identify the underlying momentum and "strength" of a trend, displaying the results as a histogram in a separate window.

Core Logic and Functionality

Trend Calculation and Smoothing The script works by calculating the difference between consecutive closing prices. It then applies a series of weighted mathematical operations (similar to moving average principles) to these differences. This helps filter out "market noise"—the minor, insignificant fluctuations in price—to reveal whether the market is genuinely moving in a specific direction.

Momentum Assessment The tool evaluates the velocity of price movement. It specifically looks at how much the price has moved over a certain period compared to the volatility of that same period. This allows the script to determine not just if the price is moving, but how strongly it is moving.

Dynamic Scaling A key feature of this logic is its ability to normalize data. It takes the calculated momentum and scales it into a standardized range (between 0 and 100). This makes it easier for a user to see relative strength at a glance, as the indicator remains consistent regardless of how large or small the actual price of the asset is.

Trend Classification (The Visual Output) The script categorizes the market movement into three distinct visual states represented by different colors:

  • Positive Momentum (Lime): When the calculated trend shows clear upward strength, it is highlighted to signal a bullish environment.
  • Negative Momentum (Red): When the trend shows clear downward strength, it is highlighted to signal a bearish environment.
  • Neutral/Flat Market (Gray): If the price movement is stagnant or lacks sufficient momentum to be classified as a clear trend, the script displays a neutral gray bar.

User Experience Features

  • Historical Depth: The tool is designed to look back at thousands of historical bars to ensure the trend calculation is based on a substantial amount of data.
  • Trial Security: The script includes a built-in expiration date. If the current date exceeds the hardcoded limit, the tool will trigger an alert and cease operation until a full version is authorized.
  • Visual Clarity: By displaying the information as a histogram in a separate window, it allows traders to see the "health" of the trend independently of the main price chart, providing a cleaner perspective on market sentiment.
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
14 Views
0 Downloads
0 Favorites
FDM Fast Trend
/*
 
*/
#property copyright "Copyright © 2008, Forex Day Monster"
#property link      " http://www.forexprofitmonster.com"

#property indicator_separate_window
#property indicator_minimum -1.0
#property indicator_maximum 1.0
#property indicator_buffers 3
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Gray
#property indicator_width1 5

int gi_76 = 13;
extern int CountBars = 3000;
double g_ibuf_84[];
double g_ibuf_88[];
double g_ibuf_92[];
int gi_96;
int g_count_100;
int gi_104;
bool gi_108;
int g_ind_counted_112;
datetime g_time_116;
datetime g_time_120;
datetime g_time_124;
double gd_128;
double gd_136;
double gd_144;
double gd_152;
double gd_160;
double gd_168;
double gd_176;
double gd_184;
double gd_192;
double gd_200;
double gd_208;
double gd_216;
double gd_224;
double gd_232;
double gd_240;
double gd_248;
double gd_256;
double gd_264;
double gd_272;
double gd_280;
double gd_288;
double gd_296;
double gd_304;
double gd_320;
double gd_328;
double gd_336;
double gd_344;
double gd_352;
double gd_360;
double gd_368;
double gd_376;
double gd_384;
double gd_392;
double gd_400;
double gd_408;
double gd_416;
double gd_424;

int init() {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID);
   SetIndexBuffer(0, g_ibuf_84);
   SetIndexBuffer(1, g_ibuf_88);
   SetIndexBuffer(2, g_ibuf_92);
   IndicatorShortName("FDM Fast Trend (" + gi_76 + ")");
   SetIndexDrawBegin(0, Bars - CountBars);
   SetIndexDrawBegin(1, Bars - CountBars);
   SetIndexDrawBegin(2, Bars - CountBars);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
   if (gi_76 - 1 >= 5) gi_104 = gi_76 - 1;
   else gi_104 = 5;
   gd_416 = 3 / (gi_76 + 2.0);
   gd_424 = 1.0 - gd_416;
   return (0);
}

int start() {
   string ls_0 = "2015.11.01";
   int l_str2time_8 = StrToTime(ls_0);
   if (TimeCurrent() >= l_str2time_8) {
      Alert(" Trial version has expired! Email support@forexprofitmonster.com with broker account number for rights to full version!");
      return (0);
   }
   g_ind_counted_112 = IndicatorCounted();
   if (g_ind_counted_112 < 0) return (-1);
   if (g_ind_counted_112 > gi_76) gi_96 = Bars - g_ind_counted_112 - 1;
   else gi_96 = Bars - gi_76 - 1;
   g_time_124 = Time[gi_96 + 1];
   if (g_time_124 != g_time_116 && gi_96 < Bars - gi_76 - 1) {
      if (g_time_124 == g_time_120) {
         gd_320 = gd_208;
         gd_328 = gd_216;
         gd_336 = gd_224;
         gd_344 = gd_232;
         gd_352 = gd_240;
         gd_360 = gd_248;
         gd_368 = gd_256;
         gd_376 = gd_264;
         gd_384 = gd_272;
         gd_392 = gd_280;
         gd_400 = gd_288;
         gd_408 = gd_296;
      } else return (-1);
   }
   if (gi_76 - 1 >= 5) gi_104 = gi_76 - 1;
   else gi_104 = 5;
   gd_416 = 3 / (gi_76 + 2.0);
   gd_424 = 1.0 - gd_416;
   while (gi_96 >= 0) {
      if (g_count_100 == 0) {
         g_count_100 = 1;
         gi_108 = FALSE;
      } else {
         if (g_count_100 >= gi_104) g_count_100 = gi_104 + 1;
         else g_count_100++;
         gd_136 = Close[gi_96] - (Close[gi_96 + 1]);
         gd_192 = MathAbs(gd_136);
         gd_320 = gd_424 * gd_320 + gd_416 * gd_136;
         gd_328 = gd_416 * gd_320 + gd_424 * gd_328;
         gd_176 = 1.5 * gd_320 - gd_328 / 2.0;
         gd_336 = gd_424 * gd_336 + gd_416 * gd_176;
         gd_344 = gd_416 * gd_336 + gd_424 * gd_344;
         gd_144 = 1.5 * gd_336 - gd_344 / 2.0;
         gd_352 = gd_424 * gd_352 + gd_416 * gd_144;
         gd_360 = gd_416 * gd_352 + gd_424 * gd_360;
         gd_152 = 1.5 * gd_352 - gd_360 / 2.0;
         gd_368 = gd_424 * gd_368 + gd_416 * gd_192;
         gd_376 = gd_416 * gd_368 + gd_424 * gd_376;
         gd_160 = 1.5 * gd_368 - gd_376 / 2.0;
         gd_384 = gd_424 * gd_384 + gd_416 * gd_160;
         gd_392 = gd_416 * gd_384 + gd_424 * gd_392;
         gd_184 = 1.5 * gd_384 - gd_392 / 2.0;
         gd_400 = gd_424 * gd_400 + gd_416 * gd_184;
         gd_408 = gd_416 * gd_400 + gd_424 * gd_408;
         gd_168 = 1.5 * gd_400 - gd_408 / 2.0;
         if (g_count_100 <= gi_104 && gd_136 != 0.0) gi_108 = TRUE;
         if (g_count_100 == gi_104 && gi_108 == FALSE) g_count_100 = 0;
      }
      if (g_count_100 > gi_104 && gd_168 > 0.0000000001) {
         gd_128 = 50.0 * (gd_152 / gd_168 + 1.0);
         if (gd_128 > 100.0) gd_128 = 100.0;
         if (gd_128 < 0.0) gd_128 = 0.0;
      } else gd_128 = 50.0;
      gd_304 = gd_128 / 50.0 - 1.0;
      if (gi_96 == 1) {
         g_time_120 = Time[1];
         g_time_116 = Time[0];
         gd_208 = gd_320;
         gd_216 = gd_328;
         gd_224 = gd_336;
         gd_232 = gd_344;
         gd_240 = gd_352;
         gd_248 = gd_360;
         gd_256 = gd_368;
         gd_264 = gd_376;
         gd_272 = gd_384;
         gd_280 = gd_392;
         gd_288 = gd_400;
         gd_296 = gd_408;
      }
      gd_200 = gd_304 - (g_ibuf_84[gi_96 + 1]) - (g_ibuf_88[gi_96 + 1]) - (g_ibuf_92[gi_96 + 1]);
      g_ibuf_84[gi_96] = 0.0;
      g_ibuf_88[gi_96] = 0.0;
      g_ibuf_92[gi_96] = 0.0;
      if (gd_200 > 0.0) g_ibuf_84[gi_96] = gd_304;
      else {
         if (gd_200 < 0.0) g_ibuf_88[gi_96] = gd_304;
         else g_ibuf_92[gi_96] = gd_304;
      }
      gi_96--;
   }
   return (0);
}

Comments