backtrader2 / backtrader

Python Backtesting library for trading strategies
https://www.backtrader.com
GNU General Public License v3.0
238 stars 54 forks source link

Add deep clone to make order clone more secure #79

Open santatic opened 3 years ago

santatic commented 3 years ago

Issues My strategy has a situation I have to clone old order, then I add some info to new cloned order. But I get error that info object shared between old order and new order. Whenever I add data to new order info will exist in old order.

Solution I add flag deep=True to order.clone() function to clone order info whenever call clone() function