Announcement

Collapse
No announcement yet.

EFS "main" not running at every tick

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EFS "main" not running at every tick

    I am running a simple script to pump out the current time (mm:ss) and last trade price of ES #F in a 3-minute advanced chart. However, the "main" function appears to only execute when the last traded price is DIFFERENT from the previous last traded price (or when a new time bar starts to paint). This seems inconsistent with my understanding that "main" is supposed to be executed at every tick.

    I need the have the script run at EVERY trade, even if it is at the same price at which it previously traded. And I need it to be done in minute charts (eg, 5-min chart), not in a Tick chart. Can anyone help me with this?

    Thanks,
    Mikey


    Here's the EFS I'm running:

    PHP Code:
    function preMain() { 
        
    debugPrintln("Tic Test...");


    function 
    main() { 
        if( 
    getCurrentBarIndex() == )  {
            
    debugPrintln("CurrTime=" getCurrTime() + ",  P="+close());
        }


    function 
    getCurrTime() {
        var 
    getMinute();
        var 
    getSecond();

        var 
    objDate = new Date(); 
        var 
    dm objDate.getMinutes();
        var 
    ds objDate.getSeconds();

        return ((
    dm 10) ? "0" "") + dm ":" + ((ds 10) ? "0" "") + ds;


  • #2
    Hi

    Did you get to solve your problem.
    Please let me know how if you did.

    Thanks
    JM

    Comment

    Working...
    X