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

in fmz •  last year 
  1. Module for obtaining an attribute in asset information

53.png

This module needs to be used together with the module of obtaining asset information.

54.png

For example: print the available currency of the current account

55.png

Backtesting display:

56.png

Like JavaScript strategy code:

function main () {
    Log(exchange.GetAccount().Stocks)
}
  1. Module for obtaining an attribute in order data

57.png

This module is used to obtain the value of an attribute in the order data, such as the price or quantity of selling one in the order book (example of No.13).

58.png

Backtesting results:

59.png

Like JavaScript strategy code:

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

It can also be used to obtain an attribute in the order information returned by the "Query Order Details Module" (to be explained in the advanced chapter).

  1. The module to obtain the attributes of a position in the position information

60.png

Similarly, it should be used together with the "Get Futures Position Module". Note that the position data returned by the "Get Futures Position Module" is an array (list) that contains positions in different contracts and directions. Therefore, the index should be specified when using.
Having learned so much, let's combine a hedging operation, that is, hedging both short-term and forward contracts.

We make a positive arbitrage hedge, that is, open a short position contract for the forward contract, and open a long position contract for the recent contract.

61.png

Backtesting results:

62.png

Examples of visualization strategies:

https://www.fmz.com/strategy/121404
https://www.fmz.com/strategy/129895
https://www.fmz.com/strategy/123904
https://www.fmz.com/strategy/122318
For more strategies, please refer to: https://www.fmz.com/square

Other articles in this series

-Visualization Module to Build Trading Strategies - In-depth (https://www.fmz.com/digest-topic/9509)
-Visualization Module to Build Trading Strategy - Advanced Understanding (https://www.fmz.com/bbs-topic/9815)

The boring programming can be easily completed by building blocks. It's very interesting to try!

From: https://blog.mathquant.com/2022/12/12/visualization-module-to-build-trading-strategy-first-acquaintance.html

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!