DayOfWeek Indicator

 

I need to mark the Friday bars on my chart with an arrow.

The following code snippets mark every bar instead of just Fridays. Setting the buffer ot zero or null does not seem to prevent the arrow from displaying on the chart.

Does anyone have a clue how to mark just the Friday bars?

Also, is there anyway to display the arrow slightly above or below the bars?

SetIndexBuffer(0,Buf_0); // Assigning an array to a buffer
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexEmptyValue(0,0);

counted_bars=IndicatorCounted();
i=Bars-counted_bars-1;

while(i>=0)

{
if(DayOfWeek()==5)
{
Buf_0[i]=Close[i]; // Fridays Close
else
{
Buf_0[i]=0;
}

i--;
}

 

if(DayOfWeek()==5)
change to

if(TimeDay(Time[i]) == 5)

 
phy wrote >>

if(DayOfWeek()==5)
change to

if(TimeDay(Time[i]) == 5)

This code gives me the 5th day of each month. I need to identify Friday of each week.

 

Sorry

Use TimeDayOfWeek().

Reason: