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 Real Trading - Get Started Quickly

CN
信息测试
Follow
8 years ago
AI summarizes in 5 seconds.
```html

Overview

AICoin has launched the automated live trading feature, allowing users to define trading instructions through AICoin Script and execute live trades automatically. Click to join the community and discuss automated trading with more friends!

Usage Tutorial

 

Live Trading Example

// This indicator is created by AICOIN Research Institute. If you encounter any usage issues, you can join the indicator community for consultation
// @version=2

// Convert date to comparable time
t1 = parse_time("2023-11-01 22:42:00")
t2 = parse_time("2023-11-01 22:43:00")
t3 = parse_time("2023-11-01 22:44:00")
t4 = parse_time("2023-11-01 22:45:00")

// Define conditions
s1 = time == t1
s2 = time == t2
s3 = time == t3
s4 = time == t4

// Define trading instructions
// Open long position / spot buy
enterLong(s1, price='market', amount=1)
// Close long position / spot sell
exitLong(s2, price='market', amount=1)
// Open short position
enterShort(s3, price='market', amount=1)
// Close short position
exitShort(s4, price='market', amount=1)

// Plot closing price on chart
plot(close, title="Closing Price")

For more examples, please click the links below:

    Automated Live Trading - Live Example of Signal Alert

    Automated Live Trading - Live Example of Indicator Win Rate

    Automated Live Trading - Live Example of Custom Indicator

1 Trading Function Explanation

1.1 Global Trading Configuration

// Declare strategy configuration, define relevant parameters. See the strategy configuration field declaration below for specific supported parameters
tradeConfig(price="market", amount=1)

Parameter Explanation

``````html 2 Trading Function Explanation

2.1 Global Trading Configuration

// Declare strategy configuration, define relevant parameters. See the strategy configuration field declaration below for specific supported parameters
tradeConfig(price="market", amount=1)

Parameter Explanation

Parameter

Explanation

price

last: limit order at the latest price; over: overpriced order, with the overprice percentage following the PC system settings; queue: queued price; market: market order

Parameter

Explanation

price

last: limit order at the latest price; over: overpriced order, with the overprice percentage following the PC system settings; queue: queued price; market: market order

amount

Order quantity, default unit is consistent with the default unit of the trading variety, can be changed when starting live trading

2.2 Spot Contract Trading Configuration

Open Long Position / Spot Buy

enterLong(condition, price="market", amount=1)

Close Long Position / Spot Sell

exitLong(condition, price="market", amount=1)

Open Short Position

enterShort(condition, price="market", amount=1)

Close Short Position

exitShort(condition, price="market", amount=1)

Parameter Explanation

Parameter

Explanation

condition

Boolean, specifies the condition under which the trade is executed

Note: The parameters price/amount have the same meaning as the global trading configuration. If these parameters are declared in the global configuration, they can be omitted in this function and will default to the global trading configuration

2 Function Usage Explanation

2.1 Specified Execution Order

Trading instructions will be executed in the order defined in the script. Please pay attention to the order of instructions. Additionally, please note that the execution order of instructions only guarantees the order of placing orders. The order of execution is influenced by the delegation method and the exchange's matching engine behavior. If you encounter issues with order execution, you can contact customer service for assistance.

// The following format will first execute the close long position instruction, then execute the open long position instruction
exitLong(dead_cross)
enterLong(golden_cross)

// If written in this format, it will first execute the open long position instruction, then execute the close long position instruction
enterLong(golden_cross)
exitLong(dead_cross)

 

2.2 Instruction Quantity

You can only declare each type of instruction once. Repeated declaration of instructions will result in compilation errors

// The following format will result in a compilation error
enterLong(a)
enterLong(b)

 

2.3 Conditional Expression

The condition parameter in the trading functions is a boolean type, and the trade will only be executed when the condition is true

For more details and examples, please refer to the official documentation or contact customer service for assistance.

```3 Instruction Quantity Unit

As you can see, the quantity parameter `amount` of the instruction does not specify the unit. The actual unit of quantity when placing an order is determined by the unit selected on the live trading page. You can always check the setting of this unit in the live trading details.

Automated Live Trading - Quick Start_aicoin_Figure 1

 

2.4 Allowing Multiple Entries

Specifies whether the entry instruction is allowed to trigger multiple orders before the corresponding exit instruction appears; if unchecked, the entry instruction is not allowed to continuously trigger orders, and consecutive entry instructions will not trigger orders; if checked, multiple entry instructions are allowed to trigger orders, and the number of times is determined by the configuration of multiple entries

For example:

Assuming the signal list to be triggered is as follows

Not checked for multiple entries Checked for multiple entries, with a count of 2 Checked for multiple entries, with a count of 3

enterLong

Triggers order Triggers order Triggers order

enterLong

Does not trigger Triggers order Triggers order

enterLong

Does not trigger Does not trigger Triggers order

Does not trigger

Does not trigger Triggers order

exitLong

Triggers order Triggers order Triggers order

enterLong

Triggers order Triggers order Triggers order

Additionally, only the corresponding exit instruction can reset the status of the corresponding entry instruction. The exit instruction for enterLong is exitLong, and the exit instruction for enterShort is exitShort. See another example below:

Assuming the signal list to be triggered is as follows

Not checked for multiple entries Checked for multiple entries, with a count of 2 Checked for multiple entries, with a count of 3

enterLong

Triggers order Triggers order Triggers order
```html

Triggers order

Triggers order Triggers order

enterLong

Does not trigger Triggers order Triggers order

enterLong

Does not trigger Does not trigger Triggers order

exitLong

Triggers order Triggers order Triggers order

enterLong

Does not trigger Does not trigger Triggers order

Additionally, only the corresponding exit instruction can reset the status of the corresponding entry instruction. The exit instruction for enterLong is exitLong, and the exit instruction for enterShort is exitShort. See another example below:

Assuming the signal list to be triggered is as follows

Not checked for multiple entries Checked for multiple entries, with a count of 2 Checked for multiple entries, with a count of 3

enterLong

Triggers order Triggers order Triggers order
``````html

Does not trigger

Does not trigger

 

2.5 Profit Calculation

Profit-related data is based on historical transaction information for statistical purposes. Funding fees and special cases of transaction fees (such as fee deductions) are temporarily not included in the statistics, so there may be some errors. It is for reference only. We recommend that you enable the asset statistics feature to view the overall profit analysis of your account. Learn more about the asset statistics feature.
In addition, there are two points to note: first, you need to ensure that the PC end is running normally in order to correctly calculate the profit; second, manual closing of positions may cause abnormal statistics of profit-related data.

 

Related Reading:

AICoin Automated Live Trading - Real-life Example of Signal Alerts

AICoin Automated Live Trading - Real-life Example of Win Rate Indicators

AICoin Automated Live Trading - Real-life Example of Custom Indicators

AICoin Automated Live Trading - Handling Common Issues

 

 

```

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

极度恐慌别慌!注册币安领600 USDT,10%低费抄底!
广告
|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

Selected Articles by 信息测试

3 months ago
The Federal Reserve's major proposal for payment accounts impacts the cryptocurrency financial industry!
3 months ago
The Hong Kong Insurance Authority has suddenly introduced new regulations to guide investment in crypto assets!
3 months ago
Whales return to the market with massive liquidations, a frenzy!
View More

Table of Contents

|
|
APP
Windows
Mac
Share To

X

Telegram

Facebook

Reddit

CopyLink

Related Articles

avatar
avatar智者解密
20 minutes ago
Faster and cheaper finance, why must it win?
avatar
avatar链捕手
1 hour ago
Zhou Hang, the founder of Yidao Yongche: Cryptocurrency has finally reached the moment it should debut.
avatar
avatar智者解密
1 hour ago
Eighty Percent of Interactions Involved Robots: X's Cryptographic Noise Crisis
avatar
avatar智者解密
3 hours ago
Iran Sets Its Sights on the Mandeb Strait: A New Lightning Strike for Global Inflation?
avatar
avatar智者解密
5 hours ago
Fire and Oil on the Hormuz: The US-Iran Standoff Weighs on Global Energy
APP
Windows
Mac

X

Telegram

Facebook

Reddit

CopyLink