Ok, thanks for clarifying. Can you explain why everyone insists on providong screenshots with such a narrow scope? It’s like peering through a pinhole. Your last screenshot contains even less data then your first. You can’t even see the name of the indicator or the settings. Why does everyone do this? Virtually every post in the Q&A forum I have to ask for more detail in the screenshots.
There, I’m done ranting.
Here is your code. You will need to adjust the inputs to the settings you want (80,20,14,3):
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 3;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = {default "No", "On FastK", "On FastD", "On FastK & FastD"};
def FastK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 1, averageType).FullK;
plot scan = (FastK[1] < over_sold and FastK > over_bought) or (FastK[1] > over_bought and FastK < over_sold);
Let’s clear up some details. Your request is for the “Stochastic Fast Line”. However your screenshot shows the indicator called StochasticFull. Those two lines on the graph are named “FullK” and “FullD”. The FullK line moves faster. So does that make sense? You want a scan to pick up when the FullK has moved from overbought to oversold in a single candle?
Also, the settings you list in your question do not match the settings used in the screenshot. This leaves a bit more doubt as to which version of the Stochastic you want to use. In thinkorswim, there are three. StochasticFast, StochasticFull and StochasticSlow. When you look more closely you will find the StochasticFast and StochasticSlow are both derived from the StochasticFull. Only the input settings are different.
Once we get these details cleared up we can proceed with a solution.