Backtrader to Simulate MakerDAO/Compound CDP
dmintercept last edited by
I have been playing around with backtrader for about the last 6 months and using it to build simple trading strategies. Last week, I was interested in looking at backtesting CDP performance if you set collateral ratios at which to maintain the CDP position. You can think of it as a leveraged position where the leverage is kept within a constant range. Here is the progress I have so far: https://dash-cdp-sim.herokuapp.com/
I would be happy to receive feedback on my code if anyone has input on the backtrader implementation or with my Dash code. Repo: https://github.com/dmintercept/cdp_simulation
vladisld last edited by
Kudos @dmintercept - very good project. Could be easily used as a sample of how to integrate and visualize strategy exploration with Dash framework.
The code also looks pretty solid to me - probably except some raw constants used for order sizes and cash amounts ( which could be easily converted to UI specified values if needed ).
Would also be great to be able to specify additional analyzers to be plotted - but this is a minor comment as well.
Thanks for sharing your work.
run-out last edited by
Nice dashboard. I like the way you organized your code.