Announcement

Collapse
No announcement yet.

DebugPrint & Formula Output window

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

  • DebugPrint & Formula Output window

    When printing variables from within 2 separate functions the debugPrint output for each function is separate. i.e. the output window will print all the TmpVar1 values for each bar then print TmpVar2 instead of printing TmpVar1 and TmpVar2 for each bar together. Historical bars produce this:

    ...
    bar index -22 TmpVar1
    bar index -23 TmpVar1
    bar index -24 TmpVar1

    ...
    bar index -22 TmpVar2
    bar index -23 TmpVar2
    bar index -24 TmpVar2

    However, in real time mode the variables are printed together as in:
    bar index 0 TmpVar1
    bar index 0 TmpVar2


    Can someone explain why the entire formula is not processed for each bar sequentially on historical bars?

    I suspect the answer will also explain some trouble I was having updating an array in a user function.

    PHP Code:
    function main() {
        if (!
    bInit) {
            
    xSeries1 efsInternal("CalcSeries1");  
            
    xSeries2 efsInternal("CalcSeries2"); 
            
    bInit=true;
        }
        
    // get values for each series
        
    var nV1 xSeries1.getValue(0);
        var 
    nV2 xSeries2.getValue(0);

        
    // do more stuff
        
        
    return new Array(nV1nV2);
    }
    function 
    CalcSeries1();
        
    // do stuff
        
    debugPrintln(TmpVar1);
        return (
    xx);
    }
    function 
    CalcSeries2();
        
    // do stuff
        
    debugPrintln(TmpVar2);
        return (
    zz);

Working...
X