Author: xbox forex
xb4f

This trading indicator is designed to provide visual signals and real-time alerts based on the interaction between two distinct moving averages. By analyzing the relationship between "Fast" and "Slow" price trends, it identifies specific moments of momentum shifts to help traders spot potential entry or exit points.

Core Logic & Mechanics

The tool functions by monitoring two different types of moving averages simultaneously:

  • The Fast Moving Average: This reacts quickly to recent price changes, capturing immediate market sentiment.
  • The Slow Moving Average: This tracks the broader price trend over a longer duration, filtering out minor market "noise."

The script looks for specific patterns where these two lines intersect or cross each other. Rather than just looking for a simple touch, the logic requires a confirmed "crossover" event. For example:

  • Buy Signals: The script identifies when the Fast Moving Average moves from below to above the Slow Moving Average. This suggests that short-term momentum is turning bullish.
  • Sell Signals: The script identifies when the Fast Moving Average drops from above to below the Slow Moving Average, indicating that short-term momentum is turning bearish.

Visual Indicators and Alerts

To make these signals actionable for a user, the script employs several features:

  • On-Chart Markers: When the logic detects a confirmed crossover, it places colored arrows directly on your trading chart. This allows you to see historical signals at a glance.
  • Dynamic Alert System: If the user chooses to enable sound alerts, the script will monitor the very latest price action (the current "live" candle).
  • Smart Notifications: To prevent "alert fatigue," the system is programmed to trigger only once per candle. It monitors for a specific cross and sends a popup notification stating whether the trend is moving up or down, along with the specific currency pair and timeframe you are currently viewing.

Summary of Use

Essentially, this script acts as an automated "scout." It constantly compares fast-paced price movement against the long-term trend. When these two forces clash and result in a crossover, the script highlights the moment visually on your chart and can provide an immediate audible alert to notify you of a potential change in market direction.

Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
13 Views
1 Downloads
0 Favorites
xb4f

#property copyright "xbox forex"
#property link      "http://community.strangled.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Yellow

double g_ibuf_76[];
double g_ibuf_80[];
extern int FasterMA = 18;
extern int SlowerMA = 34;
extern bool SoundON = FALSE;
double g_time_96;
double gd_104;
double gd_112;
string gs_xb4a_120 = "xb4a";
string gs_xb4b_128 = "xb4b";

int init() {
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, g_ibuf_80);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double l_icustom_12;
   double l_icustom_20;
   double l_icustom_28;
   double l_icustom_36;
   double l_icustom_44;
   double l_icustom_52;
   int li_60 = IndicatorCounted();
   if (li_60 < 0) return (-1);
   if (li_60 > 0) li_60--;
   int li_0 = Bars - li_60;
   for (int l_index_4 = 0; l_index_4 <= li_0; l_index_4++) {
      l_icustom_12 = iCustom(NULL, 0, gs_xb4b_128, FasterMA, 0, l_index_4);
      l_icustom_28 = iCustom(NULL, 0, gs_xb4b_128, FasterMA, 0, l_index_4 + 1);
      l_icustom_44 = iCustom(NULL, 0, gs_xb4b_128, FasterMA, 0, l_index_4 - 1);
      l_icustom_20 = iCustom(NULL, 0, gs_xb4a_120, SlowerMA, 2, l_index_4);
      l_icustom_36 = iCustom(NULL, 0, gs_xb4a_120, SlowerMA, 2, l_index_4 + 1);
      l_icustom_52 = iCustom(NULL, 0, gs_xb4a_120, SlowerMA, 2, l_index_4 - 1);
      if (l_icustom_12 > l_icustom_20 && l_icustom_28 < l_icustom_36 && l_icustom_44 > l_icustom_52) g_ibuf_76[l_index_4] = (l_icustom_20 + l_icustom_12) / 2.0;
      else
         if (l_icustom_12 < l_icustom_20 && l_icustom_28 > l_icustom_36 && l_icustom_44 < l_icustom_52) g_ibuf_80[l_index_4] = (l_icustom_20 + l_icustom_12) / 2.0;
      if (SoundON == TRUE && l_index_4 == 1 && g_ibuf_76[l_index_4] > g_ibuf_80[l_index_4] && g_time_96 != Time[0]) {
         Alert("Fast MA ", gd_104, " Crossed down Main MA", gd_112, " Price going Down on ", Symbol(), " ", Period());
         g_time_96 = Time[0];
      }
      if (SoundON == TRUE && l_index_4 == 1 && g_ibuf_76[l_index_4] < g_ibuf_80[l_index_4] && g_time_96 != Time[0]) {
         Alert("Fast MA ", gd_104, " Crossed up Main MA", gd_112, " Price going Up on ", Symbol(), " ", Period());
         g_time_96 = Time[0];
      }
   }
   return (0);
}

Comments