Hi Everyone, I'm trying to build a scanner for a code I recently came across, but have been unsuccessful. Can anyone please help?
Please see code below:
# define swing low points
input length = 10;
def bn = BarNumber();
def lastBar = HighestAll(if IsNaN(close) then 0 else bn);
def offset = Min(length - 1, lastBar - bn);
def swingLow = low < Lowest(low[1], length - 1) and low == GetValue(Lowest(low, length), -offset);
# change candle colors just to make it easier to see what we are working with
AssignPriceColor(if swingLow then Color.LIME else Color.DARK_GRAY);
I'd like to scan for a candle that meets this requirement of a "swing low" per the code.
Thank you!
Please see code below:
# define swing low points
input length = 10;
def bn = BarNumber();
def lastBar = HighestAll(if IsNaN(close) then 0 else bn);
def offset = Min(length - 1, lastBar - bn);
def swingLow = low < Lowest(low[1], length - 1) and low == GetValue(Lowest(low, length), -offset);
# change candle colors just to make it easier to see what we are working with
AssignPriceColor(if swingLow then Color.LIME else Color.DARK_GRAY);
I'd like to scan for a candle that meets this requirement of a "swing low" per the code.
Thank you!