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

Notification

Icon
Error

Options
Go to last post Go to first unread
wcinvest888  
#1 Posted : Thursday, July 13, 2006 9:20:41 AM(UTC)
wcinvest888

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/13/2006(UTC)
Posts: 7

Hi all, I am new here :roll: I am writing an expert to highlight the bar if it's LOW is lower than next day's low or next next day's low. So I write the formula like this: L<Ref(L,1) OR L<Ref(L,2) However, I find that this expert is not effective to the second last bar (of whole period) even it's low is lower than the last bar. Seems that the formula becomes invalid when it tries to refer to the bar Ref(L,2) which does not exists. Any idea?
StorkBite  
#2 Posted : Thursday, July 13, 2006 2:06:14 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Hi wcinvest888- Welcome to the forum! You can change your forumla above to read L<Ref(L,-1) AND L<ref(L,-2). It's the lack of a minus sign that's throwing it off.
wabbit  
#3 Posted : Friday, July 14, 2006 12:47:46 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)
I actually think that wcinvest888 has the logic right, but is using forward references. wcinvest888, think of it like this: on the fourth last bar your code looks two bars ahead (so its looking at the second last bar on the chart) so MS draws a point on the chart the conditions are true; on the third last bar your code looks two bars ahead (so its looking at the very last bar on the chart) so MS draws a point on the chart the conditions are true; on the second last bar your code looks two bars ahead (so its looking one bar past the end of the chart) so the code is invalid, and this is the case for the last bar too! Rethink your 'system' to think in the opposite direction... if you want the low today to be less than the low in two days time, the opposite direction thoughts are, call the bar that was in two days time, today, now the low today must be higher than the low two days ago. Hope this helps. wabbit :D
wcinvest888  
#4 Posted : Saturday, July 15, 2006 2:41:33 PM(UTC)
wcinvest888

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/13/2006(UTC)
Posts: 7

Thanks for your replies! Wabbit, you are right. My code is applicable on the fourth and third last bar, but not the second last bar. However for some reason, I need to highlight exactly the bar if it is lower than next day or next next day, and also need to applicable on second last bar :( :( I have tried different approaches but none of them work.. any one can help?
StorkBite  
#5 Posted : Saturday, July 15, 2006 3:59:36 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Sorry, I misunderstood your question. My fault. Try something like this. As Wabbit mentions, it does use forward referencing. [code:1:db3dded62e]L<Ref(L,+1) AND L<Ref(L,+2) AND L<Ref(L,-1) AND L<Ref(L,-2)[/code:1:db3dded62e]
wcinvest888  
#6 Posted : Friday, August 4, 2006 2:52:08 AM(UTC)
wcinvest888

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/13/2006(UTC)
Posts: 7

I got the solution! I create an expert with 2 highlights, the first one is L<Ref(L,1), the another one is L<Ref(L,2), both with same color red.

Then whenever either conditions hit, the bar will be highlight as red!

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.