2019-10-02: The community is currently in read-only mode
backtesting with manual trades
Hi guys, just wondering if backtrader allows me to import trades manually like a buy or sell column inside a CSV. If there is a 1, buy, if there is a -1 sell etc etc.
I'm playing around with different machine learning methods, and don't have conventional trade "logic" that i can program in. It's all a bit of a black box to me, so all i get are signals, and i'd like to backtest them.
Any guidance would be appreciated.
Thank you so much!!!
@backtrader I am trying to add a stoploss and takeprofit onto my manually imported order history.
From what i can tell in the documentation (eg Bracket orders), it all works inside a strategy class... but a manual order history is it's own cerebro function.
Could you please point me in the right direction?
I am trying to add a stoploss and takeprofit onto my manually imported order history.
You cannot. Because the order is executed right at once and has no binding to other orders (the brackets).
Set the brackets (as
OCOorders) when you are notified in
notify_order. See Docs - OCO Orders