量化交易-彻悟科技

量化交易-彻悟科技


保存规则接口

<p><strong>简要描述:</strong> </p> <ul> <li>保存及更新规则接口</li> </ul> <p><strong>修改点:</strong> 1.规则操作配置增加paramKey和paramName字段 2.规则配置增加resultHandleType(规则处理类型)和decimalDigit(小数位数)字段</p> <p><strong>规则结果处理类型及小数位数字段UI:</strong> 修改四则运算规则及函数规则即可,UI分别为: <img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/37e53867b1874f53acbad8aef9f7a14f" alt="" /> <img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/f23539ce86d7445f60dd4d67e3d7f208" alt="" /></p> <p><strong>请求URL:</strong> </p> <ul> <li>URL:<code>/ruleEngine/ruleconfig/saveRuleInfo</code></li> </ul> <p><strong>请求方式:</strong></p> <ul> <li>POST JSON</li> </ul> <p><strong>请求示例:</strong></p> <pre><code>{ "t": 1610104736348, "ruleConditionGroup": [ { "id": 11107, "ruleId": 2095, "resultHandleType": 0, // 新增字段,结果处理类型,0:无操作,1:四舍五入,2:截取小数 "decimalDigit": -1, // 新增字段,保留小数位数,数值小于零显示为空,其他数值正常显示 "ruleCondition": [ { "id": 32338, "ruleId": 2095, "conditionGroupId": 11107, "varType": 3, "ctable": " ", "tableComment": "", "ccolumn": "buy_position", "columnComment": "[交易指标]买入持仓量", "type": "double", "cvalue": "5579", "ruleIdLeft": 0, "ruleIdLeftName": "", "ruleIdRightName": "", "ruleIdLeftStrategyName": "", "ruleIdRightStrategyName": "", "aliasLeft": "", "aliasRight": "", "formula": "", "varTypeRight": 0, "ctableRight": "", "tableCommentRight": "", "ccolumnRight": "", "columnCommentRight": "", "typeRight": "", "cvalueRight": "", "ruleIdRight": 0, "missResult": "0", "integral": 0, "state": "10", "reqExt": "", "relation": 0, "resultType": "", "result": "", "deleteFlag": 0, "optionselect": [], "optionselectright": [ { "varType": 3, "cvalue": "5579", "cname": "[业务字段] [交易指标]买入持仓量", "type": "double", "sequence": null, "index": 3 } ], "newexpressionData": [ { "name": "&gt;", "value": "&gt;" }, { "name": "&lt;", "value": "&lt;" }, { "name": "=", "value": "=" }, { "name": "!=", "value": "!=" }, { "name": "&gt;=", "value": "&gt;=" }, { "name": "&lt;=", "value": "&lt;=" }, { "name": "&lt;=and&lt;=", "value": "&lt;=and&lt;=" }, { "name": "&lt;=and&lt;", "value": "&lt;=and&lt;" }, { "name": "&lt;and&lt;=", "value": "&lt;and&lt;=" }, { "name": "&lt;and&lt;", "value": "&lt;and&lt;" } ], "varLeftSelect": "2", "varRightIndex": 3, "name": "[业务字段] [交易指标]买入持仓量" } ], "relation": 0, "state": "10", "formula": "single_value", "missScore": 0, "deleteFlag": 0 } ], "ruleEngineDecisionInfo": [], "ruleOperateInfo": [ // 操作配置 { "type": 0, // 操作类别[0:修改,1:新增,11:发送模型结果消息,12:发送交易下单消息] "insertType": "", // 废弃字段:插入类型[quota:额度结果插入] "fieldId": "160", // 废弃字段:操作变量字段ID "varTypeLeft": 6, // 新增字段:左变量类型[1:常量,2:环境数据,3:业务数据,4:用户数据,5:场景数据,6:规则结果] "cvalueLeft": "2079", // 新增字段:左变量结果值(常量值/规则ID) "varTypeRight": 6, // 右变量类型[1:常量,2:环境数据,3:业务数据,4:用户数据,5:场景数据,6:规则结果] "cvalueRight": "2079", // 右变量结果值(常量值/规则ID) "paramKey": "2", // 新增字段,接口参数Key "paramName": "参数名称" // 新增字段,接口参数名称 } ], "strategy": null, "childRuleConfigList": [], "id": 2095, "name": "测试规则", "type": "60", "strategyId": 114, "ruleLogId": 4260, "ratio": 0, "ratioDayCount": 0, "ruleCode": "", "isDecision": 0, "hitType": "0", "hitResult": "0", "parentOptType": "", // 父规则执行结果触发条件[10:通过,20:人审,30:拒绝,40:待定] "elseType": 1, // 子规则类型,0:默认普通规则,1:else规则,2:else if规则 "configCount": 1, "sequence": 0, "reqExt": "", "state": "10", "deleteFlag": 0 }</code></pre> <p><strong>返回示例</strong></p> <pre><code>{ "msg":"success", "code":0 } </code></pre> <p><strong>返回参数说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">code</td> <td style="text-align: left;">int</td> <td>状态码,0成功,其它失败</td> </tr> <tr> <td style="text-align: left;">msg</td> <td style="text-align: left;">string</td> <td>消息</td> </tr> </tbody> </table>

页面列表

ITEM_HTML