After you have mastered the basic operations of AIScript and created your first script, let's continue to delve deeper into more features of AIScript to enhance your programming skills.
Integration of Backtesting, Alerts, and Live Trading
In AIScript, you can combine backtesting, alerts, and live trading functionalities to create a powerful trading tool. Through the strategy feature, you can backtest on historical data to validate the effectiveness of your trading system.
At the same time, you can set alerts to receive notifications when specific conditions are met.
Finally, with the live trading feature, you can execute verified strategies in the real market. This integrated approach not only enhances trading efficiency but also helps you better manage risks and seize market opportunities.
Script Execution Mechanism
AIScript does not execute once and stop like other programming languages. Instead, it executes sequentially on each K-line of the chart (from left to right). When the script runs on historical K-lines, variables will store the closing price of that K-line. On real-time K-lines, variables return the current price until the K-line closes.
Strategies typically execute only once at the close of the K-line but can be configured to execute on each price update.
Time Series
The core data structure of AIScript is the time series. Each K-line has a value in the time series and expands as more K-lines are processed. Past values can be referenced using historical indices. For example, close[1]
represents the closing price of the previous K-line.
Although this method may seem similar to arrays, time series have their unique characteristics, and understanding these is crucial for mastering AIScript.
Publishing Scripts
Once you are sufficiently familiar with AIScript, you can choose to share your scripts with other users. Before doing so, ensure that your scripts are original and thoroughly tested. All publicly published scripts will undergo review.
If you are using it for personal purposes, you can write directly in the editor and add it to your chart. If you want to share with friends, you can choose to publish it privately.
Browsing AIScript Documentation
Thoroughly reading the AIScript documentation is a key step in mastering this language. The main documentation sources include:
- AIScript User Manual
- AIScript Reference Manual
These documents provide detailed language features and writing guidelines, ensuring you can smoothly write and publish scripts.
Where to Go Next?
Through practice and reading documentation, you can further enhance your AIScript skills. Reviewing example code and trying to modify it is a great way to learn. Remember to experiment boldly; you won't break anything.
Wishing you success in your learning and use of AIScript!
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。