The log looks fine to me. You're placing and immediately removing a pending trade at every bar. Only the third entry was hit because the price was already over the limit when you placed the trade.

So, I can not see any problem so far, at least not in the log. Your script does indeed not make much sense to me, maybe it does not do what you intended? For looking into details, just print more data to the log, such as the current price.

The computer just does what you tell it to do.