btreport icon indicating copy to clipboard operation
btreport copied to clipboard

Missing equity curve and weekly returns

Open pigslayer12 opened this issue 6 years ago • 6 comments

Hello, first thanks for sharing your work, its very useful!

I am having trouble with the pdf report, its blank for the equity curve and weekly return graph. The problem is I am not getting any errors so I dont know where to begin troubleshooting. Although I have tried a different pdf viewer without luck.

Also I used the post on "Actuarial Data Science" as reference and I have my code setup in a similar way. The difference is that I am passing an empty strategy and providing an external trade list using backtraders add_order_history. oh and I am using windows 10, and have double checked the requirements are satisfied.

The png images are generating correctly in the templates folder, but they dont seem to be getting placed into the pdf. Is this just an issue with weasyprint and windows? Thats my only guess. I followed the instructions to ensure weasyprint works with windows.

So, where should I look first to solve this problem? Thank you in advance.

edit: I also wanted to mention my datetime's are set to be the index column in my dataframe, and type() returns "pandas._libs.tslib.Timestamp", so I believe I have my dates set up correctly.

pigslayer12 avatar Apr 29 '18 02:04 pigslayer12

Hi, Were you able to run the example successfully?

Oxylo avatar May 01 '18 17:05 Oxylo

Thanks for creating the reporting tool. Same issue here.

Yes, I able to run the example successfully in Windows 7 with one warning.

The following is the output from console: C:\dev\lib\anaconda3\4.1.1\envs\backtrader\lib\site-packages\weasyprint\fonts.py:41: UserWarning: @f ont-face is currently not supported on Windows warnings.warn('@font-face is currently not supported on Windows') 2017-09-19 - 08:00:00, *** MKT: BTC/USD BUY: 0.024000262739718413 2017-09-22 - 18:00:00, *** MKT: BTC/USD SELL: 0.024000262739718413 2017-10-06 - 14:00:00, *** MKT: BTC/USD BUY: 0.019573615436407676 2017-10-25 - 03:00:00, *** MKT: BTC/USD SELL: 0.019573615436407676 2017-10-27 - 20:00:00, *** MKT: BTC/USD BUY: 0.018677696650734245 2017-10-28 - 16:00:00, *** MKT: BTC/USD SELL: 0.018677696650734245 2017-10-29 - 20:00:00, *** MKT: BTC/USD BUY: 0.017267842114581523 2017-11-10 - 14:00:00, *** MKT: BTC/USD SELL: 0.017267842114581523 2017-11-15 - 22:00:00, *** MKT: BTC/USD BUY: 0.015991378022518717 2017-12-20 - 17:00:00, *** MKT: BTC/USD SELL: 0.015991378022518717 2017-12-27 - 19:00:00, *** MKT: BTC/USD BUY: 0.01772251258138193 2017-12-29 - 01:00:00, *** MKT: BTC/USD SELL: 0.01772251258138193 2018-01-03 - 20:00:00, *** MKT: BTC/USD BUY: 0.017036626670399575 2018-01-09 - 20:00:00, *** MKT: BTC/USD SELL: 0.017036626670399575 2018-01-28 - 21:00:00, *** MKT: BTC/USD BUY: 0.02180313260324379 2018-01-30 - 18:00:00, *** MKT: BTC/USD SELL: 0.02180313260324379 2018-02-09 - 18:00:00, *** MKT: BTC/USD BUY: 0.025451750380712724 2018-02-23 - 00:00:00, *** MKT: BTC/USD SELL: 0.025451750380712724 2018-02-28 - 05:00:00, *** MKT: BTC/USD BUY: 0.02236261164633059 2018-03-07 - 16:00:00, *** MKT: BTC/USD SELL: 0.02236261164633059 2018-03-20 - 21:00:00, *** MKT: BTC/USD BUY: 0.02485473921573921 2018-03-26 - 13:00:00, *** MKT: BTC/USD SELL: 0.02485473921573921 2018-04-09 - 01:00:00, *** MKT: BTC/USD BUY: 0.02842323431893809 2018-04-09 - 23:00:00, *** MKT: BTC/USD SELL: 0.02842323431893809 2018-04-12 - 10:00:00, *** MKT: BTC/USD BUY: 0.02784060596041849 2018-04-21 - 09:00:00, *** MKT: BTC/USD SELL: 0.02784060596041849 See .\report.pdf for report with backtest results.

Please advise. Thank you.

limcheekin avatar Jul 13 '18 03:07 limcheekin

Great work! Same problems the charts are missing... Thanks!

borismikanikrezai avatar Aug 21 '20 00:08 borismikanikrezai

Hi, Were you able to run the example successfully?

Yes, but the charts are missing. They are in the templates directory. But impossible to display them in the pdf report

borismikanikrezai avatar Aug 21 '20 18:08 borismikanikrezai

Ok - found the solution. The issue now is that my equity_curve looks weird. I will investigate.

borismikanikrezai avatar Aug 21 '20 22:08 borismikanikrezai

I think this is because your code is working only for hourly strategies, not daily or weekly.

borismikanikrezai avatar Aug 21 '20 23:08 borismikanikrezai