If you want to make it dependent on your data, pass timeframe_in_m to your strategy.
Data feeds have a parameter named timeframe which carries the original value when the data feed was created. Using it (rather than an extra parameter) together with the chosen compression, you can get it ...
It's not available. Cancel it and resend it (this is actually what happens in real life)
Wouldn't that depend on the exchange and broker? I am not very sure about how it works at the exchange level, but at the broker level, my broker sends me an itemized bill at the end of the day, and when I modify an order, it doesn't show multiple items in the bill.
Further, at a programmatic level, it would be convenient to have a modify API even if it just recreates the order under the hood.
There is no such thing as a sample implementation.
You send an order to the market: self.buy(price=myprice, exectype=bt.Order.MyPreferredExecutionType)
The order is completed and notified to notify_order(order)
order.executed.price contains the actual execution price
A new order is sent to act as a stop-loss order: self.sell(price=% of order.executed.price, exectype=probably Stop)