++
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ try:
|
|||||||
# 创建游标
|
# 创建游标
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
|
||||||
keys = ["pcr_oi_90", "implied_volatility_call_90", "implied_volatility_put_90", "pcr_oi_270", "implied_volatility_call_270", "implied_volatility_put_270", "volume", "open_interest", "volume_call", "volume_put", "open_interest_call", "open_interest_put", "close", "vwap", "adv20", "market_cap", "subindustry", "sector", "industry"]
|
keys = ["implied_volatility_call_90", "implied_volatility_put_90", "implied_volatility_call_30", "implied_volatility_put_30", "implied_volatility_call_60", "implied_volatility_put_60", "close", "volume", "adv20", "low", "high"]
|
||||||
|
|
||||||
for key in keys:
|
for key in keys:
|
||||||
# SQL 查询语句
|
# SQL 查询语句
|
||||||
|
|||||||
+37
-57
@@ -1,7 +1,7 @@
|
|||||||
trade_when(pcr_oi_270 < 1, (implied_volatility_call_270-implied_volatility_put_270), -1)
|
-ts_sum(reverse(subtract(implied_volatility_call_90, implied_volatility_put_90)), 5)
|
||||||
我需要优化这个因子, 现在模拟之后的结果是
|
我需要优化这个因子, 现在模拟之后的结果是
|
||||||
{
|
{
|
||||||
"id": "KPRvr7YN",
|
"id": "gJzgYd7J",
|
||||||
"type": "REGULAR",
|
"type": "REGULAR",
|
||||||
"author": "YC93384",
|
"author": "YC93384",
|
||||||
"settings": {
|
"settings": {
|
||||||
@@ -9,8 +9,8 @@ trade_when(pcr_oi_270 < 1, (implied_volatility_call_270-implied_volatility_put_2
|
|||||||
"region": "USA",
|
"region": "USA",
|
||||||
"universe": "TOP3000",
|
"universe": "TOP3000",
|
||||||
"delay": 1,
|
"delay": 1,
|
||||||
"decay": 4,
|
"decay": 0,
|
||||||
"neutralization": "SUBINDUSTRY",
|
"neutralization": "INDUSTRY",
|
||||||
"truncation": 0.08,
|
"truncation": 0.08,
|
||||||
"pasteurization": "ON",
|
"pasteurization": "ON",
|
||||||
"unitHandling": "VERIFY",
|
"unitHandling": "VERIFY",
|
||||||
@@ -19,75 +19,79 @@ trade_when(pcr_oi_270 < 1, (implied_volatility_call_270-implied_volatility_put_2
|
|||||||
"language": "FASTEXPR",
|
"language": "FASTEXPR",
|
||||||
"visualization": false,
|
"visualization": false,
|
||||||
"startDate": "2018-01-20",
|
"startDate": "2018-01-20",
|
||||||
"endDate": "2023-01-20",
|
"endDate": "2023-01-20"
|
||||||
"testPeriod": "P1Y"
|
|
||||||
},
|
},
|
||||||
"regular": {
|
"regular": {
|
||||||
"code": "trade_when(pcr_oi_90 < ts_mean(pcr_oi_90, 126), subtract(implied_volatility_call_90, implied_volatility_put_90), -1)",
|
"code": "-ts_sum(reverse(subtract(implied_volatility_call_90, implied_volatility_put_90)), 5)",
|
||||||
"description": null,
|
"description": null,
|
||||||
"operatorCount": 4
|
"operatorCount": 4
|
||||||
},
|
},
|
||||||
"dateCreated": "2025-12-21T03:10:00-05:00",
|
"dateCreated": "2025-12-21T05:31:30-05:00",
|
||||||
"dateSubmitted": null,
|
"dateSubmitted": null,
|
||||||
"dateModified": "2025-12-21T03:10:00-05:00",
|
"dateModified": "2025-12-21T05:31:31-05:00",
|
||||||
"name": null,
|
"name": null,
|
||||||
"favorite": false,
|
"favorite": false,
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"color": null,
|
"color": null,
|
||||||
"category": null,
|
"category": null,
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"classifications": [],
|
"classifications": [
|
||||||
"grade": "GOOD",
|
{
|
||||||
|
"id": "DATA_USAGE:SINGLE_DATA_SET",
|
||||||
|
"name": "Single Data Set Alpha"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"grade": "EXCELLENT",
|
||||||
"stage": "IS",
|
"stage": "IS",
|
||||||
"status": "UNSUBMITTED",
|
"status": "UNSUBMITTED",
|
||||||
"is": {
|
"is": {
|
||||||
"pnl": 9402399,
|
"pnl": 13250629,
|
||||||
"bookSize": 20000000,
|
"bookSize": 20000000,
|
||||||
"longCount": 1533,
|
"longCount": 1810,
|
||||||
"shortCount": 1142,
|
"shortCount": 1032,
|
||||||
"turnover": 0.319,
|
"turnover": 0.2738,
|
||||||
"returns": 0.19,
|
"returns": 0.2678,
|
||||||
"drawdown": 0.0881,
|
"drawdown": 0.1008,
|
||||||
"margin": 0.001191,
|
"margin": 0.001956,
|
||||||
"sharpe": 2.01,
|
"sharpe": 2.38,
|
||||||
"fitness": 1.55,
|
"fitness": 2.35,
|
||||||
"startDate": "2018-01-20",
|
"startDate": "2018-01-20",
|
||||||
"checks": [
|
"checks": [
|
||||||
{
|
{
|
||||||
"name": "LOW_SHARPE",
|
"name": "LOW_SHARPE",
|
||||||
"result": "PASS",
|
"result": "PASS",
|
||||||
"limit": 1.25,
|
"limit": 1.25,
|
||||||
"value": 2.01
|
"value": 2.38
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LOW_FITNESS",
|
"name": "LOW_FITNESS",
|
||||||
"result": "PASS",
|
"result": "PASS",
|
||||||
"limit": 1.0,
|
"limit": 1.0,
|
||||||
"value": 1.55
|
"value": 2.35
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LOW_TURNOVER",
|
"name": "LOW_TURNOVER",
|
||||||
"result": "PASS",
|
"result": "PASS",
|
||||||
"limit": 0.01,
|
"limit": 0.01,
|
||||||
"value": 0.319
|
"value": 0.2738
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "HIGH_TURNOVER",
|
"name": "HIGH_TURNOVER",
|
||||||
"result": "PASS",
|
"result": "PASS",
|
||||||
"limit": 0.7,
|
"limit": 0.7,
|
||||||
"value": 0.319
|
"value": 0.2738
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "CONCENTRATED_WEIGHT",
|
"name": "CONCENTRATED_WEIGHT",
|
||||||
"result": "FAIL",
|
"result": "FAIL",
|
||||||
"date": "2021-10-15",
|
"date": "2021-10-13",
|
||||||
"limit": 0.1,
|
"limit": 0.1,
|
||||||
"value": 0.500002
|
"value": 0.500003
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LOW_SUB_UNIVERSE_SHARPE",
|
"name": "LOW_SUB_UNIVERSE_SHARPE",
|
||||||
"result": "FAIL",
|
"result": "FAIL",
|
||||||
"limit": 0.87,
|
"limit": 1.03,
|
||||||
"value": 0.77
|
"value": 0.77
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -107,32 +111,8 @@ trade_when(pcr_oi_270 < 1, (implied_volatility_call_270-implied_volatility_put_2
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"os": null,
|
"os": null,
|
||||||
"train": {
|
"train": null,
|
||||||
"pnl": 5589755,
|
"test": null,
|
||||||
"bookSize": 20000000,
|
|
||||||
"longCount": 1484,
|
|
||||||
"shortCount": 1148,
|
|
||||||
"turnover": 0.3144,
|
|
||||||
"returns": 0.1417,
|
|
||||||
"drawdown": 0.0881,
|
|
||||||
"margin": 0.000901,
|
|
||||||
"fitness": 1.04,
|
|
||||||
"sharpe": 1.55,
|
|
||||||
"startDate": "2018-01-20"
|
|
||||||
},
|
|
||||||
"test": {
|
|
||||||
"pnl": 3768513,
|
|
||||||
"bookSize": 20000000,
|
|
||||||
"longCount": 1722,
|
|
||||||
"shortCount": 1121,
|
|
||||||
"turnover": 0.3372,
|
|
||||||
"returns": 0.3739,
|
|
||||||
"drawdown": 0.0495,
|
|
||||||
"margin": 0.002217,
|
|
||||||
"fitness": 3.74,
|
|
||||||
"sharpe": 3.55,
|
|
||||||
"startDate": "2022-01-20"
|
|
||||||
},
|
|
||||||
"prod": null,
|
"prod": null,
|
||||||
"competitions": null,
|
"competitions": null,
|
||||||
"themes": null,
|
"themes": null,
|
||||||
@@ -340,7 +320,7 @@ Description: Normalizes the values in a group to be between 0 and 1. (x - groupm
|
|||||||
Operator: group_zscore(x, group)
|
Operator: group_zscore(x, group)
|
||||||
Description: Calculates group Z-score - numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. zscore = (data - mean) / stddev of x for each instrument within its group.
|
Description: Calculates group Z-score - numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. zscore = (data - mean) / stddev of x for each instrument within its group.
|
||||||
|
|
||||||
注意这不是 python, 是 websim 表达式, 你有可能会用到这里面的操作符, 去改进这个因子, 或者你还需要用到什么数据字段, 我可以给你
|
1, 注意这不是 python, 是 websim 表达式, 你会用到这里面的操作符
|
||||||
不要出现操作符列表里面没有的东西, 如果你不知道,或者想要别的数据集, 你可以问我, 我去找找有没有
|
2, 去改进这个因子或者你还需要用到大概什么数据字段, 你告诉我, 我可以给你
|
||||||
|
3, 不要出现操作符列表里面没有的东西, 如果你不知道,或者想要别的数据集, 你可以问我, 我在数据库中查询有没有
|
||||||
你不需要分析我当前的因子, 我手上有很多数据集, 先不需要帮我写alpha, 优化这个alpha需要用到的数据集, 然后我会在数据库找出需要的数据集给你. 这些大概需要用到的数据集, 所有需要用到的数据集, 用一个python的列表给我, 不要写注释, 我会在本地使用python查数据库然后给你
|
4, 你不需要分析我当前的因子, 我手上有很多数据集, 先不需要帮我写alpha, 优化这个alpha需要用到的数据集, 然后我会在数据库找出需要的数据集给你. 这些大概需要用到的数据集, 所有需要用到的数据集, 用一个python的列表给我, 不要写注释, 我会在本地使用python查数据库然后给你
|
||||||
Reference in New Issue
Block a user