Visualization Module to Build Trading Strategy - First Acquaintance (2)

in fmz •  last year 
  1. Clear Log

38.png

It is used to clear logs. Some logs can be retained according to the input parameters.
As in the API document:

LogReset()
  1. Clear return log

39.png

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

  1. Function module for obtaining a certain attribute of the market

40.png

This tool module needs to be used together with the quotation module in the "Transaction Module Type", as shown in the figure:

41.png

Use the output information module to output the latest transaction price of the latest ticker market:

42.png

Backtesting display:

43.png

Like JavaScript strategy code:

function main () {
    Log(exchange.GetTicker().Last)
}
  1. The module that obtains the attribute of a bar of K-line data

44.png

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.

45.png

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".

46.png

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.

47.png

Splice them together, as shown in the figure:

48.png

The timestamp of the last K-line bar is printed when the backtest runs.

49.png

  1. The module that obtains the data of an order in the order book

50.png

It also needs to be used together with the "Get Depth Data module" in the "Transaction Module Type".

51.png

The index is set to 0 and the selling order is set to obtain the information of the selling one order.

52.png

Like JavaScript strategy code:

function main () {
    Log(exchange.GetDepth().Asks[0])
}

To be continued...

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!