♥ 0 |
My code plots a line that moves up when the next pivot is higher, but moves down when the next pivot is lower. The plot should remain at the higher value when the next pivot is lower. I tried a Max statement (commented out), but that does not plot anything. The code: input Left = 3; # Number of bars to the left of the pivot def isPivotHigh = high > Highest(high[1], Left) and high >= Highest(high[-Right], Right); def pivotHigh = if isPivotHigh then high else Double.NaN; rec lastPivotHigh1 = if !IsNaN(pivotHigh) then pivotHigh else lastPivotHigh1[1]; #plot PivotHigh1 = Max(lastPivotHigh1, lastPivotHigh2); plot PivotHigh1 = lastPivotHigh1; PivotHigh1.SetDefaultColor(Color.RED);
Marked as spam
|
Please log in to post questions.