Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 10:36:48 +0000



Post From: ACSIL: sc.SetDefaults and sc.TickSize

[2020-09-30 07:35:45]
BrMa - Posts: 80
Dear ladies and gentlemen,

I'm running version 2175 of SierraChart and I was able to narrow down the issue - I wrote this simple program to see if there is an issue:
SCSFExport scsf_TickSize(SCStudyInterfaceRef sc) {
  const std::string studyName = "TickSize";
  const int studyVersion = 1;

  std::ofstream debugFile;
  debugFile.open("C:\\TickSize.txt", std::ios::out | std::ios::app);

  if (sc.SetDefaults) {
    sc.AutoLoop = 0;
    sc.GraphName = studyName.c_str();
    sc.StudyVersion = studyVersion;

    debugFile << "TickSize (setDefaults): " << sc.TickSize << "\n";
    debugFile.close();

    return;
  }

  if ((sc.IsFullRecalculation) && (sc.UpdateStartIndex == 0)) {        // Execute on the first index only
    debugFile << "TickSize (Index-Zero): " << sc.TickSize << "\n";
  }
  debugFile.close();
}

I'm doing all the tests for the symbol F.US.FDXMZ20 - ticksize should be 1 for this symbol.

If I'm clicking on "Add custom study" in the Chart Studies dialog,
TickSize (setDefaults): 0
is written to the file (which is incorrect, but not an issue as setDefaults is called another time, when the study is applied).

When the study is applied, the following is appended to the file (which is correct!):
TickSize (setDefaults): 1
TickSize (Index-Zero): 1

If the chartbook is saved and closed, the re-open of the chartbook adds the following to the file:
TickSize (setDefaults): 0.01
TickSize (Index-Zero): 1

And here is the issue!
To be precise: if the study above is saved into a chartbook, the re-open provides a wrong value for the ticksize in the setDefaults-section!
Could you please look into this?
Date Time Of Last Edit: 2020-09-30 10:09:04