strategy logging with trailing stop losses
I'm new to backtrader and trying to create a strategy that also uses trailing stop losses.
Is there any way to log when a position is closed due to a planned strategy vs a trailing stop loss?
No one has any ideas?
run-out last edited by
You could track you stop loss orders in a list/dictionary, and in notify_order when an order executes you could check the list, if it's in there you print or save in an analyzer.
booboothefool last edited by
notify_order, you can check if
5=StopTrailas opposed to whatever exectype your regular close is.
thats great! thanks