Support Board
Date/Time: Tue, 25 Feb 2025 19:39:44 +0000
Post From: sc.Highest needs 4 arguments to work in manual loop but compiler says expects 3
[2021-04-21 09:42:48] |
User785302 - Posts: 8 |
Hello The following code does not compile. Error: - Starting remote build of Custom Studies Source files: ScratchPad.cpp. 64-bit -- 04:36:10
Allow time for the server to compile the files and build the DLL. The remote build did not succeed. Result: ScratchPad.cpp: In function 'void scsf_GetHighest(SCStudyInterfaceRef)': ScratchPad.cpp:32:60: error: no matching function for call to 's_sc::Highest(c_ArrayWrapper<float>&, float&, int&, int)' 32 | sc.Highest(Sg_BB.Arrays[0], Sg_Highest[Index], Index, 10); | ^ In file included from ScratchPad.cpp:6: sierrachart.h:787:18: note: candidate: 'c_ArrayWrapper<float>& s_sc::Highest(SCFloatArrayRef, SCFloatArrayRef, int, int)' 787 | SCFloatArrayRef Highest(SCFloatArrayRef In, SCFloatArrayRef Out, int Index, int Length) | ^~~~~~~ sierrachart.h:787:62: note: no known conversion for argument 2 from 'float' to 'SCFloatArrayRef' {aka 'c_ArrayWrapper<float>&'} 787 | SCFloatArrayRef Highest(SCFloatArrayRef In, SCFloatArrayRef Out, int Index, int Length) | ~~~~~~~~~~~~~~~~^~~ sierrachart.h:792:18: note: candidate: 'c_ArrayWrapper<float>& s_sc::Highest(SCFloatArrayRef, SCFloatArrayRef, int)' 792 | SCFloatArrayRef Highest(SCFloatArrayRef In, SCFloatArrayRef Out, int Length) | ^~~~~~~ sierrachart.h:792:18: note: candidate expects 3 arguments, 4 provided -- End of Build -- 04:36:13 Here is my SCSF code: SCSFExport scsf_GetHighest(SCStudyInterfaceRef sc) {
SCSubgraphRef Sg_BB = sc.Subgraph[0]; SCSubgraphRef Sg_Highest = sc.Subgraph[1]; if (sc.SetDefaults) { sc.GraphName = "Testing Highest"; sc.GraphRegion = 0; Sg_BB.Name = "BB"; Sg_Highest.Name = "Highest"; return; } for (int Index = sc.UpdateStartIndex; Index < sc.ArraySize; ++Index) { sc.BollingerBands(sc.BaseData[SC_LAST], Sg_BB, Index, 10, 2, MOVAVGTYPE_SIMPLE); sc.Highest(Sg_BB.Arrays[0], Sg_Highest[Index], Index, 10); } } Regards |