I think I have a fairly good grasp of the basics of efs programming. But every now and then I get some strange behavior and I always wonder "is it me, or is it them?".
The following code is behaving differently today (Dec 24) than it did yesterday. (Actually, this is a simplified version of my code that I just put together for this post. It is behaving in the same odd manner.)
===
===
I expect this code to -
Display the count value and the current bar index on screen.
I expect the cbi to be zero as soon as the history data has finished loading and live data begins to flow.
I expect the count value to increment with each tick. The symbol I am (was, markets just closed) using is ES #F. Ticks are (were) comming in at a rate of up to several dozen per minute.
===
What I'm seeing is -
An index that never gets higher than -1.
The text drawn on screen is aligning with the bar at index -1, rather than with the bar at index zero as specified in the code. There IS a bar at index zero, and it moves when each new tick arrives.
My counter only increments when a new bar is started.
===
I have a screen shot (.bmp) of what it is doing. I can post it if it will help.
Is it my code? Or is there something else going on?
The following code is behaving differently today (Dec 24) than it did yesterday. (Actually, this is a simplified version of my code that I just put together for this post. It is behaving in the same odd manner.)
===
Code:
var cnt = 0; const fontAM = "Arial Monospaced"; // ************************************************ function preMain(){ } // ************************************************ function main(){ var cbi = getCurrentBarIndex(); cnt = cnt + 1; var x = 0; var y = 15; // var textID = "x"; var text = " [tick cnt = " + cnt + "] [cbi = " + cbi + "] "; drawTextRelative(x, y, text, Color.black, Color.white, Text.RELATIVETOTOP, fontAM, 10, textID); } // ************************************************
I expect this code to -
Display the count value and the current bar index on screen.
I expect the cbi to be zero as soon as the history data has finished loading and live data begins to flow.
I expect the count value to increment with each tick. The symbol I am (was, markets just closed) using is ES #F. Ticks are (were) comming in at a rate of up to several dozen per minute.
===
What I'm seeing is -
An index that never gets higher than -1.
The text drawn on screen is aligning with the bar at index -1, rather than with the bar at index zero as specified in the code. There IS a bar at index zero, and it moves when each new tick arrives.
My counter only increments when a new bar is started.
===
I have a screen shot (.bmp) of what it is doing. I can post it if it will help.
Is it my code? Or is there something else going on?
Comment