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

Notification

Icon
Error

Options
Go to last post Go to first unread
dieselpr  
#1 Posted : Saturday, July 30, 2005 12:30:46 AM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

Can anyone tell me how I can find the lowest low value in the time frames below? I need to find the low for each time period. Day1:=Dayofweek()>0; Time1:=If(hour()>=00 AND hour()<=8 AND Day1,1,0); Time2:=If(hour()>=9 AND hour()<=16 AND Day1,2,0); Time3:=If(hour()>=17 AND hour()<24 AND Day1,3,0);
Patrick  
#2 Posted : Saturday, July 30, 2005 12:59:29 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Not sure what day1 does ... Anyways a quick answer would be for time one: ValueWhen(1,Hour()=8 and Minute()=0,LowestSince(1,Hour()=0 and minute()=0,L)) Patrick :mrgreen:
dieselpr  
#3 Posted : Saturday, July 30, 2005 4:03:31 AM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

Thanks Pat, Day1 is just a place holder right now until I figure out what days I want to trade on. I'm not sure if this setup would work Pat I guess I didn't explain it clear enough. What I want to do is use the time session Time1, Time2, and Time3 to get the lowest low from the following session. ex.- If I'm trading in session 1 or Time1 I want to know the lowest loe from Time3 and if I'm trading in Session 2 or Time2 I want to use the lowest low from session 1 or Time1. Is this possible?
Patrick  
#4 Posted : Saturday, July 30, 2005 3:51:50 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Try something like that ... Day1:=Dayofweek()>0; Time1:=hour()>=00 AND hour()<=8 AND Day1; Time2:=hour()>=9 AND hour()<=16 AND Day1; Time3:=hour()>=17 AND hour()<24 AND Day1; V1:=ValueWhen(1,Hour()=8 and Minute()=0,LowestSince(1,Hour()=0 and minute()=0,L)); V2:=ValueWhen(1,Hour()=16 and Minute()=0,LowestSince(1,Hour()=8 and minute()=0,L)); V3:=ValueWhen(1,Hour()=24 and Minute()=0,LowestSince(1,Hour()=17 and minute()=0,L)); if(Time1, V3, if(Time2,V1,V2)) Patrick :mrgreen:
dieselpr  
#5 Posted : Saturday, July 30, 2005 6:43:13 PM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

I didn't get anything when I ploted this one the chart Pat
Patrick  
#6 Posted : Monday, August 1, 2005 3:24:52 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
I don't have a real time version up and running on this machine, could you plot and line one at the time and make sure that each one return something. So that can we can find where the problem stands. For example plot : Dayofweek()>0 Make sure it goes to 1 at least once. Then plot Day1:=Dayofweek()>0; Time1:=hour()>=00 AND hour()<=8 AND Day1; Time1 Make sure it goes to 1 at least once. etc ... Thanks. Patrick :mrgreen:
dieselpr  
#7 Posted : Tuesday, August 2, 2005 10:10:06 PM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

Pat, I ploted the time frame on a chart.
wabbit  
#8 Posted : Tuesday, August 2, 2005 10:35:49 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)
Have you tried... Day1:=Dayofweek()>0; TradingSession:=If(hour()>=00 AND hour()<=8,1,if(hour()>=9 AND hour()<=16 ,2,3)); Day1 and lowestsince(1,TradingSession<>Ref(TradingSession,-1),L) If that doesnt work for you, i will have another look tonight wabbit :D
wabbit  
#9 Posted : Wednesday, August 3, 2005 12:47:17 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)
{Second Edit} Day1:=DayOfWeek()>0; TradingSession:=If(Hour()>=00 AND Hour()<=8,1,If(Hour()>=9 AND Hour()<=16 ,2,3)); {auto scale the session indicator} LVLL:=LastValue(Lowest(L)); LVHH:=LastValue(Highest(H)); Middle:=(LVHH+LVLL)/2; {plot the session indicator} If(TradingSession=1,LVLL,If(TradingSession=2,Middle,LVHH)); {plot the lowest value this session} If(day1,LowestSince(1,TradingSession<>Ref(TradingSession,-1),L),0); How's this looking for you? wabbit :D
dieselpr  
#10 Posted : Wednesday, August 3, 2005 4:21:06 PM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

This is what I got Wabbit from your second edit. Its pretty close but I think I'm not explaining it right. I hope this next jpeg helps.
wabbit  
#11 Posted : Wednesday, August 3, 2005 10:47:14 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)
OK... will have another crack tonight when I get home from work.... I am pretty sure I have a way to do this. wabbit :D
wabbit  
#12 Posted : Thursday, August 4, 2005 9:27:59 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)
[edited... because I could] Hope this does the trick.... It was an interesting project. ---8<---------------------------------- Day1:=DayOfWeek()>0; TradingSession:=If(Hour()>=00 AND Hour()<=8,1,If(Hour()>=9 AND Hour()<=16 ,2,3)); {auto scale the session indicator} LVLL:=LastValue(Lowest(L)); LVHH:=LastValue(Highest(H)); Middle:=(LVHH+LVLL)/2; {plot the session indicator} If(TradingSession=1,LVLL,If(TradingSession=2,Middle,LVHH)); x0:=TradingSession<>Ref(TradingSession,-1); x1:=BarsSince(x0 OR Cum(x0>-1)=1); {the lowest value this session} LowThisSession:=LowestSince(1,x1=0,L); LowThisSession; {the lowest low in the last session} LowLastSession:=ValueWhen(1,x1=0,Ref(LowThisSession,-1)); If(Cum(x0)>1,LowLastSession,lowThisSession); ---8<---------------------------------- wabbit :D
dieselpr  
#13 Posted : Thursday, August 4, 2005 4:08:40 PM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

Thanks Wabbit, That worked fine I'll have to do some more review of the code later when I get off work. Quick question thou can i used the same code to do the high also or is it an easier way to encode it with this code right?
wabbit  
#14 Posted : Thursday, August 4, 2005 9:26:46 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)
Somehow, in the back of my mind, I knew you were going to ask that..... ---8<------------------------------------- {the highest value this session} HiThisSession:=HighestSince(1,x1=0,H); HiThisSession; {the highest high in the last session} HiLastSession:=ValueWhen(1,x1=0,Ref(HiThisSession,-1)); If(Cum(x0)>1,HiLastSession,HiThisSession); ---8<------------------------------------- should work for you.... wabbit :D
dieselpr  
#15 Posted : Friday, August 5, 2005 2:49:58 AM(UTC)
dieselpr

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 130

Thanks Wabbit, This project has been a workout I know. I really need to get a better understanding of that latch system. Its the only true thing that holding me back I know.
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.