- Clear Log
It is used to clear logs. Some logs can be retained according to the input parameters.
As in the API document:
LogReset()
- Clear return log
It is used to clear the return log. Some logs can be retained according to the input parameters.
As in the API document:
LogProfitReset()
The next are some frequently used tool modules
- Function module for obtaining a certain attribute of the market
This tool module needs to be used together with the quotation module in the "Transaction Module Type", as shown in the figure:
Use the output information module to output the latest transaction price of the latest ticker market:
Backtesting display:
Like JavaScript strategy code:
function main () {
Log(exchange.GetTicker().Last)
}
- The module that obtains the attribute of a bar of K-line data
This module also needs to be used together with the K-line data acquisition module in the "Transaction Module Type".
First, we create a variable module named K-line.
Then we obtain the K-line data, use the K-line data module to obtain it, and assign the value to the variable module: "K-line".
Then we use the list length module in the "List Module Type" to obtain the length of the K-line variable module, which is used to specify which bar on the K-line to obtain the data.
Splice them together, as shown in the figure:
The timestamp of the last K-line bar is printed when the backtest runs.
- The module that obtains the data of an order in the order book
It also needs to be used together with the "Get Depth Data module" in the "Transaction Module Type".
The index is set to 0 and the selling order is set to obtain the information of the selling one order.
Like JavaScript strategy code:
function main () {
Log(exchange.GetDepth().Asks[0])
}
To be continued...