Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 14:50:18 +0000



CROSSFROMABOVE, CROSSFROMBELOW and CROSSOVER

View Count: 2571

[2021-11-22 14:11:34]
Sierra Chart Engineering - Posts: 104368
It is very doubtful there is any real problem with the CROSSFROMABOVE function. These functions have been extensively tested. And have a test we run on them periodically. We recommend implementing your own formula rather than using this function.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2021-11-22 14:11:58
[2021-11-28 16:58:11]
Botan626 - Posts: 294
It is very doubtful there is any real problem with the CROSSFROMABOVE function. These functions have been extensively tested. And have a test we run on them periodically.

This sounds very familiar: Consecutive switching between window tabs | Post: 251034

I have an idea, how about you do an unplanned test, which will take about 2-3 mins?

Put this data in the cells:
I12,I13,I14=1,3,6
J12,J13,J14=2,4,5

This is how the plotted will look like according to the explanation in the post #2: http://www.sierrachart.com/image.php?Image=1635538667524.png

Now,
=CROSSFROMABOVE(I12:I14, J12:J14) will return 0
and
=CROSSFROMABOVE(I13:I14, J13:J14) will return 1
at the same time.

How can this be?
[2021-11-28 17:39:06]
Botan626 - Posts: 294
Btw, CROSSOVER gives the same results:

=CROSSOVER(I12:I14, J12:J14) returns 0
=CROSSOVER(I13:I14, J13:J14) returns -1
[2021-11-28 18:10:36]
User431178 - Posts: 406
All the information to answer your query on the first page of this thread.....

See attached image for explanation, nothing is broken you are misunderstanding how it works.
imagecrossover.png / V - Attached On 2021-11-28 18:10:09 UTC - Size: 111.35 KB - 231 views
[2021-11-28 20:28:20]
Botan626 - Posts: 294
User431178, when the comparison is occurring, it goes from right to left (read rows 12 to rows 14) or from left to right (read rows 14 to rows 12), when we are looking at this picture: https://www.sierrachart.com/Download.php?Folder=SupportBoard&download=57515 ?
[2021-11-28 22:26:44]
User431178 - Posts: 406
Read posts #12 & #14, the comparison starts from the most recent bar, so right to left.
[2021-11-28 22:49:09]
Botan626 - Posts: 294
If comparison starts from the most recent bar, which is row 12, and goes from right to left, then

1. Why post #2 says the opposite:

you need to keep in mind that the system is reading the data from row 15 (actually row 14, it's just a typo) to row 12, not the other way around
?

2. Why that explanation from post #2 explains results in post #1 with no contradiction whatsoever, when =CROSSFROMABOVE(I12:I14, J12:J14) returns 1 for this: http://www.sierrachart.com/image.php?Image=1635345766563.png ?

3. If comparison is going from right to left, as post #14 says, =CROSSFROMBELOW(I12:I14, J12:J14) should return 1 in the example from the post #1, shouldn't it?
Date Time Of Last Edit: 2021-11-29 04:53:54
[2021-11-29 08:12:31]
User431178 - Posts: 406
Maybe my wording could've been better, so I'll try again.

Comparison starts with the two most recent (rightmost) bars (or lowest numbered spreadsheet rows if you prefer), only under certain circumstances is the third (moving from right to left) bar included in the comparison.

1. You are mixing up two separate things, data is read in chronological order, 14, 13, 12 (12 being the most recent). That doesn't mean that the comparison for crossover starts from row 14. Nor does starting the comparison at the most recent bars mean that the data is compared from there backwards.

2. Look at the picture, the crossover occurs between the two most recent columns, so I don't see any contradiction.

3. No, that is not correct, see item 1.

Maybe the attached image helps?
imagecrossover_1.png / V - Attached On 2021-11-29 08:12:08 UTC - Size: 220.22 KB - 161 views
[2021-11-29 18:40:47]
Botan626 - Posts: 294
1. Your comments in the picture say, that cells in row 13 are comparing to cells in row 12 first, not otherwise.

So this from post #14
first checks the values in row 12 against the values in row 13
is wrong?


2. Regardless, this
The only time the 3rd value is looked at is when the 2nd values in each range are equal to each other. Then, and only then, is the comparison performed to check the 1st value with the 3rd value.
makes the whole analysis quite counterintuitive. Don't you think so?

In this case http://www.sierrachart.com/image.php?Image=1635538667524.png =CROSSFROMABOVE(I12:I14, J12:J14) returns 0.
In this case http://www.sierrachart.com/image.php?Image=1638209061389.png =CROSSFROMABOVE(I12:I14, J12:J14) returns 1.
But it's clear, that ranges cross from above in both cases.

Especially wonders this phrase
For the greatest accuracy use a range which includes 3 values with this function.
here https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#CROSSFROMABOVE_Function then.
It seems like, that it's better to compare ranges with 2 values only.


3. Also, if 2nd values are equal to each other and check between 2 most recent values returns FALSE, CROSSFROMBELOW will never return TRUE, if the 1st most recent value in the 1st range is lower, than the 1st most recent value in the 2nd range and vice versa.
Why compare 1st and 3d values in this case for CROSSFROMBELOW then?
Date Time Of Last Edit: 2021-11-29 18:50:44
[2021-11-30 08:40:31]
User431178 - Posts: 406
1. You are getting too caught up in details that don't matter - the logic operations are the same.

2. Not really no, the third value is only there for instances when the crossover occurs on the second last value. Without the third value you would not catch crossovers that occur on the second last value, as you would only ever check between the last and second last values.

Yes, they cross, but not in the context of the function, which is looking at the most recent data for a crossover - the crossover in the first image would be indicated 1 bar earlier, as that is when the crossover occurs with the most recent data.

3. Because for crossfrombelow all you are doing is reversing the comparisons..... The third value performs the same function as with crossfromabove - deals with cases where the cross occurs on the second last bar.

Anyway I give up now because we are going around in circles.
[2021-11-30 16:30:52]
Botan626 - Posts: 294
User431178,

context of the function, which is looking at the most recent data for a crossover

I guess it would be better, if this was added to function description to avoid any possible confusions.

Thank you a lot, your explanations helped me to sort out the contradiction I saw between post #2 and posts ##12,14.
Date Time Of Last Edit: 2021-11-30 16:33:33

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account