Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 08:34:27 +0000



CROSSFROMABOVE, CROSSFROMBELOW and CROSSOVER

View Count: 2641

[2021-10-27 13:50:26]
Botan626 - Posts: 294
In I12-I14 cells I have 1, 6, 5 values.
In J12-J14 cells I have 3, 4, 2 values.

=CROSSFROMABOVE(I12:I14, J12:J14) returns 1
=CROSSFROMBELOW(I12:I14, J12:J14) returns 0
=CROSSOVER(I12:I14, J12:J14) returns -1

So CROSSFROMABOVE and CROSSFROMBELOW say 'The first range crosses the second Range from above.', CROSSOVER says 'The first Range crosses the second Range from below.'.

Why different results? My logic says, that only CROSSOVER gives a correct return value.
Date Time Of Last Edit: 2021-10-27 14:06:30
[2021-10-27 14:44:51]
John - SC Support - Posts: 31159
Our logic says that the CROSSOVER is returning the wrong value and the other two are correct. But it depends on the order in which you have the data in the cells.

If you have I12=1, I13=6, and I14=5 (and then the same for J12-J14), then you need to keep in mind that the system is reading the data from row 15 to row 12, not the other way around. Here is an example of the plotted data when it is entered as we specified:
http://www.sierrachart.com/image.php?Image=1635345766563.png

In this case, the green line is the first set of data and the purple line is the second. In this case the crossover goes from above to below with the first one crossing the second.

We will look into why the CROSSOVER does not appear to give the right result.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-27 15:00:38]
Botan626 - Posts: 294
If you have I12=1, I13=6, and I14=5

Yes, that is what I meant.

the system is reading the data from row 15 to row 12

I didn't know that, is it written somewhere in documentation? It is unusual to interpret and predict a result for all functions then, as people are reading from left to right for e.g.

I mean, this fact makes description for CROSSFROMABOVE https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#CROSSFROMABOVE_Function inaccurate.
[2021-10-27 15:01:32]
John - SC Support - Posts: 31159
The documentation for the CROSSOVER is incorrect. The Above and Below results were reversed. We have corrected this, therefore given what we state above, everything is working correctly and per the documentation.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-27 15:08:29]
Botan626 - Posts: 294
Again,

the system is reading the data from row 15 to row 12

Is it written somewhere in documentation? By reading description for CROSSFROMABOVE I would expect it to return 0 instead of 1, as I'm reading both ranges from left to right.
[2021-10-27 15:24:57]
John - SC Support - Posts: 31159
This is how all of these calculations are going to work within Sierra Chart. It is always going to look from older data to newer. Which is the expectation that you should have. It's just that with the Spreadsheet the lower numbered data is the most recent, so you have to adjust to where the data is located within the specified range.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-27 17:04:26]
Botan626 - Posts: 294
Why =CROSSFROMABOVE(I12:I14, J12:J14) returns 0, if
I12,I13,I14=1,3,6
J12,J13,J14=2,4,5
?
Date Time Of Last Edit: 2021-10-28 14:46:38
[2021-10-28 14:49:16]
Botan626 - Posts: 294
Though for =CROSSFROMABOVE(I13:I14, J13:J14) it returns 1.

Shouldn't both results be the same 1, based on this:

It is always going to look from older data to newer.

Date Time Of Last Edit: 2021-10-28 14:51:44
[2021-10-28 15:22:27]
John - SC Support - Posts: 31159
Look at the picture. It is always the first set of data relative to the second set. In this case, the data crosses from above.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-28 18:34:43]
Botan626 - Posts: 294
In this case, the data crosses from above.

Yes, from above.

These sets of data cross from above too:
I12,I13,I14=1,3,6
J12,J13,J14=2,4,5

Why =CROSSFROMABOVE(I12:I14, J12:J14) returns 0 then? Does it work incorrectly?
[2021-10-28 23:21:34]
John - SC Support - Posts: 31159
The data you show above gives a 0 for CrossFromAbove since the crossover occurs between the points at rows 13 and 14. Therefore the most recent set of points is not crossing (rows 12 and 13). 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.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-29 13:39:53]
Botan626 - Posts: 294
When you say "the 3rd value", what value are you referring to? The 1 value in the 1st cell (I12), or the first value, when comparison is occurring and sets of data are inverted?

The only time the 3rd value is looked at is when the 2nd values in each range are equal to each other.

When the 2nd values in each range are equal to each other? You mean I13=J13? This doesn't sounds right.

In the example in the 1st post crossover occurs between the points at rows 12 and 13, 2nd values are not equal to each other and CROSSFROMABOVE returns 1 correctly.

If you will make a picture, like you did in the post #2, you will see clearly, that there is 1 crossover from above, so why CROSSFROMABOVE would return 0 then?

Then, and only then, is the comparison performed to check the 1st value with the 3rd value.

1st value of the 1st set compares to the 3rd value of the same 2nd set? This makes no sense too.

Does CROSSFROMABOVE work incorrectly after all?
Date Time Of Last Edit: 2021-10-29 13:41:15
[2021-10-29 15:43:17]
John - SC Support - Posts: 31159
You have data in rows 12, 13, and 14 and you are asking for a CrossFromAbove test. When it does this, it first checks the values in row 12 against the values in row 13 to see if there is a crossover. If there is not a CrossFromAbove (1->3 and 2->4 is not a CrossFromAbove) and if the second values are not equal, then the test is done and the result returned (0, since there was not a CrossFromAbove).

If, by chance, the second values were the same, then it would check the first set of values (row 12) against the third set of values (row 14).
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-10-29 20:41:50]
Botan626 - Posts: 294
Now you are contradictiong your own words you said in post #2:
you need to keep in mind that the system is reading the data from row 15 to row 12, not the other way around

If so, then the plotted data for I12,I13,I14=1,3,6 and J12,J13,J14=2,4,5 will look like this: http://www.sierrachart.com/image.php?Image=1635538667524.png
The green line is the first set of data and the purple line is the second.

You can see clearly there is a crossover with the first set of data crossing the second one from above.

But now you are saying it goes from row 12 to row 14, which turns analysis upside dowm. In this case the 1st set of data definitely does not cross the 2nd one from above: http://www.sierrachart.com/image.php?Image=1635539546814.png

If, by chance, the second values were the same...

If e.g. I12,I13,I14=1,4,6 and J12,J13,J14=2,4,5 CROSSFROMABOVE returns 1 correctly for these sets fo data: http://www.sierrachart.com/image.php?Image=1635540024559.png
Date Time Of Last Edit: 2021-10-30 16:50:21
[2021-10-29 20:44:38]
Botan626 - Posts: 294
So I will continue to say, that =CROSSFROMABOVE(I12:I14, J12:J14) returns 0 incorrectly for these sets of data:
I12,I13,I14=1,3,6
J12,J13,J14=2,4,5
http://www.sierrachart.com/image.php?Image=1635538667524.png

At the same time, =CROSSFROMABOVE(I13:I14, J13:J14) returns 1.
Date Time Of Last Edit: 2021-10-29 20:58:18
[2021-10-30 17:07:41]
Botan626 - Posts: 294
Maybe Sierra Chart Engineering will take a look at it?

Posts 15 and 16 are enough to read to see the problem.
[2021-11-04 18:03:00]
Botan626 - Posts: 294
bump
[2021-11-11 13:09:27]
Sierra Chart Engineering - Posts: 104368
We cannot provide any further help.

We do not provide formula programming help.
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
[2021-11-11 16:29:08]
Botan626 - Posts: 294
We do not provide formula programming help.

I never said in this thread, that I need 'formula programming help'. Did you just give a random irrelevant reply almost 2 weeks after I said posts 15 and 16 are enough to read to see where the problem is so you could have a complete assurance this thread can be marked as resolved? Or what?

Looks like you are having a hard time every time there is something wrong with SC, and denial stage is a must step to go through, like here: Consecutive switching between window tabs | Post: 251703

Of course when I say you I say it in plural form.

So, if you read post 16 and then post 15 you will see that it looks like CROSSFROMABOVE function works incorrectly. Will you?
[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

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

Login

Login Page - Create Account