フィルターのクリア

Short sell with backtest Engine

5 ビュー (過去 30 日間)
ando
ando 2021 年 1 月 15 日
コメント済み: Tim Billingsley 2021 年 8 月 31 日
What's the most effecient way to implement short selling strategies with the backtestEngine?
Using this Matlab example as a reference: https://www.mathworks.com/help/finance/backtest-investment-strategies-with-trading-signals.html
It appears that if you change crossoverRebalanceFcn to output negative portfolio weights, for example
change
new_weights(idx) = availableCapital / uninvestedAssets;
to
new_weights(idx) = -availableCapital / uninvestedAssets;
That seems to work. Is that the correct way to implement a short? Any other considerations with this approach or is there a better approach?

採用された回答

Brendan
Brendan 2021 年 1 月 20 日
hello again Ando,
Yes, that is how you take short positions using the backtestEngine. You just set a negative weight on an asset. Since the total weights should equal to 1, shorting an asset will mean you have additional weight to allocate to long positions, or else the unallocated weight will stay in cash earning the RiskFreeRate.
cheers,
-brendan
  1 件のコメント
Tim Billingsley
Tim Billingsley 2021 年 8 月 31 日
Is the backtestEngine really set up to handle short positions? When I have negative weights on an asset, there are intermediate buy and sell costs and also unaccounted for Turnover values?
Regards
Tim

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by