Merge pull request #824 from xmatthias/rymdluo-patch-1
Make backtesting report markdown shareable (resubmit)
This commit is contained in:
commit
5e99df1759
@ -106,7 +106,7 @@ class Backtesting(object):
|
|||||||
len(results[results.profit_BTC > 0]),
|
len(results[results.profit_BTC > 0]),
|
||||||
len(results[results.profit_BTC < 0])
|
len(results[results.profit_BTC < 0])
|
||||||
])
|
])
|
||||||
return tabulate(tabular_data, headers=headers, floatfmt=floatfmt)
|
return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe")
|
||||||
|
|
||||||
def _get_sell_trade_entry(
|
def _get_sell_trade_entry(
|
||||||
self, pair: str, buy_row: DataFrame,
|
self, pair: str, buy_row: DataFrame,
|
||||||
|
@ -374,16 +374,15 @@ def test_generate_text_table(default_conf, mocker):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result_str = (
|
result_str = (
|
||||||
'pair buy count avg profit % '
|
'| pair | buy count | avg profit % | '
|
||||||
'total profit BTC avg duration profit loss\n'
|
'total profit BTC | avg duration | profit | loss |\n'
|
||||||
'------- ----------- -------------- '
|
'|:--------|------------:|---------------:|'
|
||||||
'------------------ -------------- -------- ------\n'
|
'-------------------:|---------------:|---------:|-------:|\n'
|
||||||
'ETH/BTC 2 15.00 '
|
'| ETH/BTC | 2 | 15.00 | '
|
||||||
'0.60000000 20.0 2 0\n'
|
'0.60000000 | 20.0 | 2 | 0 |\n'
|
||||||
'TOTAL 2 15.00 '
|
'| TOTAL | 2 | 15.00 | '
|
||||||
'0.60000000 20.0 2 0'
|
'0.60000000 | 20.0 | 2 | 0 |'
|
||||||
)
|
)
|
||||||
|
|
||||||
assert backtesting._generate_text_table(data={'ETH/BTC': {}}, results=results) == result_str
|
assert backtesting._generate_text_table(data={'ETH/BTC': {}}, results=results) == result_str
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user