Metastock Indicator Formula |
Monthly Price Element / Closing Curve |
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.
For selecting price element you only need to point out the specific number of the price element that which you want for finding values.
Through Scrolling 'Nth periods' (for preceding number of months) you will get specific monthly periods closing or required price element.
For Exploration purposes you only need to delete all narrations of variable portion and then correct output portion by writing '1' instead of 'xx' and by writing ‘close’ or required element of the price section.
|
Formula: |
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))) |
|
|