♥ 0 |
Hi there, I was interested in sourcing the highest MACD value, since the signal line crosses the zero line. My approach was to count the number of bars since the value was over zero, then use the highest function, with the count as the length. While this approach makes sense to me, it seems the ‘Highest’ function requires a constant, so the count variable doesn’t work. Is there another approach that works? Thanks so much. David def count = if MACD(3, 6, 9, AverageType.EXPONENTIAL).Value is less than 0 then 0 else count[1] + 1; def highestMACD = Highest(MACD(3, 6, 9, AverageType.EXPONENTIAL).Value[-1], count);
Marked as spam
|
Please log in to post questions.