This is an indicator i created called Sentinel index
Inserted Code
//+------------------------------------------------------------------+
//| Sentinel index.mq4 |
//| Don Perry |
//| www.fxAdvisor.com |
//+------------------------------------------------------------------+
#property copyright "Don Perry"
#property link "www.fxAdvisor.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int LineStyle=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
double Buff[];
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,3,Red);
SetIndexBuffer(0,Buff);
string short_name="Sentinel index";
IndicatorShortName(short_name);
SetIndexLabel(0,"Sentinel index");
// SetIndexDrawBegin(0,50);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
double dir[7];
for(int x=8000;x>=0;x--){
dir[0]=iClose("EURUSD",Period(),x+1)-iClose("EURUSD",Period(),x)*1000;
dir[1]= iClose("USDJPY",Period(),x)-iClose("USDJPY",Period(),x+1)*1;
dir[2]=iClose("USDCHF",Period(),x)-iClose("USDCHF",Period(),x+1)*1000;
dir[3]=iClose("GBPUSD",Period(),x+1)-iClose("GBPUSD",Period(),x)*1000;
dir[4]=iClose("AUDUSD",Period(),x+1)-iClose("AUDUSD",Period(),x)*1000;
dir[5]=iClose("NZDUSD",Period(),x+1)-iClose("NZDUSD",Period(),x)*1000;
dir[6]=iClose("USDCAD",Period(),x)-iClose("USDCAD",Period(),x+1)*1000;
// Comment(dir[0]+"\n"+dir[1]+"\n" +dir[2]+"\n"+dir[3] );
double total=0.0;
for(int i =0;i<7;i++)
{
total+=dir[i];
}
double avg = total/7;
Buff[x]=avg;
}
//----
return(0);
}
//+------------------------------------------------------------------+