How to access the last indicator values
问题 I've got an indicator which shows pivot points: //@version=4 study("Trend", overlay=false) leftBars = input(3) rightBars = input(3) ph = pivothigh(high, leftBars, rightBars) pl = pivotlow(low, leftBars, rightBars) How can I check if the last ph was higher than the ph before? (I'd like to check for an uptrend or downtrend) 回答1: You can try the following code (including your original, as you see): //@version=4 study("Trend", overlay=false) leftBars = input(3) rightBars = input(3) ph = pivothigh