Hi all, this is my first attempt to combine two indicators and create a scan. I have two request
1. how to automatically plot an Up arrow on the chart whenever both conditions are met.
2. how should I change the def scan code, if i want the valid candle "close" must be higher than the previous candle "high"
Please feel free to clean up this mess work 😅
Thank You
1. how to automatically plot an Up arrow on the chart whenever both conditions are met.
2. how should I change the def scan code, if i want the valid candle "close" must be higher than the previous candle "high"

Please feel free to clean up this mess work 😅
Thank You
Code:
################################
input price1 = close;
input ema = 9;
input displace =0;
plot AvgExp = ExpAverage(price1[-displace], ema);
def ma = MovAvgExponential(close, 10);
def MA1 = close ;
def scan = MA1 crosses above ma;
#####################################################
input length = 14;
input over_sold = -100;
input over_bought = 100;
input showBreakoutSignals = no;
def price = close + low + high;
def linDev = LinDev(price, length);
plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
#plot OverBought = over_bought;
plot ZeroLine = 0;
#plot OverSold = over_sold;
#plot UpSignal = if CCI crosses above 0 then 0 else Double.Nan;
#plot DownSignal = if CCI crosses below 100 then 100 else Double.Nan;
plot signal = scan and CCI crosses above ZeroLine;
Last edited by a moderator: