Login Page - Create Account

Support Board


Date/Time: Wed, 12 Feb 2025 04:36:41 +0000



Post From: Access to old Support Board

[2020-10-01 12:01:02]
Kiwi - Posts: 375
Assuming you mean in real time ... something like this which is testing for start of day (if my functions are right).

/*==========================================================================*/

SCSFExport scsf_RecalcChartEOD(SCStudyInterfaceRef sc) {
if (sc.SetDefaults) {
sc.GraphName = "Recalc on Day";
sc.StudyDescription = "Recalc Chart every day";
sc.Subgraph[0].Name = "Strobe";
sc.Subgraph[1].Name = "Time";
sc.Subgraph[0].DrawStyle=DRAWSTYLE_IGNORE;
sc.Subgraph[1].DrawStyle=DRAWSTYLE_IGNORE;
sc.Input[0].Name="Seconds between recalcs";
sc.Input[0].SetInt(60);
sc.Input[1].Name="Also reload chart data";
sc.Input[1].SetYesNo(0);
sc.UpdateAlways=1;
return;
}

int signal_bar = -1;
for (int pos = 0; pos < sc.ArraySize; pos++) {
// only for last bar, then new day, then only once in the bar
if (pos == sc.ArraySize - 1) {
if (sc.BaseDateTimeIn[pos].GetDate() > sc.BaseDateTimeIn[pos-1].GetDate()) {
if (pos != signal_bar) {
sc.FlagFullRecalculate = 1;
signal_bar = pos;
}
}
else
signal_bar = -1;
}
}
}