Login Page - Create Account

Support Board


Date/Time: Wed, 01 May 2024 19:22:02 +0000



Post From: New kiwi's stuff for 2020+ 🇳🇿 🎆 🎇 🎆 🇦🇺

[2020-10-02 00:11:13]
Kiwi - Posts: 374
From a post on the main board. Here's a better version ... and the start of a new kiwi's stuff, kiwi_20. This one permits you to select 3 times (just duplicate a time or use an untraded time if you don't need 3). Modifying it should be easy if needed 🙂


SCSFExport scsf_RecalcChartAtTimes(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "RecalcAtTimes";
sc.StudyDescription = "Recalc At Specified Times";
sc.GraphRegion = 0;

sc.Subgraph[0].Name = "Strobe";
sc.Subgraph[1].Name = "dbg 0";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[1].DrawStyle = DRAWSTYLE_IGNORE;

sc.Input[1].Name="Also reload chart data";
sc.Input[1].SetYesNo(0);
sc.Input[2].Name = "Time to Recalc";
sc.Input[2].ValueType = TIME_VALUE;
sc.Input[3].Name = "Time to Recalc";
sc.Input[3].ValueType = TIME_VALUE;
sc.Input[4].Name = "Time to Recalc";
sc.Input[4].ValueType = TIME_VALUE;
return;
}

int& bar_is_tested = sc.GetPersistentIntFast(0);

// This will test if this bar has been checked and if not
// it will test if the bar includes one of the times
// and if it does: recalculate and reload if chosen

if (sc.ArraySize != bar_is_tested)
{
bar_is_tested = sc.ArraySize;
int this_ = sc.BaseDateTimeIn[sc.ArraySize-1].GetTime();
int next_ = sc.BaseDateTimeIn[sc.ArraySize-1].GetTime() + sc.SecondsPerBar;

if ((sc.Input[2].GetTime() >= this_ && sc.Input[2].GetTime() < next_) ||
(sc.Input[3].GetTime() >= this_ && sc.Input[3].GetTime() < next_) ||
(sc.Input[4].GetTime() >= this_ && sc.Input[4].GetTime() < next_))
{
sc.Subgraph[0][sc.ArraySize-1] = this_;
sc.FlagFullRecalculate = 1;
if (sc.Input[1].GetYesNo())
sc.FlagToReloadChartData = 1;
}
}
}

compiled for SC 2175
Date Time Of Last Edit: 2020-10-02 00:17:44
attachmentkiwi_20.cpp - Attached On 2020-10-02 00:16:41 UTC - Size: 1.69 KB - 287 views
attachmentkiwi_20_64.dll - Attached On 2020-10-02 00:16:55 UTC - Size: 891 KB - 253 views