OzFx Signals v1.7_v1
Download scriptThis script is designed as a multi-currency monitoring dashboard for the MetaTrader 4 platform. Its primary purpose is to scan a customizable list of currency pairs simultaneously and display real-time trading signals directly on your main chart. Instead of making you switch between different charts or timeframes, it gathers data from multiple sources and presents "Long" (Buy) or "Short" (Sell) opportunities in organized columns.
Core Functionality
1. Multi-Pair Scanning The script allows you to input a specific list of currency pairs (e.g., EURUSD, USDJPY, etc.). It then processes these pairs individually, calculating various technical indicators for each one in the background.
2. Three Distinct Signal Methods The dashboard categorizes its information into three different logic types:
- Original OzFX Signals: This is the primary monitoring method. It looks for specific momentum and trend crossovers. It can be optionally filtered by a Moving Average (MA), ensuring that signals only appear if they align with the overall long-term market direction.
- AES Signals: A secondary, alternative calculation method that uses different combinations of technical indicators to confirm trade entries. Like the Original method, this can also be filtered by a Moving Average to ensure higher accuracy.
- Squeeze-More Signals: This logic is specifically designed for a different timeframe (defaulting to the 4-hour chart). It identifies periods where market volatility is "squeezed" and ready to break out, providing signals based on specific momentum thresholds.
3. Integrated Technical Filters To ensure the signals are high-quality, the script utilizes several layers of technical analysis:
- Trend Filtering: Uses Moving Averages (MA) to confirm if the market is moving in your favor.
- Momentum Analysis: Employs Stochastic oscillators to determine if a move has enough strength to be viable.
- Volatility Tracking: Incorporates ATR (Average True Range) data, which is displayed next to each signal to show the current "stretch" or volatility of the pair.
Visual Dashboard Layout
The script organizes these findings into a clean, readable interface on your screen:
- Header Titles: Clearly labels the three different signal categories and the specific timeframes being analyzed for each.
- Dynamic Columns: Signals are neatly stacked in columns. Each entry shows the currency pair name, its current volatility (ATR), and the trade direction (Long or Short).
- Live Countdown: Includes a "Time Till Next Bar" feature that provides a real-time countdown, letting you know exactly how many minutes remain until the current price candle closes.
Summary of User Experience
For a trader, this tool acts as a "command center." By looking at one single chart, you can see the status of up to 24 different currency pairs at once. It filters through complex math (stochastics, averages, and momentum shifts) and simply tells you which pairs are showing active "Long" or "Short" setups across three different trading philosophies.
//+------------------------------------------------------------------+
//| OzFX Signals.mq4 |
//| Copyright © 2008, Daud |
//| http://www.ozfx.com.au |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Daud"
#property link "http://www.ozfx.com.au/"
/*
== Updates ==
03/03/08:: by lac_raz. Separate indicator window and signal maximum 20 pairs
03/03/08:: v1.1 Modified by ydaudw. Add more signal maximum 24 pairs. Integrate with main chart.
03/04/08:: v1.2 Modified by ydaudw. Add more parameter for filtering Original Method and when
signal was generate.
03/07/08:: v1.3 Modified by ydaudw. Some update & bug fixed.
03/08/08:: v1.4 Modified by ydaudw. Give options to customize period and fix some bugs.
03/17/08:: v1.5 Modified by ydaudw. Show when the next bar emerge and fix AES duplication signal.
03/24/08:: v1.6 Modified by ydaudw. Add Squeeze-More signal.
03/25/08:: v1.7 Modified by ydaudw. Give options to customize period, filter and fix some bugs.
*/
#property indicator_chart_window
//----
extern string PairsList="EURUSD,EURGBP,EURCHF,USDJPY,AUDUSD,EURJPY,GPBUSD,USDCAD,USDCHF,NZDUSD,CHFJPY,CADJPY,EURAUD,EURCAD,GBPCHF,AUDJPY,AUDNZD";//- This is where you add the currency pairs you want
extern string SymbolSuffix="";//- If your broker names the currency pairs with a suffix for a mini account (like an "m", for example), enter the suffix here
extern bool ShowTimeTillNextBar=True;
extern bool ShowAESSignal=True;
extern bool Show4HoursSqueezeMore=True;
extern bool SMAFilterOriginal=False;//- Filter Original Method with SMA
extern bool SMAFilterAES=False;//- Filter AES Method with SMA
extern int SMAFilterPeriod=200;
extern int StochKPeriod=5;
extern int StochDPeriod=3;
extern int StochSlowing=3;
extern int ATRPeriod=5;
extern int OriginalAndAESTF=1440;//- Original & AES Signal Timeframe: 1, 15, 30, 60, 240 - Default is Daily (D1)
extern int SqueezeMoreTF=240;//- Squeeze-More Timeframe: 1, 15, 30, 60, 240 - Default is H4
//----
string Pair[24]; //Pairs array
int SymNo;
int k;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
string short_name="OZFXPAIRS";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
int i,j,k;
string Cur;
for(i=0, j=0, k=1; i<24 && k>0;)
{
k=StringFind(PairsList,",",j);
if (k==0) Cur=StringSubstr(PairsList,j,0);
else Cur=StringSubstr(PairsList,j,k-j);
//----
Pair[i]=Cur;
i++;
j=StringFind(PairsList,",",j)+1;
if (j==0) break;
}
SymNo=i;
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
string aesPairs[24];
string ozfxRegPairs[24];
string sqzmorePairs[24];
int i,k,regindex,aesindex,sqzindex;
//----
for(i=0,regindex=0,aesindex=0,sqzindex=0;i<SymNo;i++)
{
string currPair=Pair[i]+SymbolSuffix;
/*------------------*/
/* Variable Begin */
/*------------------*/
double AC0=iAC(currPair,OriginalAndAESTF,0);
double AC1=iAC(currPair,OriginalAndAESTF,1);
double AO0=iAO(currPair,OriginalAndAESTF,0);
double AO1=iAO(currPair,OriginalAndAESTF,1);
string ATR=DoubleToStr(iATR(currPair,OriginalAndAESTF,ATRPeriod,0),5);
double STM=iStochastic(currPair,OriginalAndAESTF,StochKPeriod,StochDPeriod,StochSlowing,MODE_SMA,0,MODE_MAIN,0);
double STS=iStochastic(currPair,OriginalAndAESTF,StochKPeriod,StochDPeriod,StochSlowing,MODE_SMA,0,MODE_SIGNAL,0);
bool AboveMA=iClose(currPair,OriginalAndAESTF,0) > iMA(currPair,OriginalAndAESTF,SMAFilterPeriod,0,MODE_SMA,PRICE_CLOSE,0);
bool BelowMA=iClose(currPair,OriginalAndAESTF,0) < iMA(currPair,OriginalAndAESTF,SMAFilterPeriod,0,MODE_SMA,PRICE_CLOSE,0);
double AC04=iAC(currPair,SqueezeMoreTF,0);
double AC14=iAC(currPair,SqueezeMoreTF,1);
double AO04=iAO(currPair,SqueezeMoreTF,0);
double AO14=iAO(currPair,SqueezeMoreTF,1);
double STM4=iStochastic(currPair,SqueezeMoreTF,5,3,4,MODE_SMA,0,MODE_MAIN,0);
double STS4=iStochastic(currPair,SqueezeMoreTF,5,3,4,MODE_SMA,0,MODE_SIGNAL,0);
string ATR4=DoubleToStr(iATR(currPair,SqueezeMoreTF,ATRPeriod,0),5);
/*---------------------*/
/* OZFX REGULAR CODE */
/*---------------------*/
if (SMAFilterOriginal)
{
if (AC0 > 0 && AC1 < 0 && AC0 > AC1 && STM > 50 && AboveMA)
{
ozfxRegPairs[regindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Long";
regindex++;
}
if (AC0 < 0 && AC1 > 0 && AC0 < AC1 && STM < 50 && BelowMA)
{
ozfxRegPairs[regindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Short" ;
regindex++;
}
}
else
{
if (AC0 > 0 && AC1 < 0 && AC0 > AC1 && STM > 50)
{
ozfxRegPairs[regindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Long";
regindex++;
}
if (AC0 < 0 && AC1 > 0 && AC0 < AC1 && STM < 50)
{
ozfxRegPairs[regindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Short" ;
regindex++;
}
}
/*-----------------*/
/* OZFX AES CODE */
/*-----------------*/
//if ((AC0 > AC1 && AboveMA && STM > STS) || (AC0 > 0 && AO0 > AO1 && AC0 > AC1 && AboveMA && STM > STS))
if (SMAFilterAES)
{
if (AC0 > AC1 && AboveMA && STM > STS && AO0 > AO1)
{
aesPairs[aesindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Long";
aesindex++;
}
if (AC0 < AC1 && BelowMA && STM < STS && AO0 < AO1)
{
aesPairs[aesindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Short";
aesindex++;
}
}
else
{
if (AC0 > AC1 && STM > STS && AO0 > AO1)
{
aesPairs[aesindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Long";
aesindex++;
}
if (AC0 < AC1 && STM < STS && AO0 < AO1)
{
aesPairs[aesindex]=Pair[i] + " (ATR - " + ATR + ")" + " - Short";
aesindex++;
}
}
/*---------------------*/
/* OZFX SQUEEZE MORE */
/*---------------------*/
if (AC04 > AC14 && AO04 > AO14 && STM4 > STS4 && STM4 > 20 && STM4 < 80)
{
sqzmorePairs[sqzindex]=Pair[i] + " (ATR - " + ATR4 + ")" + " - Long";
sqzindex++;
}
if (AC04 < AC14 && AO04 < AO14 && STM4 < STS4 && STM4 < 80 && STM4 > 20)
{
sqzmorePairs[sqzindex]=Pair[i] + " (ATR - " + ATR4 + ")" + " - Short";
sqzindex++;
}
}
ObjectsDeleteAll(0,OBJ_LABEL);
createTitle();
if (ShowTimeTillNextBar) BarEnd();
//----
int count=regindex; //ArraySize(ozfxRegPairs);
for(k=0;k<count;k++)
{
ObjectCreate("OZFXREG"+k, OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXREG"+k,ozfxRegPairs[k] ,8, "Arial", Black);
ObjectSet("OZFXREG"+k, OBJPROP_CORNER, 0);
ObjectSet("OZFXREG"+k, OBJPROP_XDISTANCE, 10);
ObjectSet("OZFXREG"+k, OBJPROP_YDISTANCE, 42+k*15);
}
if (ShowAESSignal)
{
count=aesindex; //ArraySize(aesPairs);
for(k=0;k<count;k++)
{
ObjectCreate("OZFXAES"+k, OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXAES"+k, aesPairs[k] ,8, "Arial", Black);
ObjectSet("OZFXAES"+k, OBJPROP_CORNER, 0);
ObjectSet("OZFXAES"+k, OBJPROP_XDISTANCE, 180);
ObjectSet("OZFXAES"+k, OBJPROP_YDISTANCE, 42+k*15);
}
}
if (Show4HoursSqueezeMore)
{
count=sqzindex; //ArraySize(sqzmorePairs);
for(k=0;k<count;k++)
{
ObjectCreate("OZFXSM"+k, OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXSM"+k,sqzmorePairs[k] ,8, "Arial", Black);
ObjectSet("OZFXSM"+k, OBJPROP_CORNER, 0);
ObjectSet("OZFXSM"+k, OBJPROP_XDISTANCE, 350);
ObjectSet("OZFXSM"+k, OBJPROP_YDISTANCE, 42+k*15);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void createTitle()
{
ObjectCreate("OZFXREG", OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXREG","Original Ozfx signal ("+TF(OriginalAndAESTF)+")",9, "Arial Bold", DodgerBlue);
ObjectSet("OZFXREG", OBJPROP_CORNER, 0);
ObjectSet("OZFXREG", OBJPROP_XDISTANCE, 10);
ObjectSet("OZFXREG", OBJPROP_YDISTANCE, 25);
if (ShowAESSignal)
{
ObjectCreate("OZFXAES", OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXAES","AES Signal ("+TF(OriginalAndAESTF)+")" ,9, "Arial Bold", DodgerBlue);
ObjectSet("OZFXAES", OBJPROP_CORNER, 0);
ObjectSet("OZFXAES", OBJPROP_XDISTANCE, 180);
ObjectSet("OZFXAES", OBJPROP_YDISTANCE, 25);
}
if (Show4HoursSqueezeMore)
{
ObjectCreate("OZFXSM", OBJ_LABEL, 0, 0, 0);
ObjectSetText("OZFXSM","Squeeze-More Signal ("+TF(SqueezeMoreTF)+")" ,9, "Arial Bold", DodgerBlue);
ObjectSet("OZFXSM", OBJPROP_CORNER, 0);
ObjectSet("OZFXSM", OBJPROP_XDISTANCE, 350);
ObjectSet("OZFXSM", OBJPROP_YDISTANCE, 25);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
ObjectsDeleteAll(0,OBJ_LABEL);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void BarEnd()
{
double i;
int m,s,k;
m=Time[0]+Period()*60-CurTime();
i=m/60.0;
s=m%60;
m=(m-m%60)/60;
//----
ObjectCreate("TIME", OBJ_LABEL, 0, 0, 0);
ObjectSetText("TIME",m + " minutes " + s + " seconds left to bar end",8,"Arial Bold",Lime);
ObjectSet("TIME", OBJPROP_CORNER, 0);
ObjectSet("TIME", OBJPROP_XDISTANCE, 10);
ObjectSet("TIME", OBJPROP_YDISTANCE, 12);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
string TF(int iTF)
{
if (iTF==1) return("M1");
else if (iTF==15) return("M15");
else if (iTF==30) return("M30");
else if (iTF==60) return("H1");
else if (iTF==240) return("H4");
else if (iTF==1440) return("D1");
else if (iTF==10080) return("W1");
}
//+------------------------------------------------------------------+
Comments