BTFD (Buy The F... Dip)
Use the link below to go the original post
Click here to see the full blog post
Should I just run the script as python btfd.py? Or something need to be prepared first? I am asking because I don't see any output after I run the script.
The script produces no output, it was only meant to produce charts with
In the post it is executed with:
./btfd.py --plot --strat approach="'closeclose'"
./btfd.py --plot --strat approach="'highlow'"
It only creates charts because it is comparing itself to a the
BTFDchart from dark-bid
My bad. I've expected that even by default the script will print or plot something. I am still struggling with your argument parsing approach. :)
Could you please clarify how does this script identify position size? As I remember default position size is 1, here you did't define position size directly, but it buys 2x cash at broker account. What if I want to buy for 1.5x broker cash or 3x broker cash? Will it work?
The script doesn't identify position size, just if a position exists
The sizing is controlled with:
where the default value for
And leverage is controlled by setting a default commission scheme in the broker with:
cerebro.broker.setcommission(**eval('dict(' + args.comminfo + ')'))
--comminfo leverage=3.5to play with a
Sorry to bother you with additional requests/complaints.
Now broker value is calculated as cash + open position and gives bursts of values when leverage isused. With this bursts all the drawdown calcs, sharpe (I think all the stats calculated based on equity) are incorrect. Usually the broker value in case of leverage is cash(=0) + open position - loan. In this case only gains/losses are added to broker value for open positions, not the full cost of position.
is there any way to fulfill such approach (apply loan on the broker value for open positions) in the bt in the baseline code?
Here is the link to picture https://yadi.sk/i/oLQA7-P235ZyDh
It is not shown in the post.
Such calculation is probably what's already being done: the unleveraged value.
The idea seems to be to swap the current value with the current unleveraged value, so that the actual value curve doesn't spike. The leveraged value would still be accessible.
It makes sense