{"id":3208,"date":"2025-12-18T07:31:00","date_gmt":"2025-12-17T23:31:00","guid":{"rendered":"https:\/\/www.laoyulaoyu.com\/?p=3208"},"modified":"2025-12-09T20:50:06","modified_gmt":"2025-12-09T12:50:06","slug":"%e5%88%ab%e5%86%8d%e5%8f%aa%e7%9c%8b%e6%81%90%e6%85%8c%e6%8c%87%e6%95%b0%e4%ba%86%ef%bc%81%e9%87%8f%e5%8c%96%e4%bb%a3%e7%a0%81%e8%ae%a9%e4%bd%a0%e4%bb%8evix%e6%9b%b2%e7%ba%bf%e7%9a%84","status":"publish","type":"post","link":"https:\/\/laoyulaoyu.com\/index.php\/2025\/12\/18\/%e5%88%ab%e5%86%8d%e5%8f%aa%e7%9c%8b%e6%81%90%e6%85%8c%e6%8c%87%e6%95%b0%e4%ba%86%ef%bc%81%e9%87%8f%e5%8c%96%e4%bb%a3%e7%a0%81%e8%ae%a9%e4%bd%a0%e4%bb%8evix%e6%9b%b2%e7%ba%bf%e7%9a%84\/","title":{"rendered":"\u522b\u518d\u53ea\u770b\u6050\u614c\u6307\u6570\u4e86\uff01\u91cf\u5316\u4ee3\u7801\u8ba9\u4f60\u4eceVIX\u66f2\u7ebf\u7684\u201c\u5761\u5ea6\u201d\u548c\u201c\u5f27\u5ea6\u201d\u770b\u7a7f\u725b\u718a"},"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 fetchpriority=\"high\" decoding=\"async\" width=\"900\" height=\"383\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/cover.jpg\" alt=\"\" class=\"wp-image-3209\" srcset=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/cover.jpg 900w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/cover-300x128.jpg 300w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/cover-768x327.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/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>\u522b\u4eba\u6050\u614c\u6211\u8d2a\u5a6a\uff0c\u4f46\u524d\u63d0\u662f\u4f60\u5f97\u770b\u61c2\u6050\u614c\u7684\u201c\u5f62\u72b6\u201d\u3002\u522b\u518d\u50bb\u50bb\u53ea\u76ef\u4e00\u4e2aVIX\u6307\u6570\u4e86\uff0c\u90a3\u90fd\u662f\u5c0f\u513f\u79d1\u3002\u4eca\u5929\u6211\u628a\u91cf\u5316\u57fa\u91d1\u5e38\u7528\u7684VIX\u671f\u9650\u7ed3\u6784\u6a21\u578b\uff0c\u63b0\u788e\u4e86\u8bb2\u7ed9\u4f60\u542c\uff0c\u8fd8\u9644\u4e0a\u4e86\u5f00\u7bb1\u5373\u7528\u7684\u4ee3\u7801\u3002<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5c31\u662f\u60f3\u8ba9\u4f60\u6bd480%\u7684\u6563\u6237\uff0c\u66f4\u65e9\u4e00\u6b65\u55c5\u5230\u5371\u9669\u548c\u673a\u4f1a\u3002<\/mark><\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. \u4e3a\u4ec0\u4e48\u53ea\u770bVIX\u70b9\u4f4d\u8fdc\u8fdc\u4e0d\u591f<\/strong><\/h2>\n\n\n\n<p>VIX\u6307\u6570\uff08CBOE Volatility Index\uff09\u5e38\u88ab\u79f0\u4f5c\u201c\u6050\u60e7\u6307\u6570\u201d\uff0c\u5b83\u53cd\u6620\u6807\u666e500\u672a\u676530\u5929\u7684\u9690\u542b\u6ce2\u52a8\u7387\u3002\u4f46\u5355\u72ec\u4e00\u4e2a\u6570\u5b57\u53ea\u80fd\u544a\u8bc9\u4f60\u201c\u73b0\u5728\u6ce2\u52a8\u5927\u4e0d\u5927\u201d\uff0c\u5374\u65e0\u6cd5\u56de\u7b54\u4e24\u4e2a\u66f4\u5173\u952e\u7684\u95ee\u9898\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6ce2\u52a8\u4e3b\u8981\u96c6\u4e2d\u5728\u77ed\u671f\u8fd8\u662f\u4f1a\u6301\u7eed\u5230\u4e2d\u957f\u671f\uff1f<\/li>\n\n\n\n<li>\u5e02\u573a\u5f53\u524d\u662f\u201c\u6b63\u5e38\u5b9a\u4ef7\uff0c\u8fd8\u662f\u6781\u7aef\u5c3e\u90e8\u98ce\u9669\uff0c\u8fd8\u662f\u5df2\u7ecf\u5728\u6050\u614c\u4e2d\u8fc7\u5ea6\u53cd\u5e94\uff1f<\/li>\n<\/ul>\n\n\n\n<p>\u7b54\u6848\u85cf\u5728VIX\u671f\u8d27\u7684\u671f\u9650\u7ed3\u6784\uff08Term Structure\uff09\u91cc\u3002\u4e0d\u540c\u5230\u671f\u6708\u7684VIX\u671f\u8d27\u4ef7\u683c\u8fde\u6210\u4e00\u6761\u66f2\u7ebf\uff0c\u5f62\u72b6\u901a\u5e38\u5206\u4e3a\u4e09\u79cd\u5178\u578b\u72b6\u6001\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th class=\"has-text-align-center\" data-align=\"center\">\u72b6\u6001<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u82f1\u6587\u672f\u8bed<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u66f2\u7ebf\u7279\u5f81<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u5386\u53f2\u5360\u6bd4\uff082013-2024\uff09<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u5178\u578b\u573a\u666f<\/th><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u6b63\u5411\u5e02\u573a<\/td><td class=\"has-text-align-center\" data-align=\"center\">Contango<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8fd1\u6708\uff1c\u8fdc\u6708\uff0c\u5411\u4e0a\u503e\u659c<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea685%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5e38\u6001\uff0c\u7f8e\u80a1\u6162\u725b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5012\u6302\u5e02\u573a<\/td><td class=\"has-text-align-center\" data-align=\"center\">Backwardation<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8fd1\u6708\uff1e\u8fdc\u6708\uff0c\u5411\u4e0b\u503e\u659c<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea68%<\/td><td class=\"has-text-align-center\" data-align=\"center\">2020\u75ab\u60c5\u30012008\u5371\u673a\u30012024.8\u79d1\u6280\u6050\u614c<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5e73\u5766\/\u8fc7\u6e21<\/td><td class=\"has-text-align-center\" data-align=\"center\">Flat<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u51e0\u4e4e\u6c34\u5e73<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea67%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u653f\u7b56\u8f6c\u5411\u671f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u6b63\u5411\u5e02\u573a\uff1a<\/strong>\u6574\u6761\u66f2\u7ebf\u770b\u4e0a\u53bb\u662f\u6a59\u8272\u8fd8\u662f\u84dd\u8272\uff0c\u662f\u6574\u4f53\u4e0a\u79fb\u8fd8\u662f\u4e0b\u964d\uff0c\u8bf4\u660e\u5927\u5bb6\u5bf9\u672a\u6765\u7684\u6bcf\u4e00\u5929\u7684\u7126\u8651\u7a0b\u5ea6\uff0c\u8fd9\u662f\u6700\u76f4\u89c2\u7684\u6050\u614c\u7a0b\u5ea6\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/Level-1024x512.gif\" alt=\"\" class=\"wp-image-3211\" srcset=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/Level-1024x512.gif 1024w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/Level-300x150.gif 300w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/Level-768x384.gif 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u5012\u6302\u5e02\u573a\uff1a<\/strong>\u8fd9\u4e2a\u6307\u6807\u6700\u5fae\u5999\uff0c\u4e5f\u6700\u6709\u8da3\u3002\u5b83\u53cd\u6620\u4e86\u5e02\u573a\u5bf9\u201c\u7279\u5b9a\u65f6\u95f4\u70b9\u201d\u7684\u62c5\u5fe7\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_gif\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHwAWGXBWAl0vCn2kiaoTfSc41eh4f6ydEzLnMvW4TJks3DDibQp2slpmg\/640?wx_fmt=gif&amp;from=appmsg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>\u5e73\u5766\/\u8fc7\u6e21\uff1a<\/strong>\u66f2\u7ebf\u662f\u5411\u4e0a\u8fd8\u662f\u5411\u4e0b\uff0c\u76f4\u63a5\u51b3\u5b9a\u4e86\u5e02\u573a\u662f\u5426\u8f6c\u5411\uff0c\u4e5f\u51b3\u5b9a\u4e86\u4f60\u7684\u201c\u5c55\u671f\u6210\u672c\u201d\u662f\u6b63\u662f\u8d1f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_gif\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtH9GeicictibbGtUmMON64KNwARV9MWtY9hrG7Bg42E8p7RkxAsjOVrbs9w\/640?wx_fmt=gif&amp;from=appmsg\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u7b80\u5355\u8bf4\uff0cVIX\u544a\u8bc9\u4f60\u7684\u662f\u672a\u676530\u5929\u5e02\u573a\u5927\u6982\u4f1a\u6709\u591a\u201c\u98a0\u7c38\u201d\u3002\u800cVIX\u671f\u9650\u7ed3\u6784\uff0c\u662f\u628a\u672a\u6765\u4e0d\u540c\u65f6\u95f4\u70b9\uff08\u6bd4\u59821\u4e2a\u6708\u540e\u30012\u4e2a\u6708\u540e\u3001\u534a\u5e74\u540e\uff09\u7684\u201c\u98a0\u7c38\u9884\u671f\u201d\u4e32\u8d77\u6765\uff0c\u5f62\u6210\u7684\u4e00\u6761\u66f2\u7ebf\u3002\u8fd9\u6761\u7ebf\u957f\u4ec0\u4e48\u6837\uff0c\u76f4\u63a5\u66b4\u9732\u4e86\u5e02\u573a\u6700\u771f\u5b9e\u7684\u201c\u5185\u5fc3\u620f\u201d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. \u6570\u636e\u83b7\u53d6\uff1aCBOE\u5b98\u65b9\u514d\u8d39CSV\u5168\u81ea\u52a8\u5316<\/strong><\/h2>\n\n\n\n<p>CBOE\u6bcf\u5929\u5728\u5b98\u7f51\u516c\u5f00\u6240\u6709VIX\u671f\u8d27\u7ed3\u7b97\u6570\u636e\uff0c\u5730\u5740\u56fa\u5b9a\uff0c\u683c\u5f0f\u7a33\u5b9a\u3002\u6211\u4eec\u4f7f\u7528\u793e\u533a\u7ef4\u62a4\u7684&nbsp;<code>vix-utils<\/code>&nbsp;\u5e93\u5f02\u6b65\u4e0b\u8f7d\uff0c\u901f\u5ea6\u6781\u5feb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install vix-utils nest-asyncio pandas\n\nimport nest_asyncio, asyncio\nfrom vix_utils import async_load_vix_term_structure\nimport pandas as pd\n\nnest_asyncio.apply()\n\nasync def fetch_vix():\n    df = await async_load_vix_term_structure()\n    # \u8fc7\u6ee4\u5468\u5408\u7ea6\u4e0e\u5df2\u5230\u671f\u5408\u7ea6\n    df = df&#91;(df&#91;'Weekly'] == False) &amp; (df&#91;'Expired'] == False)].copy()\n    df&#91;'Trade Date'] = pd.to_datetime(df&#91;'Trade Date'])\n    return df\n\ndf = asyncio.get_event_loop().run_until_complete(fetch_vix())\ndf.head()<\/code><\/pre>\n\n\n\n<p>\u8fd4\u56de\u5b57\u6bb5\u5173\u952e\u5217\uff1aTrade Date\u3001Futures Contract\uff08\u6708\u4efd\uff09\u3001Tenor_Days\uff08\u5269\u4f59\u5929\u6570\uff09\u3001Settle\uff08\u7ed3\u7b97\u4ef7\uff09\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. \u57fa\u7840\u53ef\u89c6\u5316\uff1a\u4ea4\u4e92\u5f0f\u671f\u9650\u7ed3\u6784\u6ed1\u5757\u56fe<\/strong><\/h2>\n\n\n\n<p>\u7528Plotly\u505a\u51fa\u5e26\u65e5\u671f\u6ed1\u5757\u7684\u4ea4\u4e92\u56fe\uff0c\u4e00\u76ee\u4e86\u7136\u770b\u51fa\u66f2\u7ebf\u5f62\u6001\u53d8\u5316\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import plotly.express as px\n\n# \u6bcf\u6708\u5408\u7ea6\uff08\u53bb\u5468\u5408\u7ea6\uff09\nmonthly = df&#91;df&#91;'Weekly'] == False].copy()\n\nfig = px.line(monthly, x='Tenor_Days', y='Settle', color='Trade Date',\n              title='VIX\u671f\u9650\u7ed3\u6784\u65f6\u95f4\u6ed1\u5757\uff08\u62d6\u52a8\u67e5\u770b\u5386\u53f2\uff09',\n              labels={'Tenor_Days':'\u5230\u671f\u5929\u6570', 'Settle':'\u671f\u8d27\u4ef7\u683c'})\nfig.update_layout(height=600, template='plotly_dark)\nfig.show()<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_gif\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHmlnOrM7WWTLBBalUITqfmf17b7HLBKBLfpKKZ6bibLD4rjQnYv6N9Og\/640?wx_fmt=gif&amp;from=appmsg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u56fe1\uff1a\u4ea4\u4e92\u6ed1\u5757\u56fe\uff0c2024\u5e748\u6708\u660e\u663e\u5012\u6302\uff0c2025\u5e7412\u6708\u6062\u590d\u5178\u578b\u6b63\u5411<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>4. \u91cf\u5316\u6307\u6807\u4e00\uff1a\u6bcf\u65e5\u66f2\u7ebf\u659c\u7387\uff08Slope\uff09<\/strong><\/h2>\n\n\n\n<p>\u6700\u7b80\u5355\u6709\u6548\u7684\u5355\u65e5\u6307\u6807\uff1a\u5bf9\u5f53\u5929\u7684Tenor_Days\u548cSettle\u505a\u4e00\u5143\u7ebf\u6027\u56de\u5f52\uff0c\u5f97\u5230\u659c\u7387\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import numpy as np\n\nslopes = &#91;]\nfor date, group in df.groupby('Trade Date'):\n    group = group.sort_values('Tenor_Days')\n    if len(group) >= 3:\n        slope = np.polyfit(group&#91;'Tenor_Days'], group&#91;'Settle'], 1)&#91;0]\n        slopes.append({'date': date, 'slope': slope})\n\nslope_df = pd.DataFrame(slopes).set_index('date')<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. \u6838\u5fc3\u6a21\u578b\uff1aHMM\u8bc6\u522b\u4e09\u79cd\u9690\u542b\u72b6\u6001<\/strong><\/h2>\n\n\n\n<p>\u659c\u7387\u5e8f\u5217\u662f\u975e\u5e73\u7a33\u7684\uff0c\u76f4\u63a5\u9608\u503c\u5224\u65ad\u5bb9\u6613\u8bef\u5224\u3002\u6211\u4eec\u4f7f\u7528\u9ad8\u65afHMM\u81ea\u52a8\u5b66\u4e60\u4e09\u79cd\u9690\u85cf\u72b6\u6001\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from hmmlearn.hmm import GaussianHMM\nfrom sklearn.preprocessing import StandardScaler\n\nX = StandardScaler().fit_transform(slope_df&#91;&#91;'slope']])\n\nmodel = GaussianHMM(n_components=3, covariance_type=\"full\", n_iter=1000, random_state=42)\nmodel.fit(X)\nhidden_states = model.predict(X)\n\n# \u6839\u636e\u5747\u503c\u6392\u5e8f\u547d\u540d\u72b6\u6001\nmeans = model.means_.flatten()\nstate_names = &#91;'\u5012\u6302\uff08Backwardation\uff09', '\u8fc7\u6e21\uff08Flat\uff09', '\u6b63\u5411\uff08Contango\uff09']\norder = np.argsort(means)\nname_map = dict(zip(order, state_names))\n\nslope_df&#91;'regime'] = &#91;name_map&#91;s] for s in hidden_states]<\/code><\/pre>\n\n\n\n<p>\u5f97\u5230\u7684\u8f6c\u79fb\u77e9\u9635\uff082025\u5e741\u6708\u6700\u65b0\u62df\u5408\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th class=\"has-text-align-center\" data-align=\"center\">\u4ece\u2192\u5230<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u6b63\u5411<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u8fc7\u6e21<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u5012\u6302<\/th><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u6b63\u5411<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.942<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.057<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.001<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u8fc7\u6e21<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.623<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.351<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.026<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5012\u6302<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.012<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.089<\/td><td class=\"has-text-align-center\" data-align=\"center\">0.899<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5012\u6302\u72b6\u6001\u81ea\u4fdd\u6301\u6982\u7387\u9ad8\u8fbe90%\uff0c\u4e00\u65e6\u8fdb\u5165\u77ed\u671f\u5f88\u96be\u5feb\u901f\u9000\u51fa\uff0c\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e482020\u5e74\u75ab\u60c5\u5012\u6302\u6301\u7eed\u6570\u6708\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_png\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHqYF2npxXkqEF2K7bBiakCMIXpIup7vQnJ5miaJzmUiagN0XWExdFxRzsQ\/640?wx_fmt=png&amp;from=appmsg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u56fe2\uff1aHMM\u81ea\u52a8\u6807\u6ce8\u7684\u6b63\u5411\/\u8fc7\u6e21\/\u5012\u6302\u72b6\u6001<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>6. \u91cf\u5316\u6307\u6807\u4e8c\uff1aCarry\u4ef7\u5dee\uff08VX2-VX1\u3001VX6-VX1\uff09<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6784\u5efa\u6708\u5408\u7ea6pivot\u8868\npivot = df.pivot(index='Trade Date', columns='Tenor_Monthly', values='Settle')\n\ncarry = pd.DataFrame({\n    'Near_Mid': pivot&#91;2] - pivot&#91;1],\n    'Near_Long': pivot&#91;6] - pivot&#91;1]\n})\ncarry = carry.dropna()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/1_f_Tqpn6wr46aSQ4oc6idPQ-1024x512.gif\" alt=\"\" class=\"wp-image-3210\" srcset=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/1_f_Tqpn6wr46aSQ4oc6idPQ-1024x512.gif 1024w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/1_f_Tqpn6wr46aSQ4oc6idPQ-300x150.gif 300w, https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2025\/12\/1_f_Tqpn6wr46aSQ4oc6idPQ-768x384.gif 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u56fe3\uff1a\u7ed3\u8f6c\u98ce\u9669\u3002VX2-VX1 \u7684\u8870\u51cf\u901f\u5ea6\u5feb\u4e8e VX6-VX1\u3002\u5f53\u8fd1\u6708\u4ef7\u5dee\u9996\u5148\u6536\u7a84\u65f6\uff0c\u7ed3\u8f6c\u4e3a\u6b63\uff1b\u5f53 VX2-VX1 \u8f6c\u4e3a\u8d1f\u503c\u800c VX6-VX1 \u4fdd\u6301\u9ad8\u4f4d\u65f6\uff0c\u7ed3\u8f6c\u53d1\u751f\u9006\u8f6c<\/figcaption><\/figure>\n\n\n\n<p>\u5f53Near_Mid\uff1c0\u65f6\uff0c\u5356\u51fa\u8fd1\u6708\u3001\u4e70\u5165\u4e2d\u6708\u53ef\u9501\u5b9a\u6b63carry\uff1b\u53cd\u4e4b\u5219\u9700\u8b66\u60d5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>7. \u91cf\u5316\u6307\u6807\u4e09\uff1aPCA\u4e3b\u6210\u5206\u5206\u89e3<\/strong><\/h2>\n\n\n\n<p>\u5bf9\u524d8\u4e2a\u6708\u4efd\u5408\u7ea6\u505aPCA\uff0c\u901a\u5e38\u524d\u4e09\u4e2a\u4e3b\u6210\u5206\u89e3\u91ca\u7387\uff1e95%\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PC1 \u2192 Level\uff08\u6574\u4f53\u6ce2\u52a8\u6c34\u5e73\uff09<\/li>\n\n\n\n<li>PC2 \u2192 Slope\uff08\u503e\u659c<\/li>\n\n\n\n<li>PC3 \u2192 Curvature\uff08\u66f2\u7387\uff09<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>from sklearn.decomposition import PCA\nfrom sklearn.preprocessing import StandardScaler\n\nfront8 = pivot.iloc&#91;:, :8].dropna()\nX = StandardScaler().fit_transform(front8)\n\npca = PCA(n_components=3)\nscores = pca.fit_transform(X)\npca_df = pd.DataFrame(scores, index=front8.index, \n                      columns=&#91;'Level(PC1)', 'Slope(PC2)', 'Curvature(PC3)'])\nprint(pca.explained_variance_ratio_)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_png\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHWVfEoZxpDBMlkFE9c5l6ticelFuKicXSpGkMJLrdeGmmUaDgD3P3nLibQ\/640?wx_fmt=png&amp;from=appmsg\" alt=\"\"\/><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_png\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHcQEP9epYsAfxFHSGb3ib3PW7JbAuGSDVKbZ4NKl1WbtwsxwSfFrRF4A\/640?wx_fmt=png&amp;from=appmsg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u56fe4\uff1aPCA\u5206\u89e3\u540e\u4e09\u4e2a\u56e0\u5b50\uff0cLevel\u5728\u5371\u673a\u65f6\u6025\u5347<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>8. \u5b9e\u6218\u5e94\u7528\u573a\u666f\u4e0e<\/strong><strong>\u9879\u76ee\u7ed3\u6784\u5efa\u8bae<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><br><strong>\u5b9e\u6218\u573a\u666f\u63a8\u6f14\u8868<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th class=\"has-text-align-center\" data-align=\"center\">\u72b6\u6001<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u63a8\u8350\u64cd\u4f5c<\/th><th class=\"has-text-align-center\" data-align=\"center\">\u5e38\u7528\u5de5\u5177\/\u4ea7\u54c1<\/th><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u6df1\u5ea6\u6b63\u5411\uff08Contango\uff1e8%\uff09<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5356\u51fa\u6ce2\u52a8\u7387\uff08Short Vol\uff09<\/td><td class=\"has-text-align-center\" data-align=\"center\">SVIXM\u3001SVIX\u3001-1x VXX<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5012\u6302\u521d\u671f<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5feb\u901f\u4e70\u5165\u4fdd\u62a4<\/td><td class=\"has-text-align-center\" data-align=\"center\">VXX\u3001UVXY\u3001\u865a\u503cPut<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5012\u6302\u540e\u671f\uff08PC1\u5f00\u59cb\u56de\u843d\uff09<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u53cd\u624b\u505a\u591a\u6ce2\u52a8\u7387<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u9010\u6b65\u5efa\u4ed3SVIX<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u5b8c\u6574\u9879\u76ee\u7ed3\u6784\u5efa\u8bae<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>vix_monitor\/<\/code><code>\u251c\u2500\u2500&nbsp;data\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# \u81ea\u52a8\u7f13\u5b58CSV<\/code><code>\u251c\u2500\u2500 vix_fetch.py &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# \u6570\u636e\u4e0b\u8f7d<\/code><code>\u251c\u2500\u2500 vix_curve.py &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# \u53ef\u89c6\u5316\u51fd\u6570<\/code><code>\u251c\u2500\u2500 vix_hmm.py &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# HMM\u6a21\u578b\u8bad\u7ec3&amp;\u9884\u6d4b<\/code><code>\u251c\u2500\u2500 vix_pca.py &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# PCA\u56e0\u5b50<\/code><code>\u251c\u2500\u2500 vix_carry.py &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# Carry\u4ef7\u5dee<\/code><code>\u251c\u2500\u2500 dashboard.py &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# Streamlit\u6216Plotly Dash\u9762\u677f<\/code><code>\u2514\u2500\u2500 requirements.txt<\/code><\/code><\/pre>\n\n\n\n<p>\u81f3\u6b64\uff0c\u4f60\u5df2\u7ecf\u62e5\u6709\u4e86\u4e00\u5957\u5b8c\u6574\u7684VIX\u671f\u9650\u7ed3\u6784\u76d1\u63a7\u7cfb\u7edf\uff1a\u514d\u8d39\u6570\u636e\u6e90 + \u53ef\u590d\u73b0\u4ee3\u7801 + \u72b6\u6001\u8bc6\u522b + \u591a\u56e0\u5b50\u89c6\u89d2\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/mmbiz.qpic.cn\/mmbiz_png\/Vk07qSNq7L0oYlpumRnIrnD3krs15MtHswp4ufFHPLfb6vAdF0Hs4h7BMTzvzibuh9zanrYXJUsAkz2Vqg6D1xw\/640?wx_fmt=png&amp;from=appmsg\" alt=\"\"\/><\/figure>\n\n\n\n<p>2025\u5e7412\u67089\u65e5\u5f53\u524d\uff0c\u66f2\u7ebf\u5904\u4e8e\u6e29\u548c\u6b63\u5411\uff0cLevel\u56e0\u5b50\u5904\u4e8e\u5386\u53f220%\u5206\u4f4d\uff0c\u77ed\u671f\u7cfb\u7edf\u6027\u98ce\u9669\u8f83\u4f4e\u3002\u4f46\u53ea\u8981HMM\u72b6\u6001\u5207\u6362\u5230\u5012\u6302\uff0c\u6216PC1\u5355\u65e5\u4e0a\u5347\u8d852\u4e2a\u6807\u51c6\u5dee\uff0c\u5c31\u662f\u660e\u786e\u7684\u6218\u672f\u7ea7\u4e70\u5165\u4fdd\u62a4\u4fe1\u53f7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u89c2\u70b9\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<p>\u672c\u6587\u4ece\u6570\u636e\u83b7\u53d6\u5f00\u59cb\uff0c\u9010\u6b65\u5b9e\u73b0VIX\u671f\u9650\u7ed3\u6784\u53ef\u89c6\u5316\u3001\u659c\u7387\u8ba1\u7b97\u3001HMM\u4e09\u72b6\u6001\u8bc6\u522b\u3001PCA\u56e0\u5b50\u5206\u89e3\u4ee5\u53caCarry\u4ef7\u5dee\u76d1\u63a7\uff0c\u5f62\u6210\u4e00\u5957\u53ef\u76f4\u63a5\u843d\u5730\u7684\u6ce2\u52a8\u7387\u7814\u7a76\u6846\u67b6\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6838\u5fc3\u5e93\uff1avix-utils\u3001pandas\u3001plotly\u3001hmmlearn\u3001scikit-learn\u3002<\/li>\n\n\n\n<li>\u5173\u952e\u6307\u6807\uff1a\u6bcf\u65e5\u659c\u7387\u3001HMM\u9690\u85cf\u72b6\u6001\u3001Carry\u4ef7\u5dee\u3001PCA\u4e09\u56e0\u5b50\u3002<\/li>\n\n\n\n<li>\u5f53\u524d\u72b6\u6001\uff082025.12.9\uff09\uff1a\u6e29\u548c\u6b63\u5411\uff0cLevel\u4f4e\u4f4d\uff0c\u77ed\u671f\u7cfb\u7edf\u6027\u98ce\u9669\u53ef\u63a7\u3002<\/li>\n\n\n\n<li>\u540e\u7eed\u53ef\u6269\u5c55\uff1a\u52a0\u5165\u6052\u5230\u671f\u6307\u6570\u3001\u5b9e\u65f6WebSocket\u3001\u9489\u9489\/\u4f01\u4e1a\u5fae\u4fe1\u62a5\u8b66\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u4f60\u89c9\u5f97\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9\uff0c\u8bb0\u5f97\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u670b\u53cb\u3002\u6709\u4ec0\u4e48\u95ee\u9898\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u7559\u8a00\uff0c\u8001\u4f59\u4f1a\u4e00\u4e00\u89e3\u7b54\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u5728\u91cf\u5316\u4ea4\u6613\u7684\u9053\u8def\u4e0a\u8d8a\u8d70\u8d8a\u8fdc\uff01<\/p>\n\n\n\n<p>&nbsp;<a>#VIX\u671f\u9650\u7ed3\u6784<\/a>&nbsp;<a>#Python\u91cf\u5316<\/a>&nbsp;<a>#HMM\u653f\u6743\u8bc6\u522b<\/a>&nbsp;<a>#\u6ce2\u52a8\u7387\u4ea4\u6613<\/a>&nbsp;<a>#VIX\u671f\u8d27<\/a>&nbsp;<a>#PCA\u56e0\u5b50<\/a>&nbsp;<a>#Carry\u7b56\u7565<\/a>&nbsp;<a>#\u91cf\u5316\u4ea4\u6613<\/a>&nbsp;<a>#\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-center\">\u98ce\u9669\u63d0\u793a\uff1a\u6295\u8d44\u6709\u98ce\u9669\uff0c\u5165\u5e02\u9700\u8c28\u614e\u3002\u672c\u6587\u4ec5\u4f9b\u5b66\u4e60\u53c2\u8003\uff0c\u4e0d\u6784\u6210\u6295\u8d44\u5efa\u8bae\u3002<\/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:\/\/laoyulaoyu.com\/index.php\/2025\/12\/18\/%e5%88%ab%e5%86%8d%e5%8f%aa%e7%9c%8b%e6%81%90%e6%85%8c%e6%8c%87%e6%95%b0%e4%ba%86%ef%bc%81%e9%87%8f%e5%8c%96%e4%bb%a3%e7%a0%81%e8%ae%a9%e4%bd%a0%e4%bb%8evix%e6%9b%b2%e7%ba%bf%e7%9a%84\/\">Continue reading<span class=\"screen-reader-text\">\u522b\u518d\u53ea\u770b\u6050\u614c\u6307\u6570\u4e86\uff01\u91cf\u5316\u4ee3\u7801\u8ba9\u4f60\u4eceVIX\u66f2\u7ebf\u7684\u201c\u5761\u5ea6\u201d\u548c\u201c\u5f27\u5ea6\u201d\u770b\u7a7f\u725b\u718a<\/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":[17,4,5,14,6],"class_list":{"0":"post-3208","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-aiinvest","7":"tag-ai","10":"tag-14","11":"tag-6","12":"entry"},"_links":{"self":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=3208"}],"version-history":[{"count":1,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3208\/revisions"}],"predecessor-version":[{"id":3212,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/3208\/revisions\/3212"}],"wp:attachment":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=3208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=3208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=3208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}