Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 13:10:02 +0000



ACSIL QUESTION REGARDING ARRAY FUNCTIONS

View Count: 976

[2015-04-20 21:04:42]
enemyspy - Posts: 306
Bare with me as I am learning and still suck at this stuff. Any Clarity on this would be appreciated as I am running out of subgraphs:

The sc.Subgraph[].Arrays[][]

I don't understand how use this properly via the reading material. Do I need to declare these arrays in the if(sc.SetDefaults)? Would the follwoing impractical example work to output the sum of the index of two background arrays to a subgraph?

SCSubgraphRef x = sc.Subgraph[0];

if(sc.SetDefaults)
{
x.Name = "example";
return;
}
int a = 1;
if( a = 1)
{
x.Arrays[0][sc.Index]=1;
x.Arrays[1][sc.Index]=2;
}
if(x.Arrays[0][sc.Index]>0 && x.Arrays[1][sc.Index]>0)
{
x[sc.Index]= x.Arrays[0][sc.Index] + x.Arrays[1][sc.Index]
}




Date Time Of Last Edit: 2015-04-20 21:18:41
[2015-04-20 21:20:05]
enemyspy - Posts: 306
I modified this example in order to better ask if the calculation of the arrays works the same as if using a subgraph.
[2015-04-21 07:22:48]
Sierra Chart Engineering - Posts: 104368
A quick look shows that your code example looks fine.

It is not necessary to give the sc.Subgraph[] a name in the sc.SetDefaults block if it will never be visible.
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

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

Login

Login Page - Create Account