{"id":1670,"date":"2024-11-28T07:26:00","date_gmt":"2024-11-27T23:26:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=1670"},"modified":"2024-11-04T16:26:02","modified_gmt":"2024-11-04T08:26:02","slug":"%e8%bf%90%e7%94%a8-121-%e7%ad%96%e7%95%a5%e6%a8%a1%e5%9e%8b%ef%bc%8c%e6%96%a9%e8%8e%b7-121-%e7%9a%84%e6%8a%95%e8%b5%84%e6%94%b6%e7%9b%8a","status":"publish","type":"post","link":"https:\/\/www.laoyulaoyu.com\/index.php\/2024\/11\/28\/%e8%bf%90%e7%94%a8-121-%e7%ad%96%e7%95%a5%e6%a8%a1%e5%9e%8b%ef%bc%8c%e6%96%a9%e8%8e%b7-121-%e7%9a%84%e6%8a%95%e8%b5%84%e6%94%b6%e7%9b%8a\/","title":{"rendered":"\u8fd0\u7528 121 \u7b56\u7565\u6a21\u578b\uff0c\u65a9\u83b7 121% \u7684\u6295\u8d44\u6536\u76ca"},"content":{"rendered":"\n<p>\u4f5c\u8005\uff1a<a href=\"https:\/\/www.laoyulaoyu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/102708.png\" alt=\"\" class=\"wp-image-2780\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong>\u4e0a\u6b21\u5199\u4e86\u4e00\u7bc7\u300a\u80a1\u7968\u201c\u914d\u7edf\u5957\u5229\u201d\u5b9e\u6218\u7ec8\u6781\u6307\u5357\u300b\uff0c\u6709\u8bfb\u8005\u95ee\u8fd8\u6709\u6ca1\u6709\u66f4\u9ad8\u6536\u76ca\u7684\u80a1\u7968\u201c\u914d\u7edf\u5957\u5229\u201d\u6a21\u578b\u63a8\u8350\u3002\u90a3\u4eca\u5929\u6211\u5c31\u8fd8\u662f\u63a5\u7740\u4e0a\u9762\u8fd9\u7bc7\uff0c\u4ecb\u7ecd\u4e00\u4e2a<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u9ad8\u6536\u76ca\u7387\u7684121\u7b56\u7565\u6a21\u578b<\/mark>\uff0c\u8fd9\u662f\u4e00\u79cd\u7ed3\u5408\u4e86LSTM\u795e\u7ecf\u7f51\u7edc\u548c\u534f\u6574\u539f\u7406\u7684\u9ad8\u6536\u76ca\u4ea4\u6613\u7b56\u7565\uff0c\u7528\u4e8e\u9884\u6d4b\u4e24\u5bb6\u516c\u53f8\u80a1\u7968\u4ef7\u683c\u4e4b\u95f4\u7684\u77ed\u671f\u504f\u5dee\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u5e76\u53ef\u6839\u636e\u5fae\u5999\u7684\u4ef7\u683c\u8d70\u52bf\u8fdb\u884c\u4ea4\u6613\u5e76\u53d6\u5f97\u4e86\u7ffb\u500d\u7684\u56de\u62a5<\/mark>\u3002<\/pre>\n<\/blockquote>\n\n\n\n<p>\u5982\u679c\u4e00\u7b14 2 \u4e07\u7f8e\u5143\u7684\u6295\u8d44\u5728\u4e00\u5e74\u4e4b\u5185\u589e\u957f\u5230\u4e86 43200 \u7f8e\u5143\uff0c\u54ea\u662f\u591a\u4e48\u8ba9\u4eba\u6b23\u559c\u7684\u4e8b\u60c5\u554a\uff01\u800c\u8fd9\u4e5f\u6b63\u662f 121 \u6a21\u578b\u540d\u5b57\u7684\u7531\u6765\uff08121%\u7684\u5e74\u5316\u6536\u76ca\u7387\uff09\u3002\u8fd9\u4e2a\u5b9a\u5236\u4ea4\u6613\u7b56\u7565\uff0c\u5c06\u6df1\u5ea6\u5b66\u4e60\u7684\u9884\u6d4b\u80fd\u529b\u4e0e\u91d1\u878d\u8ba1\u91cf\u7ecf\u6d4e\u5b66\u7684\u57fa\u672c\u539f\u7406\u76f8\u878d\u5408\u3002\u63a5\u4e0b\u6765\uff0c\u8ba9\u6211\u4eec\u4e00\u8d77\u4e86\u89e3\u4f7f 121 \u6a21\u578b\u4e0e\u4f17\u4e0d\u540c\u7684\u57fa\u672c\u601d\u60f3\u548c\u65b9\u6cd5\u5427\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u4ec0\u4e48\u662f 121 \u6a21\u578b<\/strong><\/h2>\n\n\n\n<p>121 \u6a21\u578b\u7684\u4e24\u4e2a\u57fa\u672c\u6982\u5ff5\u662f\u534f\u6574\u548c\u957f\u77ed\u671f\u8bb0\u5fc6\uff08LSTM\uff09\u795e\u7ecf\u7f51\u7edc\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-18.png\" alt=\"\" class=\"wp-image-2791\"\/><\/figure>\n<\/div>\n\n\n<p><strong>\u534f\u6574\uff08Cointegration\uff09\uff1a<\/strong>\u5728\u91d1\u878d\u5e02\u573a\u4e2d\uff0c\u6709\u4e9b\u8d44\u4ea7\u5bf9\u5177\u6709\u957f\u671f\u5173\u7cfb\uff0c\u5b83\u4eec\u7684\u4ef7\u683c\u4f1a\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\u800c\u76f8\u4e92\u8ddf\u968f\uff0c\u540c\u65f6\u4e5f\u4f1a\u51fa\u73b0\u77ed\u671f\u504f\u5dee\u3002\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u534f\u6574\u5173\u7cfb\u3002\u8be5\u6a21\u578b\u901a\u8fc7\u9009\u62e9\u4e00\u5bf9\u9ad8\u5ea6\u76f8\u5173\u7684\u8d44\u4ea7\uff08\u672c\u4f8b\u4e2d\u4e3a\u82f9\u679c\u516c\u53f8 [AAPL] \u548c\u5fae\u8f6f\u516c\u53f8 [MSFT]\uff09\u5e76\u76d1\u6d4b\u5176\u4ef7\u683c\u4e4b\u95f4\u7684\u4ef7\u5dee\u6765\u5229\u7528\u8fd9\u79cd\u5173\u7cfb\u3002\u5c3d\u7ba1\u5b58\u5728\u8fd9\u79cd\u77ed\u671f\u504f\u5dee\uff0c\u4f46\u534f\u6574\u7406\u8bba\u8868\u660e\uff0c\u8fd9\u79cd\u4ef7\u683c\u4e00\u5b9a\u4f1a\u56de\u5230\u5b83\u4eec\u7684\u5747\u8861\u5173\u7cfb\uff0c\u4ece\u800c\u63d0\u4f9b\u4e00\u4e2a\u4e34\u65f6\u4ea4\u6613\u673a\u4f1a\u3002<\/p>\n\n\n\n<p><strong>\u957f\u77ed\u671f\u8bb0\u5fc6\uff08LSTM\uff09\u795e\u7ecf\u7f51\u7edc\uff1a<\/strong>Long Short-Term Memory&nbsp;\uff0c\u4f20\u7edf\u7684\u7edf\u8ba1\u6a21\u578b\u53ea\u80fd\u6355\u6349\u51e0\u4e2a\u65b9\u9762\uff0c\u65e0\u6cd5\u7406\u89e3\u91d1\u878d\u6570\u636e\u4e2d\u590d\u6742\u7684\u975e\u7ebf\u6027\u6a21\u5f0f\u3002LSTM \u795e\u7ecf\u7f51\u7edc\u4e13\u95e8\u7528\u4e8e\u5904\u7406\u8fde\u7eed\u6570\u636e\uff0c\u5e76\u4ece\u8fc7\u53bb\u7684\u8d8b\u52bf\u4e2d\u5b66\u4e60\uff0c\u9884\u6d4b\u672a\u6765\u7684\u8d70\u52bf\u3002\u5f53\u60a8\u7528\u5386\u53f2\u4ef7\u5dee\u6570\u636e\u8bad\u7ec3 LSTM \u65f6\uff0c\u8fd9\u610f\u5473\u7740\u8be5\u6a21\u578b\u5c06\u6355\u6349\u8fd9\u4e9b\u77ed\u671f\u504f\u5dee\u7684\u6a21\u5f0f\uff0c\u4ece\u800c\u6839\u636e\u56de\u5f52\u5747\u503c\u751f\u6210\u4e70\u5165\u6216\u5356\u51fa\u4fe1\u53f7\u3002<\/p>\n\n\n\n<p>\u6362\u8a00\u4e4b\uff0c121 \u6a21\u578b\u4f9d\u8d56\u534f\u6574\u5173\u7cfb\u6765\u68c0\u6d4b\u5177\u6709\u957f\u671f\u5747\u8861\u5173\u7cfb\u7684\u4e00\u7ec4\u8d44\u4ea7\u5bf9\uff0c\u518d\u8fd0\u7528 LSTM \u6765\u9884\u6d4b\u77ed\u671f\u504f\u79bb\u5747\u8861\u7684\u72b6\u51b5\u3002\u6b63\u662f\u8fd9\u79cd\u53cc\u7ba1\u9f50\u4e0b\u7684\u65b9\u6cd5\uff0c<strong>\u8ba9\u8be5\u6a21\u578b\u80fd\u591f\u5229\u7528\u6682\u65f6\u7684\u4ef7\u683c\u5dee\u5f02\uff0c\u5b9e\u73b0 121% \u5de6\u53f3\u7684\u5e74\u5316\u6536\u76ca\u7387\u3002<\/strong><\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6211\u4f1a\u5e26\u4f60\u4e86\u89e3\u6536\u96c6\u6570\u636e\u3001\u8ba1\u7b97\u4ef7\u5dee\u3001\u9884\u5904\u7406\u8f93\u5165\u3001\u5efa\u7acb\u6a21\u578b\u4ee5\u53ca\u6267\u884c\u8bc4\u4f30\u7684\u5404\u4e2a\u6b65\u9aa4\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u4f60\u5c06\u660e\u767d\u5982\u4f55\u901a\u8fc7\u8fd0\u7528\u673a\u5668\u5b66\u4e60\u6765\u4f18\u5316\u8fc7\u5f80\u7684\u91d1\u878d\u539f\u7406\uff0c\u8fdb\u800c\u5236\u5b9a\u51fa\u9ad8\u56de\u62a5\u7684\u7b56\u7565\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u6a21\u578b\u5b9e\u73b0<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>2.1 \u6570\u636e\u51c6\u5907<\/strong><\/h3>\n\n\n\n<p>\u6211\u4eec\u7684\u7b2c\u4e00\u6b65\u662f\u4ece\u96c5\u864e\u8d22\u7ecf\uff08Yahoo Finance\uff09\u6536\u96c6 AAPL \u548c MSFT \u7684\u5386\u53f2\u8c03\u6574\u6536\u76d8\u4ef7\u6570\u636e\u3002\u8fd9\u4e9b\u6570\u636e\u5bf9\u4e8e\u5efa\u7acb\u3001\u8bad\u7ec3\u548c\u6d4b\u8bd5\u6a21\u578b\u81f3\u5173\u91cd\u8981\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>import pandas as pd\nimport yfinance as yf\nimport matplotlib.pyplot as plt\n\n# Define ticker symbols and date range\nticker1 = 'AAPL'\nticker2 = 'MSFT'\nstart_date = '2015-01-01'\nend_date = '2023-10-01'\n\n# Download data\ndata1 = yf.download(ticker1, start=start_date, end=end_date)\ndata2 = yf.download(ticker2, start=start_date, end=end_date)\n\n# Extract adjusted close prices and combine into a single DataFrame\ndf = pd.DataFrame({ticker1: data1&#91;'Adj Close'], ticker2: data2&#91;'Adj Close']})\ndf.dropna(inplace=True)\n\n# Plot price series\nplt.figure(figsize=(14, 7))\nplt.plot(df&#91;ticker1], label=ticker1)\nplt.plot(df&#91;ticker2], label=ticker2)\nplt.title(f'Price Series of {ticker1} and {ticker2}')\nplt.xlabel('Date')\nplt.ylabel('Adjusted Close Price')\nplt.legend()\nplt.show()<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-10.png\" alt=\"\" class=\"wp-image-2782\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>2.2 \u5c06\u6570\u636e\u5206\u6210\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u8bc4\u4f30 121 \u6a21\u578b\uff0c\u6211\u4eec\u5c06\u6570\u636e\u5206\u4e3a\u8bad\u7ec3\u96c6\uff082015-2020 \u5e74\uff09\u548c\u6d4b\u8bd5\u96c6\uff082021-2024\u5e74\uff09\u3002\u8fd9\u79cd\u62c6\u5206\u786e\u4fdd\u4e86\u5728\u672a\u89c1\u8fc7\u7684\u6570\u636e\u4e0a\u5bf9\u6a21\u578b\u8fdb\u884c\u8bc4\u4f30\uff0c\u4ee5\u8fdb\u884c\u51c6\u786e\u7684\u6027\u80fd\u8bc4\u4f30\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Split data into training and testing sets\nsplit_date = '2021-01-01'\ntrain = df&#91;:split_date]\ntest = df&#91;split_date:]\n\nprint(f\"Training data from {train.index&#91;0].date()} to {train.index&#91;-1].date()}\")\nprint(f\"Testing data from {test.index&#91;0].date()} to {test.index&#91;-1].date()}\")<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.3 \u8bad\u7ec3\u6570\u636e\u7684\u534f\u6574\u68c0\u9a8c<\/strong><\/h3>\n\n\n\n<p>\u534f\u6574\u662f\u914d\u5bf9\u4ea4\u6613\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u5047\u8bbe\uff0c\u56e0\u4e3a\u5b83\u8868\u660e\u4e24\u79cd\u8d44\u4ea7\u4e4b\u95f4\u5b58\u5728\u7a33\u5b9a\u7684\u957f\u671f\u5173\u7cfb\u3002\u8fd9\u91cc\u91c7\u7528\u6069\u683c\u5c14-\u683c\u5170\u6770\u534f\u6574\u68c0\u9a8c\u6765\u8bc4\u4f30 AAPL \u548c MSFT \u662f\u5426\u5177\u6709\u7a33\u5b9a\u7684\u957f\u671f\u5173\u7cfb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>from statsmodels.tsa.stattools import coint\n\n# Perform cointegration test on training data\nscore, pvalue, _ = coint(train&#91;ticker1], train&#91;ticker2])\nprint(f'Cointegration test p-value: {pvalue:.4f}')<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.4 \u4f30\u7b97\u5bf9\u51b2\u6bd4\u7387<\/strong><\/h3>\n\n\n\n<p>\u5bf9\u51b2\u6bd4\u7387\u91cf\u5316\u4e86\u4e24\u53ea\u80a1\u7968\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u7528\u4e8e\u8ba1\u7b97\u5b83\u4eec\u4e4b\u95f4\u7684\u4ef7\u5dee\u3002\u8be5\u6bd4\u7387\u901a\u8fc7\u7ebf\u6027\u56de\u5f52\u4f30\u7b97\uff0cMSFT \u4e3a\u81ea\u53d8\u91cf\uff0cAAPL \u4e3a\u56e0\u53d8\u91cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>from sklearn.linear_model import LinearRegression\n\n# Hedge ratio estimation\nX_train_lr = train&#91;ticker2].values.reshape(-1, 1)\ny_train_lr = train&#91;ticker1].values\nlr_model = LinearRegression()\nlr_model.fit(X_train_lr, y_train_lr)\nhedge_ratio = lr_model.coef_&#91;0]\nprint(f'Hedge Ratio: {hedge_ratio:.4f}')<\/code><\/code><\/pre>\n\n\n\n<p>\u8be5\u6a21\u578b\u7684\u5bf9\u51b2\u6bd4\u7387\u4e3a 0.4658\uff0c\u8868\u660e MSFT \u5728 AAPL \u4e2d\u7684\u6301\u4ed3\u5e73\u8861\u6bd4\u4f8b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.5 \u8ba1\u7b97\u4ef7\u5dee<\/strong><\/h3>\n\n\n\n<p>\u6709\u4e86\u5bf9\u51b2\u6bd4\u7387\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8ba1\u7b97\u4ef7\u5dee\uff0c\u5373\u6309\u5bf9\u51b2\u6bd4\u7387\u8c03\u6574\u540e\u7684\u4ef7\u683c\u5dee\u5f02\u3002\u8be5\u4ef7\u5dee\u53ef\u4f5c\u4e3a LSTM \u6a21\u578b\u7684\u8f93\u5165\u6570\u636e\uff0c\u6355\u6349 AAPL \u548c MSFT \u4e4b\u95f4\u7684\u504f\u5dee\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Calculate the spread\ndf&#91;'Spread'] = df&#91;ticker1] - hedge_ratio * df&#91;ticker2]<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.6 \u6570\u636e\u9884\u5904\u7406\uff08\u7f29\u653e\uff09<\/strong><\/h3>\n\n\n\n<p>\u5728\u5c06\u4f20\u64ad\u6570\u636e\u8f93\u5165 LSTM \u4e4b\u524d\uff0c\u6211\u4eec\u4f7f\u7528 MinMaxScaler \u5c06\u5176\u5f52\u4e00\u5316\u4e3a 0-1 \u7684\u8303\u56f4\u3002\u7f29\u653e\u53ef\u786e\u4fdd LSTM \u4ece\u6570\u636e\u4e2d\u9ad8\u6548\u5b66\u4e60\uff0c\u800c\u4e0d\u53d7\u8f83\u5927\u6570\u503c\u7684\u5f71\u54cd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>from sklearn.preprocessing import MinMaxScaler<br><br># Data preprocessing<br>scaler = MinMaxScaler(feature_range=(0, 1))<br>spread_values = df['Spread'].values.reshape(-1, 1)<br>scaled_spread = scaler.fit_transform(spread_values)<br>train_size = len(train)<br>train_spread = scaled_spread[:train_size]<br>test_spread = scaled_spread[train_size:]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.7 \u4e3a LSTM \u6a21\u578b\u521b\u5efa\u5e8f\u5217<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u4e86\u8ba9 LSTM \u5b66\u4e60\u65f6\u95f4\u6a21\u5f0f\uff0c\u6211\u4eec\u5c06\u4f20\u64ad\u6570\u636e\u7ec4\u7ec7\u6210\u5e8f\u5217\u3002\u6bcf\u4e2a\u5e8f\u5217\u4ee3\u8868\u4e00\u4e2a\u4f20\u64ad\u503c\u7684\u6ed1\u52a8\u7a97\u53e3\uff0c\u4f7f\u6a21\u578b\u80fd\u591f\u4ece\u6700\u8fd1\u7684\u5386\u53f2\u4e2d\u5b66\u4e60\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4f7f\u7528 30 \u5929\u7684\u5e8f\u5217\u4f5c\u4e3a LSTM \u7684\u8f93\u5165\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Function to create sequences\ndef create_sequences(data, time_steps=30):\n    X = &#91;]\n    y = &#91;]\n    for i in range(len(data) - time_steps):\n        X.append(data&#91;i:(i + time_steps), 0])\n        y.append(data&#91;i + time_steps, 0])\n    return np.array(X), np.array(y)\n\n# Generate training sequences\ntime_steps = 30\nX_train_seq, y_train_seq = create_sequences(train_spread, time_steps)\nX_train_seq = X_train_seq.reshape((X_train_seq.shape&#91;0], X_train_seq.shape&#91;1], 1))<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.8 \u6784\u5efa\u548c\u8bad\u7ec3 LSTM \u6a21\u578b<\/strong><\/h3>\n\n\n\n<p>LSTM \u6a21\u578b\u662f 121 \u6a21\u578b\u7684\u6838\u5fc3\uff0c\u5b83\u5904\u7406\u4ef7\u5dee\u5e8f\u5217\u4ee5\u9884\u6d4b\u672a\u6765\u8d70\u52bf\u3002\u6211\u4eec\u5c06\u8be5\u6a21\u578b\u914d\u7f6e\u4e3a\u4ece\u5386\u53f2\u4ef7\u5dee\u6570\u636e\u4e2d\u5b66\u4e60\uff0c\u4f7f\u7528\u4e00\u4e2a LSTM \u5c42\u548c\u4e00\u4e2a\u5bc6\u96c6\u8f93\u51fa\u5c42\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># LSTM model architecture\nmodel = Sequential()\nmodel.add(LSTM(50, input_shape=(X_train_seq.shape&#91;1], 1)))  # Crucial hyperparameters not shared\nmodel.add(Dense(1))\nmodel.compile(loss='mean_squared_error', optimizer='adam')\n\n# Model training (placeholder values)\nhistory = model.fit(X_train_seq, y_train_seq, epochs=25, batch_size=32, verbose=1)<\/code><\/code><\/pre>\n\n\n\n<p>\u6ce8\uff1a\u6b64\u5904\u53ea\u5171\u4eab\u6a21\u578b\u67b6\u6784\uff0c\u4e0d\u516c\u5f00\u5173\u952e\u8d85\u53c2\u6570\u6216\u654f\u611f\u7ec6\u8282\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.9 \u6839\u636e\u6d4b\u8bd5\u6570\u636e\u8fdb\u884c\u9884\u6d4b<\/strong><\/h3>\n\n\n\n<p>\u6709\u4e86\u8bad\u7ec3\u540e\u7684\u6a21\u578b\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9\u6d4b\u8bd5\u6570\u636e\u96c6\u8fdb\u884c\u9884\u6d4b\u3002\u6211\u4eec\u51c6\u5907\u6d4b\u8bd5\u5e8f\u5217\uff0c\u5e76\u5c06\u9884\u6d4b\u503c\u548c\u5b9e\u9645\u503c\u8f6c\u6362\u56de\u539f\u59cb\u6bd4\u4f8b\u8fdb\u884c\u8bc4\u4f30\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Prepare test data and make predictions\ncombined_spread = np.vstack((train_spread&#91;-time_steps:], test_spread))\nX_test_seq, y_test_seq = create_sequences(combined_spread, time_steps)\nX_test_seq = X_test_seq.reshape((X_test_seq.shape&#91;0], X_test_seq.shape&#91;1], 1))\n\n# Predict and invert scaling\npredictions = model.predict(X_test_seq)\npredictions_inv = scaler.inverse_transform(predictions)\ny_test_seq_inv = scaler.inverse_transform(y_test_seq.reshape(-1, 1))<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.10 \u7ed8\u5236\u5e26\u6709\u4e70\u5356\u4fe1\u53f7\u7684\u8721\u70db\u56fe<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u4e86\u76f4\u89c2\u5730\u663e\u793a AAPL \u4ef7\u683c\u56fe\u8868\u4e0a\u7684\u4fe1\u53f7\uff0c\u6211\u4eec\u7ed8\u5236\u4e86\u4e00\u5f20\u5e26\u6709\u4e70\u70b9\u548c\u5356\u70b9\u6807\u8bb0\u7684\u8721\u70db\u56fe\u3002\u8be5\u56fe\u5c55\u793a\u4e86\u6a21\u578b\u5efa\u8bae\u7684\u4ea4\u6613\u884c\u52a8\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Plot buy and sell signals on AAPL price chart\nbuy_signals = data1_test_signals&#91;data1_test_signals&#91;'Signal'] == 1]\nsell_signals = data1_test_signals&#91;data1_test_signals&#91;'Signal'] == -1]\n\n# Set buy\/sell prices slightly above\/below actual prices for visibility\nsignal_markers.loc&#91;buy_signals.index, 'Buy'] = data1_test_signals.loc&#91;buy_signals.index, 'Low'] * 0.99\nsignal_markers.loc&#91;sell_signals.index, 'Sell'] = data1_test_signals.loc&#91;sell_signals.index, 'High'] * 1.01\n\nmpf.plot(data1_test_signals, type='candle', addplot=apds, title='AAPL Price with Buy and Sell Signals')<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-11.png\" alt=\"\" class=\"wp-image-2783\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><br><strong>\u4e09\u3001\u7b56\u7565\u6536\u76ca\u8bc4\u4f30<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>3.1 \u8ba1\u7b97\u7b56\u7565\u56de\u62a5<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u8bc4\u4f30\u76c8\u5229\u80fd\u529b\uff0c\u6211\u4eec\u6839\u636e\u6a21\u578b\u4fe1\u53f7\u548c\u8d44\u4ea7\u56de\u62a5\u8ba1\u7b97\u6bcf\u65e5\u7b56\u7565\u56de\u62a5\u3002\u7136\u540e\u5bf9\u8fd9\u4e9b\u56de\u62a5\u8fdb\u884c\u590d\u5229\u8ba1\u7b97\uff0c\u5f97\u51fa\u7d2f\u8ba1\u7b56\u7565\u56de\u62a5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Calculate daily returns and cumulative strategy returns\nreturns = df&#91;&#91;ticker1, ticker2]].pct_change().loc&#91;test_df.index]\ntest_df&#91;'Strategy_Return'] = test_df&#91;'Signal'] * (returns&#91;ticker1] - hedge_ratio * returns&#91;ticker2])\ntest_df&#91;'Cumulative_Strategy_Return'] = (1 + test_df&#91;'Strategy_Return'].fillna(0)).cumprod() - 1<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-12.png\" alt=\"\" class=\"wp-image-2784\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>3.2 \u6027\u80fd\u6307\u6807\u8bbe\u7f6e<\/strong><\/h3>\n\n\n\n<p>\u6211\u4eec\u4f7f\u7528\u5e74\u5316\u6536\u76ca\u7387\u3001\u6ce2\u52a8\u7387\u3001\u590f\u666e\u6bd4\u7387\u548c\u6700\u5927\u7f29\u6c34\u7387\u7b49\u5173\u952e\u6307\u6807\u6765\u8bc4\u4f30\u6a21\u578b\u7684\u98ce\u9669\u8c03\u6574\u540e\u6536\u76ca\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Calculate performance metrics\nannualized_return = daily_return_mean * 252\nannualized_volatility = daily_return_std * np.sqrt(252)\nsharpe_ratio = (annualized_return - risk_free_rate) \/ annualized_volatility\nmax_drawdown = test_df&#91;'Drawdown'].max()<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-13.png\" alt=\"\" class=\"wp-image-2785\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>3.3 \u4fee\u6574\u4ea4\u6613\u6210\u672c<\/strong><\/h3>\n\n\n\n<p>\u4e3a\u4e86\u8003\u8651\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u4ea4\u6613\u8d39\u7528\uff0c\u6211\u4eec\u5c06\u6bcf\u7b14\u4ea4\u6613\u7684\u4ea4\u6613\u6210\u672c\u7eb3\u5165\u6a21\u578b\u7684\u6536\u76ca\u4e2d\u3002\u8c03\u6574\u540e\u7684\u51c0\u6536\u76ca\u7387\u66f4\u7b26\u5408\u5b9e\u9645\u60c5\u51b5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Adjust for transaction costs\ntransaction_cost = 0.0005  # Placeholder for actual costs\ntest_df&#91;'Trades'] = test_df&#91;'Signal'].diff().abs()\ntest_df&#91;'Transaction_Costs'] = test_df&#91;'Trades'] * transaction_cost\ntest_df&#91;'Strategy_Return_Net'] = test_df&#91;'Strategy_Return'] - test_df&#91;'Transaction_Costs']\ntest_df&#91;'Cumulative_Strategy_Return_Net'] = (1 + test_df&#91;'Strategy_Return_Net'].fillna(0)).cumprod() - 1<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1022\" height=\"1012\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-14.png\" alt=\"\" class=\"wp-image-2786\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Calculate performance metrics after transaction costs\n# Annualized Return after transaction costs\ndaily_return_mean_net = test_df&#91;'Strategy_Return_Net'].mean()\nannualized_return_net = daily_return_mean_net * 252\nprint(f'Annualized Return (Net): {annualized_return_net:.2%}')\n\n# Annualized Volatility after transaction costs\ndaily_return_std_net = test_df&#91;'Strategy_Return_Net'].std()\nannualized_volatility_net = daily_return_std_net * np.sqrt(252)\nprint(f'Annualized Volatility (Net): {annualized_volatility_net:.2%}')\n\n# Sharpe Ratio after transaction costs\nsharpe_ratio_net = (annualized_return_net - risk_free_rate) \/ annualized_volatility_net\nprint(f'Sharpe Ratio (Net): {sharpe_ratio_net:.2f}')\n\n# Maximum Drawdown after transaction costs\ntest_df&#91;'Cumulative_Max_Net'] = test_df&#91;'Cumulative_Strategy_Return_Net'].cummax()\ntest_df&#91;'Drawdown_Net'] = test_df&#91;'Cumulative_Max_Net'] - test_df&#91;'Cumulative_Strategy_Return_Net']\nmax_drawdown_net = test_df&#91;'Drawdown_Net'].max()\nprint(f'Maximum Drawdown (Net): {max_drawdown_net:.2%}')<\/code><\/code><\/pre>\n\n\n\n<p><strong>\u7ed3\u679c\u5982\u4e0b\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-15.png\" alt=\"\" class=\"wp-image-2787\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.4 \u7ee9\u6548\u7ed3\u679c\u548c\u8ba8\u8bba<\/strong><\/h3>\n\n\n\n<p><strong>1.\u539f\u59cb\u6218\u7565\u56de\u62a5\u4e0e\u51c0\u6218\u7565\u56de\u62a5<\/strong><\/p>\n\n\n\n<p>\u7d2f\u8ba1\u7b56\u7565\u56de\u62a5\u56fe\u663e\u793a\u4e86\u5728\u65e0\u4ea4\u6613\u6210\u672c\u7684\u60c5\u51b5\u4e0b\u5b9e\u65bd\u7b56\u7565\u7684\u56de\u62a5\u589e\u957f\u60c5\u51b5\u3002\u7136\u800c\uff0c\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u4ea4\u6613\u4f1a\u4ea7\u751f\u6210\u672c\uff0c\u5bf9\u76c8\u5229\u80fd\u529b\u4ea7\u751f\u91cd\u5927\u5f71\u54cd\u3002\u51c0\u7b56\u7565\u56de\u62a5\u56fe\u5305\u542b\u4e86\u8fd9\u4e9b\u4ea4\u6613\u6210\u672c\uff0c\u771f\u5b9e\u5730\u53cd\u6620\u4e86\u6a21\u578b\u7684\u8868\u73b0\u3002<\/p>\n\n\n\n<p>\u89c2\u5bdf\u7ed3\u679c\uff1a\u5373\u4f7f\u8003\u8651\u4e86\u4ea4\u6613\u6210\u672c\uff0c\u8be5\u6a21\u578b\u4ecd\u80fd\u4fdd\u6301\u8f83\u9ad8\u7684\u7d2f\u8ba1\u6536\u76ca\uff0c\u8fd9\u589e\u5f3a\u4e86\u5176\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u7a33\u5065\u6027\u3002<\/p>\n\n\n\n<p><strong>2.\u6027\u80fd\u6307\u6807\u8bf4\u660e<\/strong><\/p>\n\n\n\n<p>\u4e0b\u8868\u603b\u7ed3\u4e86\u8be5\u6a21\u578b\u5728\u4ea4\u6613\u6210\u672c\u4e4b\u524d\u548c\u4e4b\u540e\u7684\u98ce\u9669\u8c03\u6574\u540e\u56de\u62a5\u6307\u6807\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-16.png\" alt=\"\" class=\"wp-image-2788\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5e74\u5316\u6536\u76ca\u7387\uff1a<\/strong>\u8fd9\u8868\u793a\u8be5\u7b56\u7565\u7684\u5e74\u589e\u957f\u7387\u3002\u4ea4\u6613\u6210\u672c\u7565\u6709\u4e0b\u964d\u540e\uff0c\u4ecd\u80fd\u83b7\u5f97\u8d85\u8fc7 116% \u7684\u53ef\u89c2\u56de\u62a5\u3002<\/li>\n\n\n\n<li><strong>\u5e74\u5316\u6ce2\u52a8\u7387\uff1a<\/strong>\u6a21\u578b\u4fdd\u6301\u7a33\u5b9a\u7684\u6ce2\u52a8\u7387\uff0c\u8868\u660e\u5176\u5728\u6ce2\u52a8\u7684\u5e02\u573a\u6761\u4ef6\u4e0b\u4e5f\u80fd\u4fdd\u6301\u7a33\u5b9a\u3002<\/li>\n\n\n\n<li><strong>\u590f\u666e\u6bd4\u7387\uff1a<\/strong>\u8be5\u6bd4\u7387\u7528\u4e8e\u8861\u91cf\u98ce\u9669\u8c03\u6574\u540e\u7684\u56de\u62a5\u7387\uff0c\u6263\u9664\u6210\u672c\u540e\u4ecd\u4e3a 5.96\uff0c\u8868\u660e\u8be5\u6a21\u578b\u76f8\u5bf9\u4e8e\u5176\u98ce\u9669\u5b9e\u73b0\u4e86\u6781\u4f73\u7684\u56de\u62a5\u3002<\/li>\n\n\n\n<li><strong>\u6700\u5927\u56de\u8c03\uff1a<\/strong>\u56de\u8c03\u6307\u6807\u663e\u793a\uff0c\u6a21\u578b\u4f1a\u7ecf\u5386\u4e00\u6bb5\u65f6\u95f4\u7684\u4e0b\u964d\u3002\u6839\u636e\u4ea4\u6613\u6210\u672c\u8fdb\u884c\u8c03\u6574\u540e\uff0c\u7f29\u7f16\u60c5\u51b5\u6709\u6240\u6539\u5584\uff0c\u53cd\u6620\u51fa\u5728\u5b9e\u9645\u60c5\u51b5\u4e0b\u91c7\u7528\u4e86\u66f4\u73b0\u5b9e\u3001\u66f4\u53ef\u6301\u7eed\u7684\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4ee5\u4e0a\u8fd9\u4e9b\u6307\u6807\u5171\u540c\u8bc1\u660e\u4e86 121 \u6a21\u578b\u5728\u5e73\u8861\u6536\u76ca\u6f5c\u529b\u548c\u98ce\u9669\u7ba1\u7406\u65b9\u9762\u7684\u6709\u6548\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001\u89c2\u70b9\u56de\u987e<\/strong><\/h2>\n\n\n\n<p>121 \u6a21\u578b\u5c55\u793a\u4e86\u4f20\u7edf\u8ba1\u91cf\u7ecf\u6d4e\u5b66\u539f\u7406\uff08\u5982\u534f\u6574\u5173\u7cfb\uff09\u5982\u4f55\u4e0e LSTM \u7b49\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u76f8\u7ed3\u5408\uff0c\u4ece\u800c\u4ea7\u751f\u6709\u5229\u53ef\u56fe\u7684\u4ea4\u6613\u7b56\u7565\u3002\u5373\u4f7f\u5728\u6263\u9664\u4ea4\u6613\u6210\u672c\u540e\uff0c\u5176\u7ed3\u679c\u4e5f\u8bf4\u660e\u4e86\u83b7\u5f97\u4e30\u539a\u56de\u62a5\u548c\u53ef\u63a7\u98ce\u9669\u7684\u6f5c\u529b\uff0c\u51f8\u663e\u4e86\u673a\u5668\u5b66\u4e60\u5982\u4f55\u6539\u53d8\u91cf\u5316\u91d1\u878d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-17.png\" alt=\"\" class=\"wp-image-2790\"\/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f20\u7edf\u7684\u7edf\u8ba1\u6a21\u578b\u65e0\u6cd5\u6355\u6349\u91d1\u878d\u6570\u636e\u4e2d\u590d\u6742\u7684\u975e\u7ebf\u6027\u6a21\u5f0f\uff0c\u800cLSTM\u795e\u7ecf\u7f51\u7edc\u80fd\u591f\u5904\u7406\u8fde\u7eed\u6570\u636e\u5e76\u4ece\u8fc7\u53bb\u7684\u8d8b\u52bf\u4e2d\u5b66\u4e60\uff0c\u9884\u6d4b\u672a\u6765\u8d70\u52bf\u3002<\/li>\n\n\n\n<li>121\u6a21\u578b\u7ed3\u5408\u4e86\u534f\u6574\u7406\u8bba\u548cLSTM\u6280\u672f\uff0c\u901a\u8fc7\u76d1\u6d4bAAPL\u548cMSFT\u4e4b\u95f4\u7684\u4ef7\u683c\u5dee\u5f02\uff08\u4ef7\u5dee\uff09\uff0c\u5e76\u5229\u7528\u8fd9\u4e9b\u4fe1\u606f\u6765\u4ea7\u751f\u4e70\u5165\u6216\u5356\u51fa\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li>\u5373\u4f7f\u8003\u8651\u4e86\u4ea4\u6613\u6210\u672c\uff0c121\u6a21\u578b\u4e5f\u80fd\u663e\u793a\u51fa\u5f3a\u52b2\u7684\u56de\u62a5\u548c\u53ef\u7ba1\u7406\u7684\u98ce\u9669\uff0c\u5c24\u5176\u662f\u5728\u5b9e\u9645\u4ea4\u6613\u573a\u666f\u4e2d\uff0c\u8fd9\u8868\u660e\u4e86\u673a\u5668\u5b66\u4e60\u5728\u91cf\u5316\u91d1\u878d\u9886\u57df\u7684\u6f5c\u529b\u3002<\/li>\n\n\n\n<li>\u6027\u80fd\u8bc4\u4f30\u6307\u6807\uff08\u5982\u5e74\u5316\u6536\u76ca\u7387\u3001\u6ce2\u52a8\u7387\u3001\u590f\u666e\u6bd4\u7387\u548c\u6700\u5927\u7f29\u6c34\u7387\uff09\u662f\u8861\u91cf\u4ea4\u6613\u7b56\u7565\u7ee9\u6548\u7684\u5173\u952e\u6307\u6807\u3002<\/li>\n\n\n\n<li>\u6211\u8ba4\u4e3a\uff0c\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u80fd\u591f\u6539\u5584\u4f20\u7edf\u7684\u91d1\u878d\u539f\u7406\uff0c\u5e76\u4e14\u53ef\u4ee5\u901a\u8fc7\u5b9e\u9645\u7684\u4ea4\u6613\u6765\u4ea7\u751f\u9ad8\u56de\u62a5\u7684\u7b56\u7565\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u5bf9\u4e8e\u90a3\u4e9b\u5e0c\u671b\u63a2\u7d22\u7b97\u6cd5\u4ea4\u6613\u6216\u4e86\u89e3\u673a\u5668\u5b66\u4e60\u5982\u4f55\u5e94\u7528\u4e8e\u91d1\u878d\u9886\u57df\u7684\u4eba\u6765\u8bf4\uff0c121 \u6a21\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4ee4\u4eba\u4fe1\u670d\u7684\u6848\u4f8b\u7814\u7a76\u3002\u968f\u7740\u6211\u5bf9\u6a21\u578b\u7684\u4e0d\u65ad\u5b8c\u5584\uff0c\u6211\u671f\u5f85\u7740\u4e0e\u5927\u5bb6\u5206\u4eab\u672a\u6765\u7684\u89c1\u89e3\u548c\u66f4\u65b0\u3002<\/p>\n\n\n\n<p><strong>\u611f\u8c22\u60a8\u9605\u8bfb\u5230\u6700\u540e\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u7ed9\u60a8\u5e26\u6765\u65b0\u7684\u6536\u83b7\u3002\u795d\u60a8\u6295\u8d44\u987a\u5229\uff01\u5982\u679c\u5bf9\u6587\u4e2d\u7684\u5185\u5bb9\u6709\u4efb\u4f55\u7591\u95ee\uff0c\u8bf7\u7ed9\u6211\u7559\u8a00\uff0c\u5fc5\u590d\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u672c\u6587\u5185\u5bb9\u4ec5\u4ec5\u662f\u6280\u672f\u63a2\u8ba8\u548c\u5b66\u4e60\uff0c\u5e76\u4e0d\u6784\u6210\u4efb\u4f55\u6295\u8d44\u5efa\u8bae\u3002<\/mark><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u8001\u4f59\u635e\u9c7c \u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.laoyulaoyu.com\/index.php\/2024\/11\/28\/%e8%bf%90%e7%94%a8-121-%e7%ad%96%e7%95%a5%e6%a8%a1%e5%9e%8b%ef%bc%8c%e6%96%a9%e8%8e%b7-121-%e7%9a%84%e6%8a%95%e8%b5%84%e6%94%b6%e7%9b%8a\/\">Continue reading<span class=\"screen-reader-text\">\u8fd0\u7528 121 \u7b56\u7565\u6a21\u578b\uff0c\u65a9\u83b7 121% \u7684\u6295\u8d44\u6536\u76ca<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[4,5],"class_list":{"0":"post-1670","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-aiinvest","7":"tag-ai","9":"entry"},"_links":{"self":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1670"}],"version-history":[{"count":1,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1670\/revisions"}],"predecessor-version":[{"id":1671,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1670\/revisions\/1671"}],"wp:attachment":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=1670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=1670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}