Login Page - Create Account

Support Board


Date/Time: Fri, 06 Dec 2024 07:59:06 +0000



Strange behaviour when populating sc.Input array

View Count: 1413

[2018-12-17 20:12:56]
binaryduke - Posts: 369
It appears that either using non-consecutive members in the array (i.e. leaving unpopulated array members) or larger values results in strange behaviour:


#include "sierrachart.h"
SCDLLName("Custom Study DLL")
SCSFExport scsf_TemplateFunction(SCStudyInterfaceRef sc)
{

  if (sc.SetDefaults)
  {
    sc.GraphName = "Template Function";

    sc.AutoLoop = 1; //Automatic looping is enabled.
    
    sc.Subgraph[0].Name = "Name";
    sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
    sc.Subgraph[0].PrimaryColor = RGB (0, 255, 0);
    
    sc.Input[0].Name = "Float Input 1";
    sc.Input[0].SetFloat(0.0f);
    sc.Input[3].Name = "Float Input 2";
    sc.Input[3].SetFloat(0.0f);
    sc.Input[5].Name = "Float Input 3";
    sc.Input[5].SetFloat(0.0f);
    sc.Input[38].Name = "Float Input 4";
    sc.Input[38].SetFloat(0.0f);
    sc.Input[46].Name = "Float Input 5";
    sc.Input[46].SetFloat(0.0f);
    sc.Input[125].Name = "Float Input 6";
    sc.Input[125].SetFloat(0.0f);
    return;
  }
}

Only displays inputs [0], [3] and [5]. I have tested the array size iterating from 0 to SC_INPUTS_AVAILABLE and can populate the maximum number of inputs. I have repeated the test with a modulo function to only populate every other array member and this is fine too, yet the code above does not populate members 38, 46 or 125.

Is there a need to ensure contiguous member usage of the sc.Input array?
Date Time Of Last Edit: 2018-12-17 20:35:14
[2018-12-17 20:40:19]
Sierra Chart Engineering - Posts: 104368
Yes you really do need to use these ACSIL Input array elements continuously.
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: 2018-12-17 20:40:37

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

Login

Login Page - Create Account