Announcement

Collapse
No announcement yet.

RSI quits plotting intermittently

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

  • RSI quits plotting intermittently

    In my study, I calculate the difference between an RSI(2) and a calculated RSI. For some bars, the RSI(2) is not plotted. I have overlayed a RSI to verify this.

    This picture shows the problem. Click image for larger version

Name:	2013-04-03_0706.png
Views:	1
Size:	35.3 KB
ID:	246876

    How does one fix this? Should I call the RSI a different way? I have tried also calling it as a series object and as retrieving single values.

    I have found the following section of code that if taken out allows the RSI2 to plot correctly.

    PHP Code:
    var vtemp=0;
    var 
    vtemp_1=0;
    var 
    vtemp2=0;
    var 
    vtemp2_1=0;

    // this section cause rsi to boobooooooooooooooooooooooooooooooooooooooo
    for (i=fromIndexbarC+1i++)
    {
        
    nn =i-barC;
       var 
    vchg close(nn)-close(nn-1);
        
    vtemp_1 vtemp;
        
    vtemp2_1 vtemp2;
       if (
    isNaNvchg ) == true) { vchg 0; }
        
    vtemp scaleVal*vchg + (1-scaleVal)*vtemp_1;

        var 
    vabsChg Math.abs(vchg);
        
    vtemp2scaleVal*vabsChg + (1-scaleVal)*vtemp2_1;
     }
    //////////////////////////////////////to here
    vnetChgAvgvtemp;
    vtotChgAvg vtemp2;
     

    if ((
    vnetChgAvg)!=&& (vtotChgAvg)!=0)
    {
        
    rsiPO50*(vnetChgAvgvtotChgAvg+1);
    }
    else { 
    rsiPOrsiPO_1; }


    if (
    bExpired)
    {
        
    rsiPO=50;
    }

    vbss  Math.abs(rsi(2,0)-rsiPO);

    return  Array(
    rsiPOrsi(2),vbss);



  • #2
    Just a very quick look revealed that the return statement needs correction:
    replace it with:
    PHP Code:
    return  new Array(rsiPOrsi(2),vbss); 
    Wayne
    Last edited by waynecd; 04-04-2013, 02:21 AM.

    Comment


    • #3
      No difference with that change.

      Comment

      Working...
      X