Function Related Description
Below is an example of the call statement for the win rate data of the indicator
Parameter Description
Parameter |
Description |
"win:bitcoin:win_win_one" |
Identifier of the win rate strategy, different strategy identifiers have different values, see specific examples of strategies below |
"" |
Fixed value "" |
signal |
Fixed value for signal |
Explanation of the values of the return value ws
Value |
Description |
0 |
Long position in contract strategy / Buy in spot strategy |
1 |
Close long position in contract strategy / Sell in spot strategy |
2 |
Short position in contract strategy / Not applicable in spot strategy |
3 |
Close short position in contract strategy / Not applicable in spot strategy |
Note: GONGYING system is a spot strategy; ZHISHENG series is a contract strategy
Additionally, the return value ws has a special nature. It is a one-time variable, meaning that when a signal is generated, it triggers a script execution once, and then the value of the variable will be reset. This means that if you use the return value ws for other calculations, unexpected situations may occur, as shown in the following script: ```html // @version=2 ws = security("win:bitcoin:win_win_one", "", signal) lentry = ws == 0 alertcondition(lentry, title="BTC GONGYING 1 Buy") ``` If you add this script as an alert and set it to trigger once at the close of a candle, it is very likely that this alert will not be triggered. As mentioned above, because ws is a one-time variable, the indicator win rate is most likely triggered during the generation of the candle, and after the trigger, the ws variable will be reset. By the time the candle closes, the ws variable will be "nan". **If you do not understand or have any questions about the above content, please consult customer service before trading to confirm that the system behavior meets your expectations, in order to ensure that you do not incur unexpected losses.** --- **BTC Win Rate Strategy** The following script is for demonstration purposes only and does not constitute investment advice. Please invest cautiously and manage risks carefully. **Example (GONGYING 1)** ```html // @version=2 ws = security("win:bitcoin:win_win_one", "", signal) lentry = ws == 0 lexit = ws == 1 // Execute trading instructions // Spot sell exitLong(lexit, price="market", amount=1) // Spot buy enterLong(lentry, price="market", amount=1) ``` **GONGYING 1** ```html ws = security("win:bitcoin:win_win_one", "", signal) ``` **GONGYING 2** ```html ws = security("win:bitcoin:win_win_two", "", signal) ``` **GONGYING 3** ```html ws = security("win:bitcoin:win_win_three", "", signal) ``` **ZHISHENG 1** ```html ws = security("win:bitcoin:ai_win_one", "", signal) ``` **ZHISHENG 2** ```html ws = security("win:bitcoin:ai_win_two", "", signal) ``` **ZHISHENG 3** ```html ws = security("win:bitcoin:ai_win_three", "", signal) ``` --- **ETH Win Rate Strategy** The following script is for demonstration purposes only and does not constitute investment advice. Please invest cautiously and manage risks carefully. **Example (ZHISHENG 3)** ```html // @version=2 ws = security("win:ethereum:ai_win_three", "", signal) lentry = ws == 0 lexit = ws == 1 sentry = ws == 2 sexit = ws == 3 // Execute trading instructions // Close long position in contract / Spot sell exitLong(lexit, price="market", amount=1) // Close short position in contract exitShort(sexit, price="market", amount=1) // Open long position in contract / Spot buy enterLong(lentry, price="market", amount=1) // Open short position in contract enterShort(sentry, price="market", amount=1) ``` **GONGYING 1** ```html ws = security("win:ethereum:win_win_one", "", signal) ``` **GONGYING 2** ```html ws = security("win:ethereum:win_win_two", "", signal) ``` **GONGYING 3** ```html ws = security("win:ethereum:win_win_three", "", signal) ``` **ZHISHENG 1** ```html ws = security("win:ethereum:ai_win_one", "", signal) ``` **ZHISHENG 2** ```html ws = security("win:ethereum:ai_win_two", "", signal) ``` **ZHISHENG 3** ```html ws = security("win:ethereum:ai_win_three", "", signal) ``` **Related Reading:** [AICoin Automated Real Trading - Quick Start](https://www.aicoin.app/article/373213.html) [AICoin Automated Real Trading - Real Trading Signal Alert Examples](https://www.aicoin.app/article/373214.html) [AICoin Automated Real Trading - Real Trading Examples of Custom Indicators](https://www.aicoin.app/article/373217.html) [AICoin Automated Real Trading - Handling Common Issues](https://www.aicoin.app/article/373218.html)
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。