MyLanguage basic grammar and instruction description (Part 4/4)

Preview:

Example 2:

CROSSUP(C,MA(C,5)),BK('A',MONEY0.5/(CMARGIN*D));

Goup A buying long instructions, the closing price up cross the 5-period moving average line, according to the theoretical available 50% of funds to buy long

Application in the stock model

Application in filtering model

  • 1. The instruction does not specify the number of trading lots, and the number of buying lots are fixed number sets.

Example:

CLOSE>MA(CLOSE,500),BK;

The closing price is greater than the opening price, buy long, the buying lots are the fixed quantity sets.

2. The instruction specifies the corresponding group, does not specify the number of lots, and the number of buying lots are fixed number sets.

Example:

CROSSUP(C,MA(C,5)), BK('A');

Group A buy long instruction, the closing price up cross the 5-period moving average line, buy long, and the number of buying lots are fixed number sets.

Application in non-filtering model

  • 1. The instruction specifies the number of trading lots, and the number of buying lots are fixed quantity sets.

a.The number of brackets in the back of a.BK is the number of buying long lots, which can be any positive integer.

b.After specifying the number of lots, the set amount is invalid.

Example:

CLOSE>MA(CLOSE,5),BK(500);

closing price is greater than 5 cycle moving average line, buy 500 shares. The number set is invalid

  • 2. the instruction specifies the number of trading lots, the number of buying lots are variables

a.The calculation formula in parentheses after a.BK can be arbitrarily written, and the calculation result is the number of buying lots.

b.The decimal number is based on the principle of rounding down.

c.After specifying the number of trading lots, the number set is invalid.

Example:

CLOSE>MA(CLOSE,5),BK(MONEY0.5/(C+0.5FEE));

The closing price is greater than the 5-period moving average line and is 50% of the theoretical available funds to buy long.

  • 3.The instruction specifies the corresponding group and specifies the number of trading lots.

a.In the following example 1, the "100" position in the brackets after BK is the number of buying lots.

b.The buying long lots is a fixed quantity or variable.

c.If the lots to be brought long is a variable and the result contains a decimal number, the decimal number is rounded down.

d.After specifying the number of trading lots, the set amount is invalid.

Example 1:

CROSSUP(C,MA(C,5)),BK('A',100);

Group A buy long instruction, the closing price up cross the 5-period moving average line, the number of buying share is a fixed number, 100 shares

Example 2:

CROSSUP(C,MA(C,5)),BK('A', MONEY * 0.5 / (C + 0.5 * FEE));

Group A buy long instruction, the closing price up cross the 5-period moving average line, the number of buying lots are the variables, open the long position according to the theoretical available funds of 50%.

Add a Comment

Your email address will not be published. Required fields are marked *