Freeway - All1_v1

Author: Copyright � 2006, Eli hayun
Freeway - All1_v1

Overview

The Freeway indicator is a market analysis tool designed to identify strong, multi-timeframe momentum across various major currency pairs. Its primary purpose is to scan the forex market for "clear roads"—situations where multiple timeframes align in the same direction, suggesting a high-confidence trend.

How It Works

The script operates by monitoring a specific list of currency pairs and analyzing them through four different time horizons simultaneously: 15-minute, 30-minute, 1-hour, and 4-hour charts.

For each currency pair, the tool calculates a momentum value (CCI) for each of these four timeframes. The logic follows a strict "all-or-nothing" rule to determine market sentiment:

  • Bullish Signal ("Up"): If the momentum is positive across all four timeframes simultaneously, the indicator identifies the road as clear for an upward move.
  • Bearish Signal ("Down"): If the momentum is negative across all four timeframes simultaneously, the indicator identifies the road as clear for a downward move.

Key Features and Behavior

  • Automated Scanning: The tool automatically refreshes its data every 15 minutes. It checks the entire list of currencies (or just your current active currency, depending on your settings) to see which "roads" are currently open.
  • Visual & Audio Alerts: When a trend aligns perfectly across all timeframes for a specific currency, the system triggers an immediate audible alert and a visual pop-up notification on your screen. This allows you to react quickly to high-momentum shifts without having to manually check multiple charts.
  • Smart Filtering: To prevent constant repetitive notifications, the script remembers the last direction it alerted for each currency. It will only trigger a new alarm if the trend actually changes (e.g., moving from an "Up" signal to a "Down" signal).
  • On-Screen Status: The tool provides real-time text updates on your chart, displaying the current momentum values for every timeframe being monitored.

Summary for Traders

Think of this indicator as a "traffic monitor" for the forex market. Instead of looking at one chart and guessing the direction, it looks at four different views at once. If all four views agree, the "Freeway" is open, indicating a strong trend with significant momentum across short-term and long-term perspectives.

Indicators Used
Commodity channel index
Miscellaneous
It issuies visual alerts to the screenIt plays sound alerts
8 Views
0 Downloads
0 Favorites
Freeway - All1_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                Freeway - All.mq4 |
//|                                      Copyright © 2006, Eli hayun |
//|                                          http://www.elihayun.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Eli hayun"
#property link      "http://www.elihayun.com"

#property indicator_chart_window
//---- input parameters
extern int       CCI_Value=50;
extern bool      UseCurrentCurrency = false;

string Currencies[] = {"AUDUSD","CHFJPY","EURAUD","EURCAD","EURCHF","EURGBP",
                       "EURJPY","EURUSD","GBPCHF","GBPJPY","GBPUSD","USDCAD",
                       "USDCHF","USDJPY"};

string   Alerted[] = {"","","","","","","","","","","","","",""};
string sComment = "", sCurrComment = "";

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   bool GoCheck;
   // For every 15 minutes check if the freeway is open (all > 0 or all < 0)
   if (NewBar())
   {
      sComment = "";
      for (int ii=0; ii<ArraySize(Currencies); ii++)
      {
         GoCheck = !UseCurrentCurrency;
         if (UseCurrentCurrency)
            if (Symbol() == Currencies[ii])
               GoCheck = true;
               
         if (GoCheck)
         {
            CheckFreeway(Currencies[ii],ii);      
            if (sCurrComment != "")
               sComment = sCurrComment + "\n" + sComment;
         }
      }
      if (sComment != "")
         Comment(sComment);
   }
   return(0);
  }
//+------------------------------------------------------------------+

bool NewBar()
{
   static datetime dt = 0;
   if (iTime(NULL, PERIOD_M15, 0) != dt)
   {
      dt = iTime(NULL, PERIOD_M15, 0);
      return(true);
   }
   return(false);
}

void CheckFreeway(string Curr, int idx)
{
   int cci[4];
   int tf[4] = {PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H4};
   string  tfName[4] = {"M15", "M30", "H1", "H4"};
   string sDir = "";
   
   sCurrComment = Curr + ": ";
   
   for (int ii=0; ii<4; ii++)
   {
      double c = iCCI(Curr, tf[ii], CCI_Value, PRICE_TYPICAL, 0);
      sCurrComment = sCurrComment + " " + tfName[ii] + ": " + DoubleToStr(c,4);
      cci[ii] = -1;
      if (c > 0) cci[ii] = 1;
      if (c < 0) cci[ii] = 0;
   }
   
   // If all values in cci[] are 1 - go up 
   // If all values in cci[] are 0 - go down
   if (cci[0] + cci[1] + cci[2] + cci[3] == 4)
      sDir = "Up";
   if (cci[0] + cci[1] + cci[2] + cci[3] == 0)
      sDir = "Down";
      
   if (sDir != "" && (Alerted[idx] != sDir))
   {
      Alert("Freeway: ", Curr, " road clear to go ", sDir);
      PlaySound("alert1.wav");
      Alerted[idx] = sDir;
   } else {
      sCurrComment = "";
   }
}

Comments