Is there an efs that counts up bars vs down bars that starts counting with the first (9:30 EST) bar of the day?
If not, could someone kindly code it?
If not, could someone kindly code it?
function preMain(){
setPriceStudy(true);
setStudyTitle("UP-DN Bar Counter");
setCursorLabelName("UP bars",0);
setCursorLabelName("DN bars",1);
setDefaultBarFgColor(Color.blue,0);
setDefaultBarFgColor(Color.red,1);
setComputeOnClose();
}
var vCntrUP = 0;
var vCntrDN = 0;
function main(){
if((getHour()*100)+getMinute()==930){
vCntrUP=0;
vCntrDN=0;
}
if(close(0)>open(0)){
vCntrUP ++
}
if(close(0)<open(0)){
vCntrDN ++
}
return new Array (vCntrUP+"",vCntrDN+"");
}
function preMain(){
setPriceStudy(true);
setStudyTitle("UP-DN Bar Counter");
setCursorLabelName("UP bars",0);
setCursorLabelName("DN bars",1);
setDefaultBarFgColor(Color.blue,0);
setDefaultBarFgColor(Color.red,1);
setComputeOnClose();
}
var vCntrUP = 0;
var vCntrDN = 0;
function main(){
if((getHour()*100)+getMinute()==930){
vCntrUP=0;
vCntrDN=0;
}
if(close(0)>open(0)){
vCntrUP ++
}
if(close(0)<open(0)){
vCntrDN ++
}
return new Array (vCntrUP+"",vCntrDN+"");
}
Comment