Hi, i have a code, that draws the ADX in several mybgcolour: Red above 30, lime between 30-40 and below 30
I would like, that the ADX isn t drawn, if it`S below 30. Do you know, how to change the "else if"?
Regards
function preMain() {
setPriceStudy(true);
setStudyTitle("ADX5");
}
var bFlash = true;
var myColor = Color.white;
var mybgColor = Color.green;
function main() {
var myValue = ((adx(14,14)).toFixed(0));
mybgColor = Color.white;
if (bFlash == false) {
if (myValue>=30) {
//myColor = Color.black;
mybgColor = Color.red;
} else if (myValue>30 && myValue <= 40) {
//myColor = Color.gray;
mybgColor = Color.lime;
} else if (myValue<30) {
//myColor = Color.white;
mybgColor = Color.navy;
}
bFlash = true;
} else if (bFlash == true) {
bFlash = false;
}
drawTextRelative(0, BelowBar4, myValue , Color.lightgrey, mybgColor, Text.LEFT | Text.BOLD, null, 10, "text" );
return;
}
I would like, that the ADX isn t drawn, if it`S below 30. Do you know, how to change the "else if"?
Regards
function preMain() {
setPriceStudy(true);
setStudyTitle("ADX5");
}
var bFlash = true;
var myColor = Color.white;
var mybgColor = Color.green;
function main() {
var myValue = ((adx(14,14)).toFixed(0));
mybgColor = Color.white;
if (bFlash == false) {
if (myValue>=30) {
//myColor = Color.black;
mybgColor = Color.red;
} else if (myValue>30 && myValue <= 40) {
//myColor = Color.gray;
mybgColor = Color.lime;
} else if (myValue<30) {
//myColor = Color.white;
mybgColor = Color.navy;
}
bFlash = true;
} else if (bFlash == true) {
bFlash = false;
}
drawTextRelative(0, BelowBar4, myValue , Color.lightgrey, mybgColor, Text.LEFT | Text.BOLD, null, 10, "text" );
return;
}
Comment