fcastrof
New member
i have this study in a scanner but the scanner do not accept two aggregation periods. i nned to scan if the candle of current day is hammer but this candle need to close upper month support level and the low need to close below the month support level. i already have an study with month supports but the scanner do not work.
Thanks ind advance for your help!
Thanks ind advance for your help!
Code:
def n1 = 0.25;
def n2 = 0.50;
def n3 = 0.618;
def d = 1;
def p = AggregationPeriod.MONTH;
def na = Double.NaN;
def today = if GetDay() == GetLastDay() then 1 else 0;
def h = if today then high(period = p)[d] else high(period = p);
def l = if today then low(period = p)[d] else Double.NaN;
def rango = h - l;
def m = l + (rango / 2);
def pbn1 = l - (rango * n1);
def pbn2 = l - (rango * n2);
def pbn3 = l - (rango * 1);
def uWick = high - Max(open, close);
def lWick = Min(open, close) - low;
def body = AbsValue(open - close);
def hammer = (lWick / body >= 1.5) and (uWick / body <= 1);
def cond = (close > pbn1 and low < pbn1) or (close > pbn2 and low < pbn2) or (close > pbn3 and low < pbn3);
plot scan = hammer and cond;