Support Board
Date/Time: Fri, 07 Feb 2025 07:10:45 +0000
Post From: GetIndexOfLowestValue
[2020-05-22 20:46:23] |
anahnemuss - Posts: 1 |
Hello, I'm working on an indicator running into a problem with sc.GetIndexOfLowestValue using the following code: int Lookback = I_Lookback.GetInt(); float CCILongLowest = sc.GetLowest(CCI, Lookback); // find lowest point in the lookback period int CCILongLowestBar = sc.GetIndexOfLowestValue(CCI, Lookback); // find index of lowest bar in the lookback period float CCILongHighest = sc.GetHighest(CCI, CCILongLowestBar); // find highest point since the lowest bar was found int CCILongHighestBar = sc.GetIndexOfHighestValue(CCI, CCILongLowestBar); // find index of highest bar since lowest value found float CCILongWaveRange = CCILongHighest - CCILongLowest; // find the range of the wave up I'm trying to find the value and index of recent high and low values for CCI (Lookback = 20 in this case). When I push these vars out to the log to debug, the GetLowest function works correctly, but the rest of these are returning results from the entire dataset. I've searched a lot on here and the docs, and looked at the code examples to see what I'm missing, but I'm coming up short. Additionally, is there any way to tell sc.GetIndexOfLowestValue to search 20 bars back but exclude the current bar? Thanks! |