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

Notification

Icon
Error

Options
Go to last post Go to first unread
john_3b2  
#1 Posted : Tuesday, January 31, 2012 7:33:17 PM(UTC)
john_3b2

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/1/2012(UTC)
Posts: 2
Location: India

Hi Experts I need a Formula to get the High and Low in a particular time period, from 10.30am to 1pm, and highlight in different colors. Thanks in advance
wabbit  
#2 Posted : Wednesday, February 1, 2012 4:05:22 PM(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)
Break the project down into parts. First define the time periods and then the second part is to identify the extreme values during this period. Are you looking to highlight all of the highs and lows in realtime or at the end of the period with 20/20 hindsight about what were the extremes? Show us the codes you're working with and we shall help when and where we can. wabbit [:D]
john_3b2  
#3 Posted : Thursday, February 2, 2012 8:46:24 AM(UTC)
john_3b2

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/1/2012(UTC)
Posts: 2
Location: India

Thank you Sir for your reply,

I am newbie to MetaStock Software. This is my first formula what i am trying. Actually i want to analyze a Script by getting the High and Low in a specific time, say between 10am to 10:50am, and if this Script value oscillate in between this High and Low up to a specific time, say up to 11:30am. After 11:30am if a new High/Low crosses the old High/Low (i.e., what we got the High and Low in between 10am to 10:50am) then i should get to Buy/Sell signal. If the first High and Low Bar highlighted in different color it will be nice.

From equis forum i got one formula and trying to modify for my use.

{ Time Inputs }
StHour:=Input("start Hour",0,23,10);
StMin:=Input("start Minute",0,59,00);
EnHour:=Input("last Hour",0,23,10);
EnMin:=Input("last Minute",0,59,50);

{ Time period }
start:=Hour()>StHour
OR Hour()=StHour AND Minute()>=StMin;
end:=Hour()<EnHour
OR Hour()=EnHour AND Minute()<=EnMin;
filter:=
start AND (end OR (start AND Alert(start=0,2)));

{ Start/End time signals }
start:=filter AND Alert(filter=0,2);
end:=filter=0 AND Alert(filter,2);

{ Hi/Lo values }
Hi:=ValueWhen(1,filter,HighestSince(1,start,H));
Lo:=ValueWhen(1,filter,LowestSince(1,start,L));

{ Plot on price chart }
Hi;Lo

Regards
John
henry1224  
#4 Posted : Thursday, February 2, 2012 4:01:50 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Dear John,

I am sorry to inform you that if you intend to use your code in an "expert advisor" to color the bars,
you cannot use inputs in the formulas!

You would have to hard code the input value

can't use this

{ Time Inputs }
StHour:=Input("start Hour",0,23,10);
StMin:=Input("start Minute",0,59,00);
EnHour:=Input("last Hour",0,23,10);
EnMin:=Input("last Minute",0,59,50);

would be this

{ Time Inputs }
StHour:=10;
StMin:=00;
EnHour:=10;
EnMin:=59;


sorry for the Dear John Letter
wabbit  
#5 Posted : Thursday, February 2, 2012 4:30:26 PM(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)
Instead of just copying other people's codes, read through the MS user manual and do the exercises in the free Equis formula primer, then you'll be in a better position to understand how to modify existing codes to suit your purposes. 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.