Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 3/31/2006(UTC) Posts: 2
|
Hi all,
Can someone please tell me how the cross function is calculated?
Is CROSS(Data1,Data2) the same as:
Ref(Data1<Data2,-1) AND Data1>Data2;
Or is it:
Ref(Data1<=Data2,-1) AND Data1>Data2;
Or is it:
Ref(Data1<Data2,-1) AND Data1>=Data2;
Thanks
Simon
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 8/13/2005(UTC) Posts: 90
|
Simon,
It seems to be same as:
Ref(Data1<Data2,-1) AND Data1>Data2;
In other two cases the results may not be as desired. That is why sometimes it is more appropriate NOT to use CROSS function, and use the long REF version as above.
Regards
SMG
(My version MS Pro 9.1 - I think in some previous versions, the behaviour was per one of two other options - But I an not very much sure about previous versions)
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 3/31/2006(UTC) Posts: 2
|
Thanks for the response.
So, from what you are telling me means that if I am looking for a cross over a price of say $1.00 and the following happens over 3 days:
Day 1: .98
Day 2: $1.00
Day 3: $1.05
This will not pass because it doesn't cross from below to above in 1 day?
Simon
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 8/13/2005(UTC) Posts: 90
|
Simon,
You can make a Custom Indicator with the Formula:
Cross(C,1)
And check the results - It seems to work on Day 3, however there have been some instances with me when the results have not been as desired and I had to switch to the long REF version.
For example, suppose the Close on the Right Most bar of the chart is 1.05 and the Close of the bar on the left of the Right Most bar is 1.00, then the following formula will not plot TRUE:
Cross(C,ValueWhen(1,Cum(1) = LastValue(Cum(1)-1),C));
Whereas Cross(C,1) formula will plot true.
While we are talking about REF based formulas we are working on only two bars, whereas CROSS seems to be taking more than two bars in consideration. So, it might depend on the needs of individual case - sometimes CROSS might be appropriate and sometimes REF.
Take care while plotting above formula, it will just plot a dot on the right most bar, so you may find it invisible.
Regards
SMG
|
|
|
|
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.