Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#36 [svn] Split adjust incorrect for first bar

closed-fixed
Charts (19)
7
2006-08-10
2006-08-09
No

The first bar on a chart does not get split adjusted,
making it very large compared with the rest of the
chart.

Discussion

  • Logged In: YES
    user_id=1281708

    Fixed with svn commit #258. The code was just ignoring this
    last bar!

    Index: src/src/quoteset.cc

    =======
    --- src/src/quoteset.cc (revision 254)
    +++ src/src/quoteset.cc (working copy)
    @@ -153,6 +153,15 @@
    rec.low( rec.low() * adjfactor );
    rec.close( rec.adjclose() );
    }
    +
    + // Adjust the last quote:
    + // Fixes bug 1537676:
    + closequote_record& rec = _quotes[sz-1];
    + double adjfactor = rec.adjclose() / rec.close();
    + rec.open( rec.open() * adjfactor );
    + rec.high( rec.high() * adjfactor );
    + rec.low( rec.low() * adjfactor );
    + rec.close( rec.adjclose() );
    }else
    {
    double prev_ratio = _quotes[0].adjclose() / _quotes[0].
    close();

     
    • status: open --> closed-fixed