Edit - As of April 2005, eSignal has provided a utility function that accomplishes this function called getCurrentBarCount(); Thanks!
One of the things that has always driven me nuts is that when I am going back over data, armed only with barcount, that I cannot get the barcount to actively display in the cursor window (for the intermediate values).
Now I could have done it before by just incrementing a counter (barcount++ ) within the efs, however I never really thought about it before now. Well, I was playing with creating an object class definition for barcount, and I came up with this efs.
It not only keeps an accurate barcount with all variants of tick charts, as an added bonus, it displays an active barcount in the cursor window.
Here is a link to a copy in my fileshare area. http://share.esignal.com/ContentRoot...10+18+2004.efsEdit - As of April 2005, eSignal has provided a utility function that accomplishes this function called getCurrentBarCount(); Thanks Gentlemen!
One of the things that has always driven me nuts is that when I am going back over data, armed only with barcount, that I cannot get the barcount to actively display in the cursor window (for the intermediate values).
Now I could have done it before by just incrementing a counter (barcount++ ) within the efs, however I never really thought about it before now. Well, I was playing with creating an object class definition for barcount, and I came up with this efs.
It not only keeps an accurate barcount with all variants of tick charts, as an added bonus, it displays an active barcount in the cursor window.
PHP Code:
/***********************************************
Steve Hare © October 2004
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
Title: barcount class.efs
By: Steve Hare
Email: [email][email protected][/email]
Version: initital release 10/18/2004
==============================================
Fix History:
==============================================
Description:
Displays barcount in cursor window, simple demo of establish a method within a object class definition
Dislaimer: For educational purposes only! Obviously, no guarantees
whatsoever and use at your own risk.
*************************************************/
function preMain(){
setPriceStudy(true);
setShowTitleParameters(false);
setStudyTitle("barcount Object Class");
setShowCursorLabel(true);
setCursorLabelName("BarCount", 0);
setDefaultBarFgColor(Color.red, 0);
}
function main(){
if (getBarState() == BARSTATE_ALLBARS) {//true once during initial load and subsequent reload
barcount = new barcount_variable_class();//barcount.num()
}
return ""+barcount.num();
}
function postMain() {
}
var barcount;
function barcount_variable_class(){
this.num=function(){return(1+getCurrentBarIndex()-getOldestBarIndex());};//note - last semicolon required
}
Comment