Announcement

Collapse
No announcement yet.

proper syntax

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

  • proper syntax

    how would one write

    close() > high(of the last 10 bars?)

  • #2
    Here's how I would do this.

    PHP Code:

    function main (nLookback) {

        if (
    nLookback == nullnLookback 10;
        
        var 
    HH findHighestHigh(nLookback);

        
    // ... now you can look for the comparison
        
        
    if (close() > HH) {
            
    // do something
        
    }

    }

    function 
    findHighestHigh(nLookback) {
        
        var 
    HH null// Highest High

        // find Highest High
        
    for (= -(nLookback-1); 1i++) {
            if (
    HH == null) {
                
    HH high(i);
            } else if (
    high(i) > HHHH high(i);
        }
        
        return 
    HH;

    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment

    Working...
    X