Now my questions is how can I tell BT to use mybbroker.py instead of bbroker.py? (I understand I can simply over-write bbroker.py but I'm sure there is a more elegant way to switch these things. I just don't know how)

backtrader tries to provide most realistic execution price for Limit orders.
Using the 4 price spots (Open/High/Low/Close) it can be partially inferred if the requested price can be improved.
For Buy Orders
Case 1:
If the open price of the bar is below the limit price the order executes immediately with the open price. The order has been swept during the opening phase of the session*

Is there anyway to switch this behavior off? Say for cases when the OHLC bars are constructed from intraday data?

Basically to have the open price be treated just as the other ones (for a limit buy, if open price < smaller than limit price, execute the limit at the limit price).

Alternatively, would it be possible to have BT ignore the open price altogether? I mean is it safe to feed BT an open-less file or do I risk running into undefined behavior?

I was wondering if there was a way to get getposition().size, or the same information, either in an observer or somehow out of cerebro.run() e.g. I want to get a vector the same length as the data with at each time point the number of position held by the strategy at that point in time.

I might be wrong on this, but it seems to me that backtrader (the library) is more flexible. It seems to me that a simple block like this in the backtrader.Strategy class could help toughening up the broker:

@backtrader: Perfect. Thanks for the pointer, it indeed addresses my problem. Just to be sure, could you confirm that the backtrader-preferred way to add an observer as a new column to the original dataframe (that was fed to backtrader) is: