Getting Started
Platform Basics
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations
init()
init() is the initialization function implemented by the user. When a strategy starts running, the init() function is automatically executed first to complete the initialization tasks designed within the strategy.
Examples
javascript
function main(){
Log("First line of code executed!", "#FF0000")
Log("Exiting!")
}
// Initialization function
function init(){
Log("Initializing!")
}
python
def main():
Log("First line of code executed!", "#FF0000")
Log("Exiting!")
def init():
Log("Initializing!")
rust
fn main() {
Log!("First line of code executed!", "#FF0000");
Log!("Exiting!");
}
// Initialization function
fn init() {
Log!("Initializing!");
}