Hi,
At the very least how do you get the most current traded price?
As the current bar develops the projected bars don't seem to be accessible to efs studies.
close(0), close(0,inv(1)), etc. returns the value for the last completed bar, so does getMostRecentTrade(), as demonstrated in the following script.
Thanks,
Wayne
At the very least how do you get the most current traded price?
As the current bar develops the projected bars don't seem to be accessible to efs studies.
close(0), close(0,inv(1)), etc. returns the value for the last completed bar, so does getMostRecentTrade(), as demonstrated in the following script.
PHP Code:
function preMain(){
setPriceStudy(true);
}
function main(){
drawLineRelative( 0, close(0), 5, close(0), PS_SOLID, 3, Color.red, "test");// draws the line on the close of the last completed bar and is not affected by the projected bars.
if(getMostRecentTrade()) drawTextRelative( 0, getMostRecentTrade(), getMostRecentTrade(), Color.blue, null, Text.ONTOP | Text.CENTER, "Courier", 10, "kkx" );//returns the value of the last completed bar.
return getMostRecentTrade()+"";//doesn't return the current trade. It returns null on renko charts until a new bar forms then retains that value until the next bar is formed.
}
Wayne
Comment