I'm writing the below EFS that basically colors the price bar grey when the chop indicator is above 61.8.
My 1st EFS and got far enough with the below code but the problem i'm having is that i'm not able to find a way to leave the price bars color as is when the chop indicator is not above 61.80. See my comment in the code that says " //Leave regular price bar color. How can i do that?" Can some one give me hand please?
function preMain() {
setPriceStudy(true);
setStudyTitle("Test");
//activate the price bar coloring feature
setColorPriceBars(true);
}
function main() {
var nChopValue = chop(14, 0); // Current Bar Index
if ( nChopValue > 61.8 ) {
setPriceBarColor( Color.green );
}
else {
//Leave regular price bar color. How can i do that?
}
return;
}
My 1st EFS and got far enough with the below code but the problem i'm having is that i'm not able to find a way to leave the price bars color as is when the chop indicator is not above 61.80. See my comment in the code that says " //Leave regular price bar color. How can i do that?" Can some one give me hand please?
function preMain() {
setPriceStudy(true);
setStudyTitle("Test");
//activate the price bar coloring feature
setColorPriceBars(true);
}
function main() {
var nChopValue = chop(14, 0); // Current Bar Index
if ( nChopValue > 61.8 ) {
setPriceBarColor( Color.green );
}
else {
//Leave regular price bar color. How can i do that?
}
return;
}
Comment