I'm trying to build a simple price bar color efs, which uses "close" or "hlc3".
It's the inserting eval for hlc3 that I'm struggling with. The close efs is below. This works. Any ideas how to make it use hlc3 instead?
It's the inserting eval for hlc3 that I'm struggling with. The close efs is below. This works. Any ideas how to make it use hlc3 instead?
PHP Code:
function preMain() {
setPriceStudy(true);
setStudyTitle("Color Price Bars");
setShowTitleParameters(false);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.grey);
}
function main() {
if (close(0) > close(-1)) {
setPriceBarColor(Color.green);
}
if (close(0) < close(-1)) {
setPriceBarColor(Color.red);
}
if (close(0) == close(-1)) {
setPriceBarColor(Color.grey);
}
return;
}
Comment