BacktestRookies

Average Down

This strategy has been published for a Pyramiding tutorial on the Backtest Rookies website.

For a full overview of the code and an introduction to Pyramiding check out our site.

Summary
The code example will create a simple script that allows us to average down whenever our portfolio is down x%. The idea will be to bring our average cost down so that we can still exit with a profit when conditions improve. With this in mind, the strategy shall also have a simple take profit exit at x% above our average price.

Inputs

  • Target Loss to Average Down (%): This is the target percentage level will trigger us to average down. In other words, if we have a close below this level from our average buying price, we will average down.
  • Target Take Profit: A standard take profit percentage level. Use this to set how much profit you will target.
  • % Of Current Holdings to Buy: Is the number of shares/contracts we will aim to buy when we average down. 50 will mean we buy 50% of our current holdings. So if we have 100 shares, then we buy 50 when we average down.
  • SMA Period: Defines our SMA lookback period. Our strategy will enter the first/initial position when we have a close above our SMA level.



开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?