//+------------------------------------------------------------------+ //| 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 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 = ""; } }