How to get Maximum Adverse Excursion of each trade after cerebro run?
-
I want to analyse profit and MAE of each trade, and profit distribution after strategy run.
MAE is defined as the most price movement against position -
You need:
-
An
Analyzer
which calculatesMAE
-
Add it with
cerebro.addanalyzer(MAEAnalyzer, **kwargs)
-
Access it after the run (see: Docs - Analyzers
It is not an analyzer which is included with backtrader
-
-
I've coded MAE/MFE analyzer recently. Check this topic
https://community.backtrader.com/topic/1274/closed-trade-list-including-mfe-mae-analyzer
-
@ab_trader It's great. Thanks for sharing.
-
@ab_trader said in How to get Maximum Adverse Excursion of each trade after cerebro run?:
I've coded MAE/MFE analyzer recently. Check this topic
https://community.backtrader.com/topic/1274/closed-trade-list-including-mfe-mae-analyzer
Totally forgotten!