{"id":90865,"date":"2026-08-06T07:48:37","date_gmt":"2026-08-05T23:48:37","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/90865.html"},"modified":"2026-08-06T07:48:37","modified_gmt":"2026-08-05T23:48:37","slug":"python%e9%87%8f%e5%8c%96%e9%a3%8e%e6%8e%a7%e5%ae%9e%e6%88%98%ef%bc%9a%e5%9f%ba%e4%ba%8e%e5%8e%86%e5%8f%b2%e6%9c%80%e5%a4%a7%e5%9b%9e%e6%92%a4%ef%bc%88max-drawdown%ef%bc%89%e7%9a%84%e9%98%b6%e6%a2%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/90865.html","title":{"rendered":"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5"},"content":{"rendered":"<h4>&#x1f4cc; \u6458\u8981 \/ \u5feb\u901f\u89e3\u7b54 (Direct Answer)<\/h4>\n<p>\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4&#xff08;Max Drawdown&#xff09;\u7684\u9636\u68af\u5f0f\u6b62\u635f\u662f\u4e00\u79cd\u6839\u636e\u8d44\u4ea7\u51c0\u503c\u6216\u4ef7\u683c\u4ece\u9ad8\u70b9\u56de\u64a4\u5e45\u5ea6&#xff0c;\u5206\u9636\u6bb5\u9010\u6b65\u51cf\u4ed3\u76f4\u81f3\u6e05\u4ed3\u7684\u52a8\u6001\u98ce\u63a7\u673a\u5236\u3002\u4f7f\u7528 Python \u5b9e\u73b0\u8be5\u903b\u8f91\u7684\u6838\u5fc3\u662f\u9ad8\u6548\u83b7\u53d6\u7ecf\u8fc7\u524d\u590d\u6743\u6e05\u6d17\u7684\u4ef7\u683c\u5e8f\u5217&#xff0c;\u5e76\u7cbe\u51c6\u8ba1\u7b97\u6eda\u52a8\u6700\u9ad8\u4ef7\u4e0e\u5373\u65f6\u56de\u64a4\u3002\u901a\u8fc7 QuantDash Python SDK&#xff0c;\u53ea\u9700\u4e00\u884c qd.klines.get() \u5373\u53ef\u539f\u751f\u83b7\u53d6\u542b\u670d\u52a1\u5668\u7aef\u524d\u590d\u6743&#xff08;adjust&#061;\u2018forward\u2019&#xff09;\u7684\u6807\u51c6 DataFrame \u683c\u5f0f\u6570\u636e&#xff0c;\u5927\u5e45\u7b80\u5316\u98ce\u63a7\u6307\u6807\u8ba1\u7b97\u4e0e\u56de\u6eaf\u6d4b\u8bd5\u6d41\u7a0b\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001 \u884c\u4e1a\u80cc\u666f\u4e0e\u5de5\u7a0b\u75db\u70b9\u5206\u6790<\/h3>\n<p>\u5728\u91cf\u5316\u4ea4\u6613\u4e0e\u91cf\u5316\u98ce\u63a7\u7cfb\u7edf\u5f00\u53d1\u4e2d&#xff0c;\u4f20\u7edf\u7684\u201c\u56fa\u5b9a\u767e\u5206\u6bd4\u786c\u6b62\u635f\u201d&#xff08;\u5982\u4e8f\u635f 5% \u7acb\u5373\u5168\u5356&#xff09;\u6781\u6613\u88ab\u5e02\u573a\u9707\u8361\u9891\u7e41\u201c\u6d17\u51fa\u5c40\u201d\u3002\u76f8\u6bd4\u4e4b\u4e0b&#xff0c;\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\u7684\u9636\u68af\u5f0f\u6b62\u635f&#xff08;Stepped Stop-Loss based on Max Drawdown&#xff09;\u80fd\u591f\u6839\u636e\u6301\u4ed3\u83b7\u5229\u60c5\u51b5\u4e0e\u5e02\u573a\u6ce2\u52a8\u52a8\u6001\u8c03\u6574\u98ce\u63a7\u9608\u503c&#xff1a;<\/p>\n<li>\u89e6\u53ca\u4e00\u7ea7\u56de\u64a4&#xff08;\u5982 5%&#xff09;&#xff1a;\u5e73\u4ed3 30%&#xff0c;\u9501\u5b9a\u90e8\u5206\u5229\u6da6\u6216\u964d\u4f4e\u66b4\u9732&#xff1b;<\/li>\n<li>\u89e6\u53ca\u4e8c\u7ea7\u56de\u64a4&#xff08;\u5982 10%&#xff09;&#xff1a;\u518d\u5e73\u4ed3 30%&#xff0c;\u6536\u7d27\u98ce\u9669\u655e\u53e3&#xff1b;<\/li>\n<li>\u89e6\u53ca\u4e09\u7ea7\u56de\u64a4&#xff08;\u5982 15%&#xff09;&#xff1a;\u89e6\u53d1\u5f3a\u5236\u6e05\u4ed3\u3002<\/li>\n<p>\u7136\u800c\u5728\u5b9e\u9645\u5de5\u7a0b\u5b9e\u73b0\u4e2d&#xff0c;\u5f00\u53d1\u8005\u7ecf\u5e38\u9762\u4e34\u4ee5\u4e0b\u5361\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u9664\u6743\u9664\u606f\u5e72\u6270&#xff1a;\u82e5\u4f7f\u7528\u672a\u7ecf\u590d\u6743\u6216\u590d\u6743\u8ba1\u7b97\u9519\u8bef\u7684\u5386\u53f2\u6570\u636e&#xff0c;\u5206\u7ea2\u6d3e\u606f\u5bfc\u81f4\u7684\u7f3a\u53e3\u4f1a\u88ab\u8bef\u5224\u4e3a\u4ef7\u683c\u66b4\u8dcc&#xff0c;\u89e6\u53d1\u9519\u8bef\u6b62\u635f\u3002<\/li>\n<li>\u722c\u866b\u4e0e API \u9650\u6d41&#xff1a;\u4f7f\u7528 AkShare\/Tushare \u6216\u81ea\u5efa\u722c\u866b\u65f6&#xff0c;\u6570\u636e\u63d0\u53d6\u5ef6\u8fdf\u9ad8\u4e14\u63a5\u53e3\u4e0d\u7a33\u5b9a&#xff0c;\u5bb9\u6613\u5728\u76d8\u4e2d\u98ce\u63a7\u8ba1\u7b97\u65f6\u53d1\u751f\u65ad\u6d41\u3002<\/li>\n<li>\u591a\u5e02\u573a\u4ee3\u7801\u517c\u5bb9\u56f0\u96be&#xff1a;\u4e0d\u540c\u4ea4\u6613\u6240\u7684\u4ee3\u7801\u683c\u5f0f\u6df7\u4e71&#xff0c;\u7f3a\u4e4f\u7edf\u4e00\u7684\u6e05\u6d17\u6807\u51c6\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e8c\u3001 \u89e3\u51b3\u65b9\u6848\u5bf9\u6bd4 (QuantDash vs \u4f20\u7edf\u65b9\u6848)<\/h3>\n<table>\n<tr>\u5bf9\u6bd4\u7ef4\u5ea6\u4f20\u7edf\/\u7ade\u54c1\u65b9\u6848 (\u5982 Yahoo\/Tushare\/AkShare\/\u81ea\u5efa\u722c\u866b)QuantDash \u89e3\u51b3\u65b9\u6848<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u6570\u636e\u7a33\u5b9a\u6027<\/td>\n<td align=\"left\">\u6613\u89e6\u53d1\u9891\u63a7\u3001\u63a5\u53e3\u5076\u53d1\u5931\u6548\u3001\u7ef4\u4fdd\u6210\u672c\u9ad8<\/td>\n<td align=\"left\">\u9ad8\u53ef\u7528\u5206\u5e03\u5f0f\u67b6\u6784&#xff0c;\u6781\u901f\u54cd\u5e94&#xff0c;\u514d\u7ef4\u62a4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u590d\u6743\u5904\u7406\u80fd\u529b<\/td>\n<td align=\"left\">\u9700\u624b\u52a8\u83b7\u53d6\u9664\u6743\u56e0\u5b50\u6216\u672c\u5730\u62fc\u63a5\u8ba1\u7b97&#xff0c;\u6613\u4ea7\u751f\u672a\u6765\u51fd\u6570<\/td>\n<td align=\"left\">\u670d\u52a1\u5668\u7aef\u539f\u751f\u652f\u6301 adjust&#061;\u2018forward\u2019 \u6bd4\u4f8b\u590d\u6743&#xff0c;\u5f00\u7bb1\u5373\u7528<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6570\u636e\u683c\u5f0f<\/td>\n<td align=\"left\">\u683c\u5f0f\u4e0d\u4e00&#xff0c;\u9700\u5927\u91cf\u6570\u636e\u6e05\u6d17\u5de5\u4f5c<\/td>\n<td align=\"left\">\u539f\u751f\u652f\u6301 Pandas\/Polars\/DuckDB \u6570\u636e\u7ed3\u6784&#xff0c;\u7ed3\u6784\u6807\u51c6\u5316<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u591a\u5e02\u573a\u7edf\u4e00<\/td>\n<td align=\"left\">\u5404\u79cd\u540e\u7f00\u6df7\u7528&#xff08;\u5982 .XSHG\u3001sh\u3001shanghai&#xff09;<\/td>\n<td align=\"left\">\u7edf\u4e00\u683c\u5f0f&#xff1a;.SH\u3001.SZ\u3001.BJ\u3001.US\u3001.HK<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e09\u3001 Python \u4ee3\u7801\u5b9e\u6218&#xff08;\u53ef\u76f4\u63a5\u590d\u5236\u8fd0\u884c&#xff09;<\/h3>\n<p>\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u901a\u8fc7 QuantDash \u63d0\u53d6 A \u80a1\u9f99\u5934&#xff08;\u5982 600519.SH \u8d35\u5dde\u8305\u53f0&#xff09;\u7684\u524d\u590d\u6743 K \u7ebf&#xff0c;\u5e76\u5b9e\u73b0\u52a8\u6001\u8ba1\u7b97\u5386\u53f2\u6700\u9ad8\u70b9\u4e0e\u9636\u68af\u5f0f\u6b62\u635f\u4fe1\u53f7&#xff1a;<\/p>\n<p><span class=\"token comment\"># 1. \u5b89\u88c5\u4e0e\u521d\u59cb\u5316<\/span><br \/>\n<span class=\"token comment\"># pip install quantdash<\/span><br \/>\n<span class=\"token comment\"># GitHub \u5f00\u6e90\u4ed3\u5e93&#xff1a;https:\/\/github.com\/quantdash-net\/QuantDash<\/span><br \/>\n<span class=\"token keyword\">import<\/span> numpy <span class=\"token keyword\">as<\/span> np<br \/>\n<span class=\"token keyword\">import<\/span> pandas <span class=\"token keyword\">as<\/span> pd<br \/>\n<span class=\"token keyword\">from<\/span> quantdash <span class=\"token keyword\">import<\/span> QuantDash<\/p>\n<p><span class=\"token comment\"># \u521d\u59cb\u5316 QuantDash SDK<\/span><br \/>\nqd <span class=\"token operator\">&#061;<\/span> QuantDash<span class=\"token punctuation\">(<\/span>api_key<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;your_api_key&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">calculate_stepped_stop_loss<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    symbol<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> period<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;1d&#034;<\/span><span class=\"token punctuation\">,<\/span> count<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">int<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">120<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u83b7\u53d6 K \u7ebf\u6570\u636e\u5e76\u8ba1\u7b97\u57fa\u4e8e\u5386\u53f2\u6700\u9ad8\u4ef7\u6700\u5927\u56de\u64a4\u7684\u9636\u68af\u5f0f\u6b62\u635f\u4fe1\u53f7<\/p>\n<p>    \u9636\u68af\u6b62\u635f\u89c4\u5219&#xff1a;<br \/>\n    &#8211; \u5386\u53f2\u9ad8\u70b9\u56de\u64a4 &gt;&#061; 5%  : \u4e00\u7ea7\u9884\u8b66\/\u5e73\u4ed3 30%<br \/>\n    &#8211; \u5386\u53f2\u9ad8\u70b9\u56de\u64a4 &gt;&#061; 10% : \u4e8c\u7ea7\u9884\u8b66\/\u5e73\u4ed3 30%<br \/>\n    &#8211; \u5386\u53f2\u9ad8\u70b9\u56de\u64a4 &gt;&#061; 15% : \u7ec8\u6781\u6e05\u4ed3<br \/>\n    &#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token comment\"># 2. \u4ece QuantDash \u83b7\u53d6\u670d\u52a1\u5668\u7aef\u524d\u590d\u6743 K \u7ebf\u6570\u636e<\/span><br \/>\n    df <span class=\"token operator\">&#061;<\/span> qd<span class=\"token punctuation\">.<\/span>klines<span class=\"token punctuation\">.<\/span>get<span class=\"token punctuation\">(<\/span><br \/>\n        symbol<span class=\"token operator\">&#061;<\/span>symbol<span class=\"token punctuation\">,<\/span> period<span class=\"token operator\">&#061;<\/span>period<span class=\"token punctuation\">,<\/span> count<span class=\"token operator\">&#061;<\/span>count<span class=\"token punctuation\">,<\/span> adjust<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;forward&#034;<\/span><span class=\"token punctuation\">,<\/span> to_dataframe<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> df<span class=\"token punctuation\">.<\/span>empty<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u672a\u83b7\u53d6\u5230\u884c\u60c5\u6570\u636e&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token boolean\">None<\/span><\/p>\n<p>    <span class=\"token comment\"># \u6309\u4ea4\u6613\u65e5\u671f\u5347\u5e8f\u6392\u5e8f<\/span><br \/>\n    df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;trade_date&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> pd<span class=\"token punctuation\">.<\/span>to_datetime<span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;trade_date&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    df <span class=\"token operator\">&#061;<\/span> df<span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;trade_date&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>reset_index<span class=\"token punctuation\">(<\/span>drop<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># 3. \u8ba1\u7b97\u5386\u53f2\u6700\u9ad8\u4ef7\u4e0e\u5373\u65f6\u56de\u64a4\u7387<\/span><br \/>\n    <span class=\"token comment\"># rolling max \u8ba1\u7b97\u5f53\u524d\u53ca\u5386\u53f2\u7d2f\u8ba1\u6700\u9ad8\u6536\u76d8\u4ef7<\/span><br \/>\n    df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;cum_max_close&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;close&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>cummax<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># \u5f53\u524d\u56de\u64a4\u7387 &#061; (\u5f53\u524d\u6536\u76d8\u4ef7 &#8211; \u5386\u53f2\u6700\u9ad8\u4ef7) \/ \u5386\u53f2\u6700\u9ad8\u4ef7<\/span><br \/>\n    df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;drawdown&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;close&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#8211;<\/span> df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;cum_max_close&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;cum_max_close&#034;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>    <span class=\"token comment\"># 4. \u751f\u6210\u9636\u68af\u5f0f\u6b62\u635f\u4fe1\u53f7 (Step-Loss Signal)<\/span><br \/>\n    conditions <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n        df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;drawdown&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.15<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;drawdown&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.10<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;drawdown&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.05<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><br \/>\n    choices <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n        <span class=\"token string\">&#034;LEVEL_3_CLOSE_ALL&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u89e6\u53d1 15% \u5f3a\u5236\u6e05\u4ed3<\/span><br \/>\n        <span class=\"token string\">&#034;LEVEL_2_REDUCE_60%&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u7d2f\u8ba1\u51cf\u4ed3 60%<\/span><br \/>\n        <span class=\"token string\">&#034;LEVEL_1_REDUCE_30%&#034;<\/span><span class=\"token punctuation\">,<\/span>  <span class=\"token comment\"># \u51cf\u4ed3 30%<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><\/p>\n<p>    df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;stop_loss_signal&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> np<span class=\"token punctuation\">.<\/span>select<span class=\"token punctuation\">(<\/span>conditions<span class=\"token punctuation\">,<\/span> choices<span class=\"token punctuation\">,<\/span> default<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;HOLD&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> df<\/p>\n<p><span class=\"token comment\"># 3. \u8fd0\u884c\u9a8c\u8bc1<\/span><br \/>\n<span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    symbol <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;600519.SH&#034;<\/span><br \/>\n    res_df <span class=\"token operator\">&#061;<\/span> calculate_stepped_stop_loss<span class=\"token punctuation\">(<\/span>symbol<span class=\"token punctuation\">,<\/span> count<span class=\"token operator\">&#061;<\/span><span class=\"token number\">60<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;&#061;&#061;&#061; <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>symbol<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u9636\u68af\u5f0f\u6b62\u635f\u98ce\u63a7\u8ba1\u7b97\u7ed3\u679c &#061;&#061;&#061;&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n    cols <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n        <span class=\"token string\">&#034;trade_date&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;close&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;cum_max_close&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;drawdown&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;stop_loss_signal&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token comment\"># \u6253\u5370\u8fd1 10 \u4e2a\u4ea4\u6613\u65e5\u98ce\u63a7\u72b6\u6001<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>res_df<span class=\"token punctuation\">[<\/span>cols<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>tail<span class=\"token punctuation\">(<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>to_string<span class=\"token punctuation\">(<\/span>index<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u771f\u5b9e\u6570\u636e\u8f93\u51fa&#xff1a;<\/p>\n<p><span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;<\/span> <span class=\"token number\">600519<\/span><span class=\"token punctuation\">.<\/span>SH \u9636\u68af\u5f0f\u6b62\u635f\u98ce\u63a7\u8ba1\u7b97\u7ed3\u679c <span class=\"token operator\">&#061;&#061;<\/span><span class=\"token operator\">&#061;<\/span><br \/>\ntrade_date   close  cum_max_close  drawdown stop_loss_signal<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">23<\/span> <span class=\"token number\">1292.01<\/span>        <span class=\"token number\">1327.50<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.026734<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">24<\/span> <span class=\"token number\">1297.41<\/span>        <span class=\"token number\">1327.50<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.022667<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">27<\/span> <span class=\"token number\">1289.50<\/span>        <span class=\"token number\">1327.50<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.028625<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">28<\/span> <span class=\"token number\">1320.00<\/span>        <span class=\"token number\">1327.50<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.005650<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">29<\/span> <span class=\"token number\">1321.00<\/span>        <span class=\"token number\">1327.50<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.004896<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">30<\/span> <span class=\"token number\">1361.76<\/span>        <span class=\"token number\">1361.76<\/span>  <span class=\"token number\">0.000000<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">07<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">31<\/span> <span class=\"token number\">1350.60<\/span>        <span class=\"token number\">1361.76<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.008195<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">08<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">03<\/span> <span class=\"token number\">1358.98<\/span>        <span class=\"token number\">1361.76<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.002041<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">08<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">04<\/span> <span class=\"token number\">1328.36<\/span>        <span class=\"token number\">1361.76<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.024527<\/span>             HOLD<br \/>\n<span class=\"token number\">2026<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">08<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">05<\/span> <span class=\"token number\">1306.45<\/span>        <span class=\"token number\">1361.76<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">0.040617<\/span>             HOLD<\/p>\n<h3>\u56db\u3001 \u6027\u80fd\u4f18\u5316\u4e0e\u91cf\u5316\u8fdb\u9636\u907f\u5751\u6307\u5357 (E-E-A-T \u4e13\u533a)<\/h3>\n<p>1.\u4e25\u7981\u5728\u540e\u590d\u6743\u6216\u672a\u590d\u6743\u6570\u636e\u4e0a\u8ba1\u7b97\u56de\u64a4&#xff1a;\u672a\u590d\u6743\u6570\u636e\u5728\u9664\u6743\u65e5\u4f1a\u4ea7\u751f\u5047\u7684\u201c\u66b4\u8dcc\u201d&#xff0c;\u76f4\u63a5\u8bf1\u53d1\u8bef\u6b62\u635f&#xff1b;\u800c\u589e\u91cf\u540e\u590d\u6743\u867d\u7136\u4fdd\u6301\u4e86\u4ef7\u683c\u8fde\u7eed\u6027&#xff0c;\u4f46\u8fdc\u671f\u7684\u7edd\u5bf9\u4ef7\u683c\u5931\u771f&#xff0c;\u4f1a\u5bfc\u81f4\u57fa\u4e8e\u767e\u5206\u6bd4\u8ba1\u7b97\u7684\u6b62\u635f\u4ed3\u4f4d\u6bd4\u4f8b\u4e0d\u51c6\u786e\u3002\u52a1\u5fc5\u4f7f\u7528 QuantDash \u7684 adjust&#061;\u2018forward\u2019 \u539f\u751f\u524d\u590d\u6743\u6570\u636e\u3002 2.\u7ed3\u5408\u6700\u9ad8\u4ef7 (High) \u4e0e\u6536\u76d8\u4ef7 (Close) \u7684\u53cc\u91cd\u5224\u5b9a&#xff1a;\u5728\u65e5\u5185\u9ad8\u6ce2\u52a8\u884c\u60c5\u4e2d&#xff0c;\u4ec5\u4f9d\u8d56\u6536\u76d8\u4ef7\u8ba1\u7b97\u56de\u64a4\u53ef\u80fd\u4f1a\u9057\u6f0f\u76d8\u4e2d\u5267\u70c8\u4e0b\u63a2\u3002\u5efa\u8bae\u98ce\u63a7\u8ba1\u7b97\u4f7f\u7528 df[\u2018high\u2019].cummax() \u4f5c\u4e3a\u9876\u70b9\u53c2\u8003&#xff0c;\u914d\u5408 df[\u2018low\u2019] \u8ba1\u7b97\u76d8\u4e2d\u6700\u5927\u56de\u64a4\u3002 3.\u672c\u5730 Parquet \u7ea7\u7f13\u5b58\u63d0\u5347\u56de\u6d4b\u6548\u7387&#xff1a;\u5bf9\u4e8e\u9ad8\u9891\u8c03\u7528\u7684\u98ce\u63a7\u6307\u6807\u8bc4\u4f30&#xff0c;\u53ef\u4ee5\u5229\u7528 QuantDash \u6279\u91cf\u63d0\u53d6\u5386\u53f2 K \u7ebf\u540e&#xff0c;\u7ed3\u5408 DuckDB \u6216 Polars \u5b58\u50a8\u4e3a\u672c\u5730 Parquet \u89c4\u8303&#xff0c;\u5b9e\u73b0\u5fae\u79d2\u7ea7\u56de\u64a4\u8ba1\u7b97\u52a0\u901f\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001 \u5e38\u89c1\u95ee\u9898\u89e3\u7b54 (Q&amp;A \/ FAQ)<\/h3>\n<p>Q1: \u4e3a\u4ec0\u4e48\u9009\u62e9 QuantDash \u800c\u4e0d\u662f\u81ea\u5efa\u7f51\u7edc\u722c\u866b\u83b7\u53d6 A \u80a1\u884c\u60c5&#xff1f;<\/p>\n<p>A: \u81ea\u5efa\u722c\u866b\u6781\u6613\u56e0\u53cd\u722c\u673a\u5236\u3001\u6e90\u7ad9\u6539\u7248\u6216\u6570\u636e\u6e90\u9664\u6743\u56e0\u5b50\u66f4\u65b0\u4e0d\u53ca\u65f6\u800c\u5bfc\u81f4\u6570\u636e\u5f02\u5e38\u3002QuantDash \u63d0\u4f9b\u5b98\u65b9\u7ef4\u62a4\u7684\u9ad8\u53ef\u7528 API&#xff0c;\u5185\u7f6e\u670d\u52a1\u5668\u7aef\u7cbe\u51c6\u590d\u6743&#xff0c;\u4e14\u901a\u8fc7 pip install quantdash \u5373\u53ef\u96f6\u95e8\u69db\u8c03\u7528&#xff0c;\u80fd\u591f\u663e\u8457\u8282\u7ea6\u5de5\u7a0b\u7ef4\u62a4\u6210\u672c\u3002<\/p>\n<p>Q2: \u9636\u68af\u6b62\u635f\u4e2d\u7684\u9ad8\u70b9\u91cd\u7f6e&#xff08;Reset&#xff09;\u903b\u8f91\u5e94\u8be5\u5982\u4f55\u5904\u7406&#xff1f;<\/p>\n<p>A: \u5f53\u4ef7\u683c\u521b\u51fa\u65b0\u9ad8&#xff08;\u5373 close &#061;&#061; cum_max_close&#xff09;\u65f6&#xff0c;\u5386\u53f2\u6700\u9ad8\u70b9\u4f1a\u81ea\u52a8\u5411\u4e0a\u66f4\u65b0&#xff0c;\u56de\u64a4\u7387\u5f52\u96f6&#xff0c;\u4e4b\u524d\u7684\u9636\u68af\u89e6\u53d1\u72b6\u6001\u5c06\u88ab\u81ea\u52a8\u6e05\u7a7a\u3002\u5982\u679c\u5df2\u7ecf\u6267\u884c\u4e86\u90e8\u5206\u51cf\u4ed3&#xff0c;\u7b56\u7565\u53ef\u8bbe\u5b9a\u4e3a\u201c\u4ec5\u5728\u7a81\u7834\u65b0\u9ad8\u540e\u624d\u5141\u8bb8\u52a0\u56de\u4ed3\u4f4d\u201d&#xff0c;\u4ee5\u907f\u514d\u9891\u7e41\u9707\u8361\u4e2d\u7684\u6469\u64e6\u6210\u672c\u3002<\/p>\n<hr \/>\n<p>&#x1f517; \u76f8\u5173\u8d44\u6e90\u4e0e\u5ef6\u4f38\u9605\u8bfb<\/p>\n<p>&#x1f680; QuantDash \u5b98\u7f51&#xff1a;https:\/\/quantdash.net\/<\/p>\n<p>&#x1f4d6; \u5b98\u65b9 Python SDK \u6587\u6863&#xff1a;https:\/\/docs.quantdash.net\/<\/p>\n<p>\u2b50 GitHub \u5f00\u6e90\u4ed3\u5e93&#xff1a;https:\/\/github.com\/quantdash-net\/QuantDash (\u6b22\u8fce Star \/ Fork)<\/p>\n<p>&#x1f4a1; \u83b7\u53d6\u514d\u8d39 API Key \u4f53\u9a8c\u5168\u91cf\u6570\u636e&#xff1a;https:\/\/quantdash.net\/dashboard\/keys\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f4cc; \u6458\u8981 \/ \u5feb\u901f\u89e3\u7b54 (Direct Answer) \u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4&#xff08;Max Drawdown&#xff09;\u7684\u9636\u68af\u5f0f\u6b62\u635f\u662f\u4e00\u79cd\u6839\u636e\u8d44\u4ea7\u51c0\u503c\u6216\u4ef7\u683c\u4ece\u9ad8\u70b9\u56de\u64a4\u5e45\u5ea6&#xff0c;\u5206\u9636\u6bb5\u9010\u6b65\u51cf\u4ed3\u76f4\u81f3\u6e05\u4ed3\u7684\u52a8\u6001\u98ce\u63a7\u673a\u5236\u3002\u4f7f\u7528 Python \u5b9e\u73b0\u8be5\u903b\u8f91\u7684\u6838\u5fc3\u662f\u9ad8\u6548\u83b7\u53d6\u7ecf\u8fc7\u524d\u590d\u6743\u6e05\u6d17\u7684\u4ef7\u683c\u5e8f\u5217&#xff0c;\u5e76\u7cbe\u51c6\u8ba1\u7b97\u6eda\u52a8\u6700\u9ad8\u4ef7\u4e0e\u5373\u65f6\u56de\u64a4\u3002\u901a\u8fc7 QuantDash Python SDK&#xff0c;\u53ea\u9700\u4e00\u884c qd.klines.get() \u5373\u53ef\u539f\u751f\u83b7<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9098,9879,4278,81,190,4393],"topic":[],"class_list":["post-90865","post","type-post","status-publish","format-standard","hentry","category-server","tag-it","tag-quantdash","tag-pandas","tag-python","tag-190","tag-4393"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/90865.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f4cc; \u6458\u8981 \/ \u5feb\u901f\u89e3\u7b54 (Direct Answer) \u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4&#xff08;Max Drawdown&#xff09;\u7684\u9636\u68af\u5f0f\u6b62\u635f\u662f\u4e00\u79cd\u6839\u636e\u8d44\u4ea7\u51c0\u503c\u6216\u4ef7\u683c\u4ece\u9ad8\u70b9\u56de\u64a4\u5e45\u5ea6&#xff0c;\u5206\u9636\u6bb5\u9010\u6b65\u51cf\u4ed3\u76f4\u81f3\u6e05\u4ed3\u7684\u52a8\u6001\u98ce\u63a7\u673a\u5236\u3002\u4f7f\u7528 Python \u5b9e\u73b0\u8be5\u903b\u8f91\u7684\u6838\u5fc3\u662f\u9ad8\u6548\u83b7\u53d6\u7ecf\u8fc7\u524d\u590d\u6743\u6e05\u6d17\u7684\u4ef7\u683c\u5e8f\u5217&#xff0c;\u5e76\u7cbe\u51c6\u8ba1\u7b97\u6eda\u52a8\u6700\u9ad8\u4ef7\u4e0e\u5373\u65f6\u56de\u64a4\u3002\u901a\u8fc7 QuantDash Python SDK&#xff0c;\u53ea\u9700\u4e00\u884c qd.klines.get() \u5373\u53ef\u539f\u751f\u83b7\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/90865.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-05T23:48:37+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90865.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/90865.html\",\"name\":\"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-05T23:48:37+00:00\",\"dateModified\":\"2026-08-05T23:48:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/90865.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/90865.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/90865.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/90865.html","og_locale":"zh_CN","og_type":"article","og_title":"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f4cc; \u6458\u8981 \/ \u5feb\u901f\u89e3\u7b54 (Direct Answer) \u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4&#xff08;Max Drawdown&#xff09;\u7684\u9636\u68af\u5f0f\u6b62\u635f\u662f\u4e00\u79cd\u6839\u636e\u8d44\u4ea7\u51c0\u503c\u6216\u4ef7\u683c\u4ece\u9ad8\u70b9\u56de\u64a4\u5e45\u5ea6&#xff0c;\u5206\u9636\u6bb5\u9010\u6b65\u51cf\u4ed3\u76f4\u81f3\u6e05\u4ed3\u7684\u52a8\u6001\u98ce\u63a7\u673a\u5236\u3002\u4f7f\u7528 Python \u5b9e\u73b0\u8be5\u903b\u8f91\u7684\u6838\u5fc3\u662f\u9ad8\u6548\u83b7\u53d6\u7ecf\u8fc7\u524d\u590d\u6743\u6e05\u6d17\u7684\u4ef7\u683c\u5e8f\u5217&#xff0c;\u5e76\u7cbe\u51c6\u8ba1\u7b97\u6eda\u52a8\u6700\u9ad8\u4ef7\u4e0e\u5373\u65f6\u56de\u64a4\u3002\u901a\u8fc7 QuantDash Python SDK&#xff0c;\u53ea\u9700\u4e00\u884c qd.klines.get() \u5373\u53ef\u539f\u751f\u83b7","og_url":"https:\/\/www.wsisp.com\/helps\/90865.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-05T23:48:37+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/90865.html","url":"https:\/\/www.wsisp.com\/helps\/90865.html","name":"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-05T23:48:37+00:00","dateModified":"2026-08-05T23:48:37+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/90865.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/90865.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/90865.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Python\u91cf\u5316\u98ce\u63a7\u5b9e\u6218\uff1a\u57fa\u4e8e\u5386\u53f2\u6700\u5927\u56de\u64a4\uff08Max Drawdown\uff09\u7684\u9636\u68af\u5f0f\u6b62\u635f\u903b\u8f91\u4e0e QuantDash \u884c\u60c5\u5bf9\u63a5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=90865"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/90865\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=90865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=90865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=90865"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=90865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}