logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
nick1334  
#1 Posted : Thursday, November 22, 2012 11:22:29 PM(UTC)
nick1334

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/26/2011(UTC)
Posts: 5

Hi all,

Below is the MIDAS formula for intra day S/R bands. Its been given in the book "MIDAS technical analysis".

I am trying to copy the formula in metastock 11 but its showing error can some body please help to correctly put it in metastock formula.

sm:= Input("starting month",1,12,1);
sd:= Input("starting day of month",1,31,1);
sy:= Input("starting year",1980,2100,2000);
sh:=Input("hour", 1,24,1);
se:=Input("minute",0,60,0);
start:= sd=DayOfMonth() AND sm=Month() AND sy=Year() AND sh=Hour() AND se=Minute();
x:=Input("Price Field,1=O,2=H,3=L,4 =C,5= MP ()",1,5,4 );
y:=If( x =l,O,If(x=2,H,If(x=3,L,If(x=4,C,
If(x=5,MP(),0)))));
ab:=y*V;
denom:=If(Cum(V)-ValueWhen(1,start,Cum(V))=0,l,Cum(V)-
ValueWhen(l,start,Cum(V)));

If(BarsSince (start),(Cum(ab)-ValueWhen(1,start,Cum(ab)))/denom,MP())

here i am facing the problem:
ValueWhen(l,start,Cum(V)));

"the variable of expression must contain only constant data"

kindly help.





wabbit  
#2 Posted : Friday, November 23, 2012 1:41:18 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Change the lower case 'L' in the ValueWhen() expression to '1' (one)


wabbit [:D]


Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.