I put together a simple efs that uses the new 'AboveBar' and 'BelowBar' tools introduced in EFS2 for some troubleshooting work I was doing and thought it may be of interest.
Here is a small screenshot of the arrows it places on the screen when you doubleclick the left mouse button either above or below the price bars. If you click above the pricebars, a down arrow appears. Conversly, if you click below the price bar, an up arrow appears. Note that the Text.PRESET flag was also added in EFS2 to allow the use of these features with the EFS1 'drawShapeRelative()' command.
Here is a copy of the efs for download.
PHP Code:
//Sample button Application that places arrows on the chart using new EFS 2 BelowBar and AboveBar tools
// S. Hare 5/27/2005
function preMain() {
setPriceStudy(true);
setStudyTitle("Up-n-Down Arrows");
setShowCursorLabel(false);
}
function main() {
verifyBuild( 719 );
}
function onLButtonDblClk( barIndex, yValue) {
if(yValue > Math.max(open(barIndex),close(barIndex)))DownArrow(barIndex, yValue, "down");
else if(yValue < Math.min(open(barIndex),close(barIndex)))UpArrow(barIndex, yValue, "up");
}
function UpArrow(barIndex, yValue, tmp){
drawShapeRelative(barIndex, BelowBar2,Shape.UPARROW, null, Color.red, Text.PRESET|Text.CENTER,tmp);
debugPrintln("20: UpArrow, barindex = "+barIndex+" yValue = "+yValue.toFixed(2));
}
function DownArrow(barIndex, yValue, tmp){
drawShapeRelative(barIndex, AboveBar2,Shape.DOWNARROW, null, Color.red, Text.PRESET|Text.CENTER,tmp);
debugPrintln("24: DownArrow, barindex = "+barIndex+" yValue = "+yValue.toFixed(2));
}
Here is a copy of the efs for download.
Comment