Configuration Function
tradeConfig
Used to set the configuration for trading, can only be set once
Type
Function
Parameter Description
Name |
Type |
Description |
price |
String |
last: latest price limit order; over: overpriced order, overprice percentage follows PC system settings; queue: queued price; market: market price |
amount |
Number |
Amount to be traded |
Amount
Name |
Type |
The quantity of the order, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting the live trading |
Example
indicator(precision = 4)
Trading Function
enterLong
Open long position for futures / buy spot (you can only declare each type of instruction at most once, repeated declaration will result in compilation error)
Type
Trading Function
Parameter Description
Name |
Type |
Description |
cond |
Boolean |
e.g. close>open, needs to be a boolean series value |
price |
String |
The price at which the order will be placed |
Amount
Name |
Type |
Description |
price |
String |
last: place order at the last price; over: place order at a price higher than the current price, with the percentage following the PC system settings; queue: place order at a specific price; market: place order at market price |
amount |
Numeric |
The quantity of the order, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting the live trading |
Return Value
No return value
Example
exitLong
Close long position for futures / sell spot
Type
Trading Function
Parameter Description
Name |
Type |
Description |
cond |
Boolean |
e.g. close>open, needs to be a boolean series value |
price |
String |
last: place order at the last price; over: place order at a price higher than the current price, with the percentage following the PC system settings; queue: place order at a specific price; market: place order at market price |
amount |
Numeric |
The quantity of the order, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting the live trading |
Type
Name |
Description |
cond |
Boolean data, e.g. close>open, needs to be a boolean series value |
price |
last: place order at the last price; over: place order at a price higher than the current price, with the percentage following the PC system settings; queue: place order at a specific price; market: place order at market price |
amount |
Numeric value, the quantity of the order, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting the live trading |
Return Value
No return value
Example
enterShort
Open a short position for the contract
Type
Trading function
Parameter Description
Name |
Type |
Description |
cond |
Boolean data |
e.g. close>open, needs to be a boolean series value |
price
String
last: limit order at the last price; over: overpriced order, with the overprice percentage following the PC system settings; queue: queue price; market: market order
amount
Number
Order quantity, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting live trading
Return Value
No return value
Example
exitShort
Close a short position for the contract
Type
Trading function
Parameter Description
Name |
Type |
Description |
cond |
Boolean data |
e.g. close>open, needs to be a boolean series value |
Type
Description
cond
Boolean data
e.g. close>open, needs to be a boolean series value
price
String
last: limit order at the last price; over: overpriced order, with the overprice percentage following the PC system settings; queue: queue price; market: market order
amount
Number
Order quantity, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting live trading
Order quantity, the default unit of quantity is consistent with the default unit of the trading variety, and can be changed when starting live trading
Return Value
None
Example
Related Reading:
AICoin Automated Live Trading - Quick Start
AICoin Automated Live Trading - Real-life Example of Signal Alert
AICoin Automated Live Trading - Real-life Example of Indicator Win Rate
AICoin Automated Live Trading - Real-life Example of Custom Indicator
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。