Thanks for your help. I try to rewrite the code but I am very clumsy !!!
function Lastfriday ()
{
Daysinmonth = IIf( Month() == 1 OR Month() == 3 OR Month() == 5 OR Month() == 7 OR
Month() == 8 OR Month() == 10 OR Month() == 12, 31, 30 );
Daysinmonthfeb = IIf( Year() % 4 == 0 AND Year() % 100 != 0, 29, 28 );
Daysinmonthfinal = IIf( Month() == 2, Daysinmonthfeb, Daysinmonth );
returnvalue = IIf( Daysinmonthfinal - Day() < 7 AND DayOfWeek() == 5, 1, 0 );
Friday = 5
return returnvalue;
}
if ( Showfriday )
{PlotShapes( IIf( Lastfriday(), shapeSmallCircle, shapeNone ), colorWhite, 0, L, -20 );
}
Plot(Lastfriday(),"Expiry Day",colorGreen,styleHistogram|styleOwnScale);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
.