Code Editor Documentation
On this page, you will find the basic commands & functions that you can use in the code editor. The code itself that is executed by TradeEngine is based on Javascript, so you can use any Javascript function in your code.
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:
marketOrder(parameters)
Make a market order of the currently traded asset at the time of the context, at the market price.
Parameters:
closePosition(parameters)
Close the current position of the currently traded asset, at the market price.
Parameters: