For an unrealted post http://forum.esignalcentral.com/show...=forex+symbols concerning the composition of FOREX price bars I tried to use the Drawtext to simply display the contents of several variables on the chart.
I wrote this simple efs to display on the chart next to each bar, the values returned by several Time and Sales functions when the bar was loaded.
I'm only seeing the values displayed on the last bar and wondering if anyone knows what I'm doing wrong.
Thanks very much.
Glen
I wrote this simple efs to display on the chart next to each bar, the values returned by several Time and Sales functions when the bar was loaded.
I'm only seeing the values displayed on the last bar and wondering if anyone knows what I'm doing wrong.
Thanks very much.
Glen
PHP Code:
function preMain() {
setPriceStudy(true);
setStudyTitle("Show Bid-ASK-LAST");
setShowCursorLabel(false);
}
function main() {
var nState = getBarState();
var vBid = (getMostRecentBid()*1).toFixed(4)*1;
var vAsk = (getMostRecentAsk()*1).toFixed(4)*1;
var vLast = (getMostRecentTrade()*1).toFixed(4)*1;
if (nState == BARSTATE_CURRENTBAR) {
debugPrintln("Bid = " +getMostRecentBid() + " Ask = " +getMostRecentAsk() + " Last = " +getMostRecentTrade());
drawText ("B="+vBid, BelowBar4, Color.red,Text.BOLD,"Bid");
drawText ("A="+vAsk, AboveBar4, Color.green,Text.BOLD,"Ask");
drawText ("L="+vLast, BelowBar3, Color.blue, Text.BOLD,"Last");
}
return;
}
Comment