[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [EquisMetaStock Group] metastock coding help



PureBytes Links

Trading Reference Links



Nikhil,

You're correct the code is not working correctly.  Try the following instead.

For 30 minutes:

X:= input("X",0,390,0);

L30:= If(Cum(1)<X, C, If(DayOfWeek() <> Ref(DayOfWeek(),-1), L, If(Hour() =10 AND Minute() <25,
Min(PREV,L), If(Hour() >15, C, PREV))));

H30:= If(Cum(1)<X, C, If(DayOfWeek() <> Ref(DayOfWeek(),-1),H ,If(Hour() =10 AND Minute() <25,
Max(PREV,H), If(Hour() >15, C, PREV))));
L30;
H30;


For 60 minutes:

X:= input("X",0,390,0);

L60:= If(Cum(1)<X, C, If(DayOfWeek() <> Ref(DayOfWeek(),-1), L, If(Hour() =10 AND Minute() <55,
Min(PREV,L), If(Hour() >15, C, PREV))));

H60:= If(Cum(1)<X, C, If(DayOfWeek() <> Ref(DayOfWeek(),-1), H, If(Hour() =10 AND Minute() <55,
Max(PREV,H), If(Hour() >15, C, PREV))));
L60;
H60;

I added the "If(Hour() >15, C," statement and the indicator seems to work.  You can change the hour number (15) to suit your market.  Also it just occurred to me that if you ever have a shortened trading day like our markets closing at 12 on days before a holiday that this indicator would probably not act correctly.


Pete



To: equismetastock@xxxxxxxxxxxxxxx
From: mahiya001@xxxxxxxxx
Date: Sat, 13 Jun 2009 17:38:54 +0530
Subject: RE: [EquisMetaStock Group] metastock coding help



hi pete,

thnks for ur reply on  my query
i m working on S & P CNX nifty (india) which starts @ 9.55 in morning.
but this indicator is not working fine, actually it shouls draw a stright line from
1 - high of first 30 min of day
2 - low of first 30 min of the day
and these two lines ( high & low) should remain straight through out the day.
code supplied by you properly catches the high and low point ( to draw a line ) but this line should be straight for whole day. My observation is that most of the time this 30 min high and low acts as the support / resistance, so if the line is deviating from the high / low points then the premise behind line does not holds correct.

nikhil

--- On Sat, 13/6/09, Pete Lieber <plieber@xxxxxxxxxxxnet> wrote:

From: Pete Lieber <plieber@xxxxxxxxxxxnet>
Subject: RE: [EquisMetaStock Group] metastock coding help
To: "EquisMetastock" <equismetastock@yahoogroups..com>
Date: Saturday, 13 June, 2009, 9:27 AM

Try this, it should work:

H30:= IF(DAYOFWEEK( ) <> REF(DAYOFWEEK( ),-1), H, IF(HOUR() <= 1000, MAX(H,PREV), PREV));
L30:= IF(DAYOFWEEK( ) <> REF(DAYOFWEEK( ),-1), L, IF(HOUR() <= 1000, MIN(L,PREV), PREV));
H30;
L30;


Your first hour High and Low code doesn't look right.  See if this works.  I can't see why not.  If it doesn't let me know and I'll have to add another "IF" statement

H60:= IF(DAYOFWEEK( ) <> REF(DAYOFWEEK( ),-1), H, IF(HOUR() = 1000 AND MINUTE() <=30, MAX(H,PREV), PREV));
L60:= IF(DAYOFWEEK( ) <> REF(DAYOFWEEK( ),-1), L, IF(HOUR() = 1000 AND MINUTE() <=30, MIN(L,PREV), PREV));
H60;
L60;

Note: you didn't say what market you want this code was for.  The above code assumes the market opens at 930.  If the market you follow opens at a different hour let me know.

Pete




To: equismetastock@ yahoogroups. com
From: mahiya001@xxxxxx com
Date: Fri, 12 Jun 2009 09:50:24 +0530
Subject: [EquisMetaStock Group] metastock coding help



hi the following coding gives the high and low values of the first hour of the day.
can u please give me code for hoe to code it for first 30 minutes of the day

H1st:=ValueWhen( 1,Hour()* 100+Minute( )=1000,H) ;
L1st:=ValueWhen( 1,Hour()* 100+Minute( )=1000,L) ;
H1st;
L1st;

Regards
Nikhil



Explore and discover exciting holidays and getaways with Yahoo! India Travel Click here!


Own a website.Get an unlimited package.Pay next to nothing.* Click here!.


__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___