Does anyone have something similar to this but easier to read? I'm looking for something to confirm entries and exits with multiple things that need to be in agreement?
Rich (BB code):
# Stochastic Squad
# Multiple lenght Stochastic Study
# Mobius
# V01.01.28.2019
# Look for areas where all stochastic lengths agree for entries and exits.
declare lower;
input n = 3;
input n2 = 5;
input n3 = 8;
input n4 = 13;
input n5 = 21;
input n6 = 34;
input n7 = 55;
input n8 = 89;
input n9 = 144;
script stoch
{
input n = 10;
def h = Highest(high, n);
def l = Lowest(low, n);
def c = close;
def s = (c - l) / (h - l);
def hh = if s crosses above .5
then high
else if s > .5 and high > hh[1]
then high
else hh[1];
def ll = if s crosses below .5
then low
else if s < .5 and low < ll[1]
then low
else ll[1];
plot FastK = (c - ll) / (hh - ll);
}
plot s1 = stoch(n);
s1.SetDefaultColor(Color.Gray);
s1.hideBubble();
s1.hideTitle();
plot s2 = stoch(n2);
s2.SetDefaultColor(Color.Gray);
s2.hideBubble();
s2.hideTitle();
plot s3 = stoch(n3);
s3.SetDefaultColor(Color.Gray);
s3.hideBubble();
s3.hideTitle();
plot s4 = stoch(n4);
s4.SetDefaultColor(Color.Gray);
s4.hideBubble();
s4.hideTitle();
plot s5 = stoch(n5);
s5.SetDefaultColor(Color.Gray);
s5.hideBubble();
s5.hideTitle();
plot s6 = stoch(n6);
s6.SetDefaultColor(Color.Gray);
s6.hideBubble();
s6.hideTitle();
plot s7 = stoch(n7);
s7.SetDefaultColor(Color.Gray);
s7.hideBubble();
s7.hideTitle();
plot s8 = stoch(n8);
s8.SetDefaultColor(Color.Gray);
s8.hideBubble();
s8.hideTitle();
plot s9 = stoch(n9);
s9.SetDefaultColor(Color.Gray);
s9.hideBubble();
s9.hideTitle();
addCloud(1, s9, color.light_red, color.light_red);
addCloud(1, s8, color.light_red, color.light_red);
addCloud(1, s7, color.light_red, color.light_red);
addCloud(1, s6, color.light_red, color.light_red);
addCloud(1, s5, color.light_red, color.light_red);
addCloud(1, s4, color.light_red, color.light_red);
addCloud(1, s3, color.light_red, color.light_red);
addCloud(1, s2, color.light_red, color.light_red);
addCloud(1, s1, color.light_red, color.light_red);
addCloud(0, s2, color.light_green, color.dark_green);
addCloud(0, s3, color.light_green, color.dark_green);
addCloud(0, s4, color.light_green, color.dark_green);
addCloud(0, s5, color.light_green, color.dark_green);
addCloud(0, s6, color.light_green, color.dark_green);
addCloud(0, s7, color.light_green, color.dark_green);
addCloud(0, s8, color.light_green, color.dark_green);
addCloud(0, s9, color.light_green, color.dark_green);
# End Code Stochastic Squad
Last edited by a moderator: