rvaidyamath
New member
I am having some syntax issue on this code below: "
#TTM_Squeeze()."SqueezeAlert";
DefineGlobalColor("BULL", Color.GREEN);
DefineGlobalColor("BEAR", Color.RED);
DefineGlobalColor("DEFAULT", Color.GRAY);
def salert = TTM_Squeeze()."SqueezeAlert";
def hist = TTM_Squeeze()."histogram";
def bull = if hist > 0 and salert == 1 then 1 else 0;
def bear = if hist < 0 and salert == 1 then 1 else 0;
def up = if hist[1] < hist then 1 else 0;
def dn = if hist[1] > hist then 1 else 0;
def sq10 = if salert == 1 then 1 else 0;
def k = if bull == 1 and salert == 0 and up == 0 then 1
else if bull == 1 and salert == 0 and up == 1 then 2
else if bull == 1 and salert == 1 and up == 0 then 3
else if bull == 1 and salert == 1 and up == 1 then 4
else if bear == 0 and salert == 0 and up == 1 then -1
else if bull == 0 and salert == 0 and up == 0 then -2
else if bull == 0 and salert == 1 and up == 0 then -3
else -4;
def k_Chg = if k[1] != k then
if up == 1 AND hist CROSSES ABOVE 0 then 10000
else if up == 1 then 1000
else if dn == 1 AND hist CROSSES BELOW 0 then -10000
else if dn == 1 then -1000
else 0
else 0;
def color;
if (k_Chg > 0) {
color = Color.GREEN;
} else if (k_Chg < 0) {
color = Color.RED;
} else {
color = Color.GRAY;
}
plot kp = if k_Chg != 0 then k_Chg else k;
kp.AssignValueColor(color);
# code End
Syntax issue:
Expected double at 35:5
Expected double at 37:5
Expected double at 39:5
Incompatible parameter: color at 42:6
Expected class com.devexperts.tos.thinkscript.data.CustomColor at 43:4
Expected double at 35:5
Expected double at 37:5
Expected double at 39:5
Incompatible parameter: color at 42:6
Expected class com.devexperts.tos.thinkscript.data.CustomColor at 43:4
#--
appreciate the help
Raj
#TTM_Squeeze()."SqueezeAlert";
DefineGlobalColor("BULL", Color.GREEN);
DefineGlobalColor("BEAR", Color.RED);
DefineGlobalColor("DEFAULT", Color.GRAY);
def salert = TTM_Squeeze()."SqueezeAlert";
def hist = TTM_Squeeze()."histogram";
def bull = if hist > 0 and salert == 1 then 1 else 0;
def bear = if hist < 0 and salert == 1 then 1 else 0;
def up = if hist[1] < hist then 1 else 0;
def dn = if hist[1] > hist then 1 else 0;
def sq10 = if salert == 1 then 1 else 0;
def k = if bull == 1 and salert == 0 and up == 0 then 1
else if bull == 1 and salert == 0 and up == 1 then 2
else if bull == 1 and salert == 1 and up == 0 then 3
else if bull == 1 and salert == 1 and up == 1 then 4
else if bear == 0 and salert == 0 and up == 1 then -1
else if bull == 0 and salert == 0 and up == 0 then -2
else if bull == 0 and salert == 1 and up == 0 then -3
else -4;
def k_Chg = if k[1] != k then
if up == 1 AND hist CROSSES ABOVE 0 then 10000
else if up == 1 then 1000
else if dn == 1 AND hist CROSSES BELOW 0 then -10000
else if dn == 1 then -1000
else 0
else 0;
def color;
if (k_Chg > 0) {
color = Color.GREEN;
} else if (k_Chg < 0) {
color = Color.RED;
} else {
color = Color.GRAY;
}
plot kp = if k_Chg != 0 then k_Chg else k;
kp.AssignValueColor(color);
# code End
Syntax issue:
Expected double at 35:5
Expected double at 37:5
Expected double at 39:5
Incompatible parameter: color at 42:6
Expected class com.devexperts.tos.thinkscript.data.CustomColor at 43:4
Expected double at 35:5
Expected double at 37:5
Expected double at 39:5
Incompatible parameter: color at 42:6
Expected class com.devexperts.tos.thinkscript.data.CustomColor at 43:4
#--
appreciate the help
Raj