Professional virtual currency information station welcome
We have been making efforts.

Stock Trading Strategy Backtest Data Restoration Method And Calculation Of Pre-restoration And Post-restoration Prices

How to restore data in stock trading strategy backtesting?

There are two prices for stocks – the restoration price and the non-restoration price. The trading of stocks is carried out according to the ex-rights price, but the ex-rights price is affected by dividends and share allotments, and the continuity of prices is disrupted. On the contrary, the restoration price eliminates the impact of dividends and allotments and ensures price continuity, but transactions are not conducted according to the restoration price. So in strategy backtesting, which price is the trading signal generated, and what price is the buying and selling behavior based on? If the restoration price is used, should it be used before restoration or after restoration?

Restoration is to restore the stock price and trading volume, draw a stock price trend chart according to the actual rise and fall of the stock, and adjust the trading volume to the same equity caliber. After a stock goes ex-rights or ex-dividend, the stock price changes, but the actual cost does not change. 1. The previous restoration of rights is based on the current price. The calculation formula is: price after rights restoration = (price before rights restoration – cash dividend) ÷ (1 + change ratio of circulating shares); 2. Post-rights restoration is based on the price before rights ex-rights to calculate the market cost price of the stock after ex-rights. The calculation formula is: price after restoration of rights = price before restoration of rights × (1 + change ratio of circulating shares) + cash dividend; 3. The price of non-restoration of rights is the price on that day. 4. Regarding restoration of rights:

(1) Based on the price before restoration (daily use)

Since the previous stock price is based on the current time point after the pre-rights are restored and then participated in the backtest, the stock data of each day in history contains the future information of the stock from then to the present, so the backtest itself contains future functions, and there is an error with the actual prediction. The length of time before the restoration of rights generally cannot exceed 5 years. Because of the restoration of rights, the price base is getting smaller and smaller, and the cumulative calculation error is getting larger and larger.

(2) Based on post-restoration price (rarely used)

If the current price is changed, it is easy to be unable to connect with the simulated market and the real market. A middleware is needed to convert data between the real market and the real market.

In fact, the pre-righting price introduces a future function. For a strategy based on price factors, the pre-righting method is problematic. For backtesting, the standard method should be as close to the actual transaction situation as possible, and trade according to the non-rights price, so as to avoid the use of future functions to the greatest extent. Then, the background processing mechanism of the backtest can realize the automatic processing of ex-rights and dividends on the ex-rights and ex-dividend dates for the number of shares, the number of account holdings, the stock price, and the cash account dividends.

Like(0) 打赏
未经允许不得转载:Lijin Finance » Stock Trading Strategy Backtest Data Restoration Method And Calculation Of Pre-restoration And Post-restoration Prices

评论 Get first!

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Sign In

Forgot Password

Sign Up