Support Board
Date/Time: Wed, 31 Dec 2025 10:12:57 +0000
Post From: Input DisplayOrder breaks with non-contiguous inputs
| [2025-12-31 00:14:21] |
| User719512 - Posts: 363 |
|
Hi Sierra Chart Engineering, Use case is defining non-contiguous Inputs for internal use, turning some off between debug/release, dev/prod, and also saving room for new Inputs without having to make breaking changes and shift these into new IDs. Code is below, and the screenshot attached that demonstrates the issue. Expectation is both studies display all 4 inputs. #include "sierrachart.h" //SCDLLName("InputDisplayOrder"); namespace ns_InputDisplayOrder { SCSFExport scsf_InputDisplayOrder1(SCStudyInterfaceRef sc) { SCInputRef Input_a = sc.Input[0]; SCInputRef Input_b = sc.Input[1]; SCInputRef Input_c = sc.Input[2]; SCInputRef Input_d = sc.Input[3]; if (sc.SetDefaults) { sc.GraphName = "InputDisplayOrder1"; sc.AutoLoop = 0; sc.DrawZeros = 0; sc.GraphRegion = 0; sc.DrawStudyUnderneathMainPriceGraph = 0; sc.UpdateAlways = 1; Input_a.Name = "Input_a"; Input_a.SetInt(1); Input_a.DisplayOrder = 1; Input_b.Name = "Input_b"; Input_b.SetInt(1); Input_b.DisplayOrder = 2; Input_c.Name = "Input_c"; Input_c.SetInt(1); Input_c.DisplayOrder = 3; Input_d.Name = "Input_d"; Input_d.SetInt(1); Input_d.DisplayOrder = 4; return; } for (int barIndex = sc.UpdateStartIndex; barIndex < sc.ArraySize; barIndex++) { // do work... } } SCSFExport scsf_InputDisplayOrder2(SCStudyInterfaceRef sc) { SCInputRef Input_a = sc.Input[0]; SCInputRef Input_b = sc.Input[1]; SCInputRef Input_c = sc.Input[58]; SCInputRef Input_d = sc.Input[59]; if (sc.SetDefaults) { sc.GraphName = "InputDisplayOrder2"; sc.AutoLoop = 0; sc.DrawZeros = 0; sc.GraphRegion = 0; sc.DrawStudyUnderneathMainPriceGraph = 0; sc.UpdateAlways = 1; Input_a.Name = "Input_a"; Input_a.SetInt(1); Input_a.DisplayOrder = 1; Input_b.Name = "Input_b"; Input_b.SetInt(1); Input_b.DisplayOrder = 2; Input_c.Name = "Input_c"; Input_c.SetInt(1); Input_c.DisplayOrder = 3; Input_d.Name = "Input_d"; Input_d.SetInt(1); Input_d.DisplayOrder = 4; return; } for (int barIndex = sc.UpdateStartIndex; barIndex < sc.ArraySize; barIndex++) { // do work... } } } // ns_InputDisplayOrder |
| |
