Login Page - Create Account

Support Board


Date/Time: Mon, 10 Mar 2025 23:16:40 +0000



Suggested way of displaying InternalOrderID per bar in ACSIL?

View Count: 770

[2022-04-07 20:50:42]
jwick - Posts: 142
If I wished to display an InternalOrderID value per bar, what is the suggested way of going about it? Storing it in a subgraph (visible on the chart value window) isn't reliable because of rounding issues with ints vs floats. I suppose another way of asking the question is do you have a suggestion for the best way to display / expose a large integer value on every bar?

Thanks!
[2022-04-07 21:22:16]
1+1=10 - Posts: 270
Hi jwick,

Storing it in a subgraph (visible on the chart value window) isn't reliable because of rounding issues with ints vs floats.

Yes, it's important to think about the distinction between floats and integers but it the effect is only relevant during calculations -- it does not affect display.

For example, if you have an InternalOrderId of 2358046 that gets stored as a float it might be stored as 2358056.00000001 but you get to choose the subgraph's value format. If you choose a "integer" value format with no decimals shown then it will be displayed as 2358056.

You can test this using auto-looping by writing sc.Index to a subgraph, and you'll see all the bars numbered as integers from 0 to sc.ArraySize - 1.
[2022-04-12 13:42:16]
jwick - Posts: 142
Thanks for your suggestion.

Alas, setting sc.ValueFormat to VALUEFORMAT_WHOLE_NUMBER didn't help. For reference, both 35428518 and 35428219 appear as 35428520 in the subgraph regardless of the ValueFormat I specify. Here is a simple example to demonstrate:


SCSFExport scsf_DisplayInts(SCStudyInterfaceRef sc) {
  SCSubgraphRef sg = sc.Subgraph[0];
  if (sc.SetDefaults) {
    sc.GraphName = "DisplayInts"; sc.AutoLoop = false; sc.GraphRegion = 0;
    sg.Name = "Test"; sg.DrawStyle = DRAWSTYLE_IGNORE;
    return;
  }
  if (sc.UpdateStartIndex == 0) sc.ValueFormat = VALUEFORMAT_WHOLE_NUMBER;
  for (int i = sc.UpdateStartIndex; i < sc.ArraySize; i++) sg[i] = (float)35428518;
}

Any other advice on how to display an internalorderid per bar? Alternatively is there a way to reset the InternalOrderID count within sierra charts so it provides smaller ID's?
Date Time Of Last Edit: 2022-04-12 13:53:07
[2022-04-12 14:15:10]
1+1=10 - Posts: 270
Hi jwick,

I replicated your result of 35_428_518 resulting in 35_428_520 using your code in the last post. I apologize for my incorrect presumption. On 2nd thought, as floats only have 6-7 significant digits I guess it makes sense the 7th-8th digits could switch from 18 to 20: https://docs.microsoft.com/en-us/cpp/c-language/type-float?view=msvc-170

Any other advice on how to display an internalorderid per bar? Alternatively is there a way to reset the InternalOrderID count within sierra charts so it provides smaller ID's?

Sadly, I can't think of a way! The docs say the InternalOrderID is set by SC so I don't think it is resettable. I think you may need SCEngineering's help to see if this is possible. Good luck!

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

Login

Login Page - Create Account