Why Sharp ratios is not inverted ?
-
Hi,
I'm so confused with this subtitle.def simple_strategy(data): close = data.sel(field='close') open = data.sel(field='open') is_liquid = data.sel(field='is_liquid') rtrn = close / open rtrn_d = rtrn.quantile(0.05, dim='asset') rtrn_u = rtrn.quantile(0.95, dim='asset') strategy_1 = xr.where(rtrn > rtrn_u,1,0) strategy_2 = xr.where(rtrn < rtrn_d,-1,0) weights = strategy_1 + strategy_2 weights = weights * is_liquid weights = weights / abs(weights).sum('asset') return weights weights = simple_strategy(data) qnout.write(weights) weights = qnout.clean(weights, data, "stocks_nasdaq100") qnout.check(weights, data, "stocks_nasdaq100")
If I changed the position like 1 to -1, -1 to 1, Sharp ratios does not invert.
Why?
Best regards,
-
This post is deleted! -
@cyan-gloom The backtester automatically subtracts slippage to each trade, so when you swap long and short positions you should not expect to get the same result multiplied by -1; slippage is subtracted to profits and losses. This means that profits will be converted to losses, but losses could still be losses because of slippage (if they were small losses for example).
-
@support
Thanks a lot !