Found this on the Net :
This indicator has been written for those who want to use Monthly closing or any other monthly price element in their formula's. Indicator provides you a clear curve for each day of monthly closing or according to your required price element. The advantage of this indicator is, you can analyse the daily price chart with monthly curve.
Coding:
{Variables}
x1:=Input("[1]Open [2]High [3]Low [4]Close [5]Vol",1,5,4);
xx:=Input("Nth Periods",1,365,1);
{Data Array}
x1:=If(x1=1,O,If(x1=2,H,If(x1=3,L,If(x1=4,C,If(x1=5,V,C)))));
{Logic}
x:=If(DayOfMonth() <= Ref(DayOfMonth() ,-1),1,0);
{Out put}
(ValueWhen(xx,x>0,Ref(x1,-1)))