Alex could you or someone change your "Range.efs" so that it will ony color the bar/candle if it is greater than X points? Leaving the other bar/candles their respective up/down colors.
Thanks in advance.
function preMain() {
setPriceStudy(true);
setStudyTitle("Range");
setShowCursorLabel(false);
setColorPriceBars(true);
var fp1 = new FunctionParameter("Change", FunctionParameter.STRING);
fp1.setName("Change");
fp1.addOption("Points");
fp1.addOption("Percent");
fp1.setDefault("Points");
var fp2 = new FunctionParameter("Value", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(10);
}
function main(Change,Value) {
var vPoint = high()-low();
var vMidPoint = (high()+low())/2;
if (Change == "Points") {
if (vPoint < Value){
setPriceBarColor(Color.yellow);
}
else if (1==1){
setPriceBarColor(Color.white);
}
}
if (Change == "Percent") {
if(high()<vMidPoint*(1+Value/100)&&low()>vMidPoint*(1-Value/100)){
setPriceBarColor(Color.red);
}
else if (1==1){
setPriceBarColor(Color.black);
}
}
return ;
}
Thanks in advance.
function preMain() {
setPriceStudy(true);
setStudyTitle("Range");
setShowCursorLabel(false);
setColorPriceBars(true);
var fp1 = new FunctionParameter("Change", FunctionParameter.STRING);
fp1.setName("Change");
fp1.addOption("Points");
fp1.addOption("Percent");
fp1.setDefault("Points");
var fp2 = new FunctionParameter("Value", FunctionParameter.NUMBER);
fp2.setLowerLimit(0);
fp2.setDefault(10);
}
function main(Change,Value) {
var vPoint = high()-low();
var vMidPoint = (high()+low())/2;
if (Change == "Points") {
if (vPoint < Value){
setPriceBarColor(Color.yellow);
}
else if (1==1){
setPriceBarColor(Color.white);
}
}
if (Change == "Percent") {
if(high()<vMidPoint*(1+Value/100)&&low()>vMidPoint*(1-Value/100)){
setPriceBarColor(Color.red);
}
else if (1==1){
setPriceBarColor(Color.black);
}
}
return ;
}
Comment