Hi Pete, sorry about that. The scan below is for the stochastic and the one below that is for the pullback.
STOCHASTIC SCAN
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 3;
input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = { “No”, default “On FullK”, “On FullD”, “On FullK & FullD”};
def lowest_k = Lowest(priceL, KPeriod);
def c1 = priceC – lowest_k;
def c2 = Highest(priceH, KPeriod) – lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;
def FullK = MovingAverage(averageType, FastK, slowing_period);
def FullD = MovingAverage(averageType, FullK, DPeriod);
def OverBought = over_bought;
def OverSold = over_sold;
def upK = FullK crosses above OverSold;
def upD = FullD crosses above OverSold;
def downK = FullK crosses below OverBought;
def downD = FullD crosses below OverBought;
def UpSignal;
def DownSignal;
switch (showBreakoutSignals) {
case “No”:
UpSignal = Double.NaN;
DownSignal = Double.NaN;
case “On FullK”:
UpSignal = if upK then OverSold else Double.NaN;
DownSignal = if downK then OverBought else Double.NaN;
case “On FullD”:
UpSignal = if upD then OverSold else Double.NaN;
DownSignal = if downD then OverBought else Double.NaN;
case “On FullK & FullD”:
UpSignal = if upK or upD then OverSold else Double.NaN;
DownSignal = if downK or downD then OverBought else Double.NaN;
}
# use this to scan for bullish signals
#plot scan = !IsNaN(UpSignal);
# use this to scan for bearish signals
plot scan = UpSignal == OverSold;
PULLBACK SCAN
#Wizard text: The
#Wizard input: price
#Wizard text: has
#Wizard input: Choice
#Wizard text: over the last
#Wizard input: length
#Wizard text: consecutive bars
input price = close;
input length = 3;
input Choice = {default “increased”, “decreased”};
plot scan;
switch (Choice){
case “increased”:
scan = sum(price > price[1], length) == length;
case “decreased”:
scan = sum(price < price[1], length) == length;
}
Thank you
Your question is far from ‘general’. In order for me to answer this question you are going to have to provide more details. There is no way for me to tell how your scan is going to behave without seeing the code. In the mean time, I will take a stab at it and say that your second day stochastic opens above 20 and therefore there is no cross. No alert. But without seeing the code I am making some big time assumptions.