Now I get this error:
AttributeError: 'Lines_LineSeries_DataSeries_OHLC_OHLCDateTime_Abst' object has no attribute 'close'

By overriding the lines, the only remaining lines in the data feed are lines = ('datetime', 'ask', 'bid' ). Some part of your code (or if you are passing this to the broker) is trying to access close which is no longer part of the hierarchy.

To summarize: you should check the actual execution code in your first attempt, where even if you show time=-1, something else is actually being executed. The part of the source code where the error happens:

if self.p.time >= 0:
# add time value and format if it's in a separate field
dtfield += 'T' + linetokens[self.p.time]