Announcement

Collapse
No announcement yet.

Problem with series objects

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

  • Problem with series objects

    Hi All,

    I'm using 2 simple functions to create 2 series (when called using the efsInternal command).

    The first one

    PHP Code:
    function getGains(objSeries) {
        
        var 
    vGain 0;
        if(
    objSeries != null) {
            
            var 
    objSeriesValue     objSeries.getValue(0);
            var 
    openValue         open(0);
            
            if(
    objSeriesValue openValue)
                
    vGain objSeriesValue openValue;    
        }
        
        return 
    vGain;

    works fine. I'm able to create the series and retrieve the values from within the main() function; the second one doesn't seem very different:

    PHP Code:
    function getLosses(objSeries) {
        
        var 
    vLoss 0;
        if(
    objSeries != null) {
            
            var 
    objSeriesValue     objSeries.getValue(0);
            var 
    openValue         open(0);
            
            if(
    objSeriesValue openValue)
                
    vLoss openValue objSeriesValue;
        }
        
        return 
    vLoss;

    but unfortunately I cannot generate any series from it.

    Any idea what might be going on?

    Thanks

    G.

  • #2
    Found the problem

    Made the following changes:

    PHP Code:
     var vGain null
    and

    PHP Code:
     var vLoss null
    And both series are now generated.

    Aplogies for wasting anyone's time

    G.

    Comment

    Working...
    X