Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 00:41:04 +0000



[Programming Help] - Incomplete documentation about sc.CrossOver() when comparing against a fixed value.

View Count: 637

[2023-10-15 04:04:44]
rajeshh - Posts: 8
The documentation for the CrossOver ACSIL function when comparing against as fixed value is as follows -

// This is an example of looking for a crossover between the values in
// a subgraph and a fixed value. We first have to put the fixed value
// into an array. We are using one of the Subgraph internal arrays.
sc.Subgraph[2].Arrays[8][sc.Index] = 100.0;

This makes it sound that the fixed value is only needed in the sc.Index index of the array. However, the fixed value is needed in the past indexes as well if there is a chance that there are values of the subgraph which can equal the fixed value for several consecutive bars. ( This can happen in /ES for e.g when several consecutive bars could have the same price).

So in this case, one needs to also do a few more of these just to be sure.

sc.Subgraph[2].Arrays[8][sc.Index] = 100.0;

sc.Subgraph[2].Arrays[8][sc.Index-1] = 100.0;

sc.Subgraph[2].Arrays[8][sc.Index-2] = 100.0;

sc.Subgraph[2].Arrays[8][sc.Index-3] = 100.0;

sc.Subgraph[2].Arrays[8][sc.Index-4] = 100.0;

Maybe this is obvious to other people, but it wasnt clear to me, so I recommend updating the documentation to indicate the above.
Date Time Of Last Edit: 2023-10-15 04:05:00

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

Login

Login Page - Create Account