Support Board
Date/Time: Tue, 26 Nov 2024 13:35:24 +0000
Post From: scsf_GetStudyPeakValleyLineExample Code Not Working For Me
[2023-11-30 17:20:53] |
maxpi - Posts: 181 |
Following is a study I made to test the code in scsf_GetStudyPeakValleyLineExample. The goal is to print out to the log if the function returns anything and it never does. I tried user drawn profile and the profile study, tried different inputs to sc.GetStudyPeakValleyLine and nothing, ever... SCSFExport scsf_TestPeakValley(SCStudyInterfaceRef sc) { // Section 1 - Set the configuration variables and defaults if (sc.SetDefaults) { sc.GraphName = "Test Peak Valley"; sc.AutoLoop = 1; //Automatic looping is enabled. sc.MaintainVolumeAtPriceData = 1; sc.Input[0].SetStudyID(1); sc.Input[0].Name = "Volume by Price Study"; return; } SCString MessageText; // Do data processing float PeakValleyLinePrice = 0; int PeakValleyType = 0; int StartIndex = 0; int PeakValleyExtensionChartColumnEndIndex = 0; // get the first Peak/Valley line from the last volume by price profile if (sc.GetStudyPeakValleyLine(sc.ChartNumber, sc.Input[0].GetStudyID(), PeakValleyLinePrice, PeakValleyType, StartIndex, PeakValleyExtensionChartColumnEndIndex, -1, 0)) { // Peak/Valley line found int Test = 1; MessageText.Format("Test %i", Test); sc.AddMessageToLog(MessageText, 0); } } |