renamed after slippage profit_percent so it wont affect _calculate_results_metrics()
This commit is contained in:
parent
04147eb7c7
commit
379bfc120a
@ -29,16 +29,16 @@ class SharpeHyperOptLossDaily(IHyperOptLoss):
|
|||||||
Uses Sharpe Ratio calculation.
|
Uses Sharpe Ratio calculation.
|
||||||
"""
|
"""
|
||||||
# get profit_percent and apply slippage of 0.1% per trade
|
# get profit_percent and apply slippage of 0.1% per trade
|
||||||
results.loc[:, 'profit_percent'] = results['profit_percent'] - 0.0005
|
results.loc[:, 'profit_percent_after_slippage'] = results['profit_percent'] - 0.0005
|
||||||
|
|
||||||
sum_daily = (
|
sum_daily = (
|
||||||
results.resample("D", on="close_time").agg(
|
results.resample("D", on="close_time").agg(
|
||||||
{"profit_percent": sum}
|
{"profit_percent_after_slippage": sum}
|
||||||
)
|
)
|
||||||
* 100.0
|
* 100.0
|
||||||
)
|
)
|
||||||
|
|
||||||
total_profit = sum_daily["profit_percent"]
|
total_profit = sum_daily["profit_percent_after_slippage"]
|
||||||
expected_returns_mean = total_profit.mean()
|
expected_returns_mean = total_profit.mean()
|
||||||
up_stdev = np.std(total_profit)
|
up_stdev = np.std(total_profit)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user