The OFX 2.2 specifications on page 87 mention this:
• is the date and time that, if used by the client as the next requested , it would pick up exactly where the current response left off. It is the exclusive date and time in history where the server stopped looking for information, based on the request rules.
So DTEND is an exclusive date.
The code in ofx.py:
self.buildDate("DTEND", self.statement.end_date, False)
But in function recalculate_balance in statement.py the end_date is calculated inclusive:
stmt.end_date = max(sl.date for sl in stmt.lines)
The ofxstatement documentation is not clear about this and it will lead to balance inconsistencies as I have already experienced.