Code Editor Documentation
The data object contains all the data related to your algorithm, including the whole price history of the traded asset, as well as the calculated indicators like the SMA.
For examples, the following piece of code will return the SMA calculated over a 80 day window:
var long_SMA = data.ma(80);
Here are the commands you can use inside the code editor:
Make a market order of the currently traded asset at the time of the context, at the market price.
Close the current position of the currently traded asset, at the market price.