Charts
DataOn-chain
VIP
Market Cap
API
Rankings
CoinOSNew
CoinClaw🦞
Language
  • 简体中文
  • 繁体中文
  • English
Leader in global market data applications, committed to providing valuable information more efficiently.

Features

  • Real-time Data
  • Special Features
  • AI Grid

Services

  • News
  • Open Data(API)
  • Institutional Services

Downloads

  • Desktop
  • Android
  • iOS

Contact Us

  • Chat Room
  • Business Email
  • Official Email
  • Official Verification

Join Community

  • Telegram
  • Twitter
  • Discord

© Copyright 2013-2026. All rights reserved.

简体繁體English
|Legacy

Automated Trading Live Account - Configuration and Trading Functions

CN
AiCoin
Follow
2 years ago
AI summarizes in 5 seconds.
```html

Configuration Function

tradeConfig 

Used to set the configuration for trading, can only be set once

tradeConfig(price, amount, total)
Syntax version required // @version=2 

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

``````html

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

// Set the precision of script output data to 4
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)

enterLong(cond, price, amount)
Syntax version required // @version=2 

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

``````html

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

enterLong(close>open, price="market", amount=1)

 

exitLong

Close long position for futures / sell spot

exitLong(cond, price, amount)
Syntax version required // @version=2 

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

``````html

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

``````html

Return Value

No return value

Example

exitLong(close>open, price="market", amount=1)
 

enterShort

Open a short position for the contract

enterShort(cond, price, amount)
Syntax version required // @version=2 

Type

Trading function

Parameter Description

Name

Type

Description

cond

Boolean data

e.g. close>open, needs to be a boolean series value

``````html

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

enterShort(close>open, price="market", amount=1)

 

exitShort

Close a short position for the contract

exitShort(cond, price, amount)
Syntax version required // @version=2 

Type

Trading function

Parameter Description

Name

Type

Description

cond

Boolean data

e.g. close>open, needs to be a boolean series value

``````html

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

``````html 2px; border-top:1px solid #cbcdd1; border-right:1px solid #cbcdd1; border-left:1px solid #cbcdd1">

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

exitShort(close>open, price="market", amount=1)

 

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

AICoin Automated Live Trading - Handling Common Issues

```

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

持仓五大热币,瓜分 10 万美金
广告
|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

Selected Articles by AiCoin

12 hours ago
At 3 PM, Senior AiCoin will be live: After Wash takes the stage, how will the 2026 crypto bull market go? (Membership giveaway)
16 hours ago
【AiCoin丨5.13 Snapshot: Inflation Rises, Federal Reserve Changes Leadership, Large Investors Short】
1 day ago
At 4 PM, AiCoin editor live stream: 45 minutes to determine buy and sell points (free for members)
View More

Table of Contents

|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

Related Articles

avatar
avatarAiCoin研究院
11 hours ago
45 minutes line find buy sell points
avatar
avatarAiCoin研究院
1 day ago
BOLL Practical Combat | On-Chain K Line Investment Techniques
avatar
avatarAiCoin研究院
6 days ago
Capture key positions, just use chip distribution.
avatar
avatarAiCoin研究院
7 days ago
Fibonacci Take Profit | K-Line Analysis Practical Training
avatar
avatarAiCoin研究院
13 days ago
Doge Carnival Season | New and old friends' commissions temporarily increased to 10%
APP
Windows
Mac

X

Telegram

Facebook

Reddit

CopyLink