I have this script that adds a horizontal line on the chart where the condition is true. It's for StochasticFast.
Is there a way to convert this so instead of using StochasticFast it uses TMO instead?
https://usethinkscript.com/threads/tmo-true-momentum-oscillator-for-thinkorswim.9413/
Is there a way to convert this so instead of using StochasticFast it uses TMO instead?
https://usethinkscript.com/threads/tmo-true-momentum-oscillator-for-thinkorswim.9413/
Code:
input bars = 6;
def sto = StochasticFast();
def failcountbelow = if sto crosses below 25
then 1 else
if failcountbelow[1] >= 1 and sto < 25
then failcountbelow[1] + 1 else
if sto > 20
then 0 else
failcountbelow[1] + 1;
def failpricebelow = if sto crosses below 25
then close else
failpricebelow[1];
def faillinebelow = if failcountbelow >= bars
then failpricebelow else
faillinebelow[1];
plot failurebelow = faillinebelow;
failurebelow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Last edited by a moderator: