Support Board
Date/Time: Sun, 16 Mar 2025 14:40:06 +0000
Post From: New kiwi's stuff for 2020+ 🇳🇿 🎆 🎇 🎆 🇦🇺
[2020-10-02 00:11:13] |
Kiwi - Posts: 375 |
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
|
![]() ![]() |