View Single Post
  #9 (permalink)  
Old 12-13-2007, 05:03 PM
pipimo88 pipimo88 is offline
Currency Trader
 
Join Date: Sep 2007
Posts: 2
pipimo88 is on a distinguished road
Default

Attached is the ADR indicator I'm using and I found this script by "icm63" about excluding Sunday data (he's using this on MA cross indi). I tried inserting the code below into my indicator (attached), but it's not working.

Anyone have any idea how to combine script (below) with the attached indicator, in order to make an "ADR_No_Sunday_Bar" indicator.
---------------------------------------------------------------------------------------------------------------------
TempBuffer3 = Is just a bunch of close data
BufferAVE = Is array that ends up on chart

for(i=0; i<limit; i++)
{
if(No_Sundays ==true)
{
int z = 0;
int HLsum = 0;
for(int x = i; x < i + (Period * 2); x++)
{
if(SundayCheck(x) !=0)
{
HLsum += TempBuffer3[x];
z =z+ 1;
//if(i ==0) Print(x, " ", z);
}
if(z >= Period) break;
}
BufferAVE[i] = NormalizeDouble(HLsum/z,0);
}
else
BufferAVE[i]=iMAOnArray(TempBuffer3,Bars,Period,0,MODE_SMA,i);
}

//Sunday check
int SundayCheck(int Index)
{
datetime data = iTime(NULL, PERIOD_D1, Index);
return(TimeDayOfWeek(data));
}
-------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance for any help.
Attached Files
File Type: mq4 ADR_SL-NoLine.mq4 (13.3 KB, 1133 views)
Reply With Quote