Abbreviated notation
In the abbreviated MM-Talk notation, the parameters of a function are expressed by other functions. This allows you to considerably shorten even long formulas by cleverly nesting them.
In the Create macros section, a formula was developed that provides a time series of all prices that have risen over n periods in the observation period.
$Zeitreihe:=Object;
$ZeitreiheVorN:=$Zeitreihe.Before[$N];
$Gestiegen:=$Zeitreihe>$ZeitreiheVorN;
$Gestiegen.Count[$Zeitraum]
With the shortened MM-Talk notation, the same formula can be written in a single line:
- A time series that is to be compared with another time series is expected as the input object. The corresponding function is"Greater[]".
The argument of the"Greater[]" function is the time series shifted into the past; this isdescribedwith the"Before[]"function. The argument of the"Before[]" function is the period by which the time series is shifted, i.e. n periods. So the formula is:
CODEGreater[Before[$N]]
This formula corresponds to the first two lines of the original formula.
- The number of cases in which this functionassumesthe Boolean value "True"must now be read out. This is done in the same way as in the original formula with the"Count[]"function.
Only the cases that fall within the"$period" observation period are to be taken into account; this is defined with the argument of the"Count[]" function:
CODECount[$Zeitraum]
This function is applied to the function defined in step 2:
CODEGreater[Before[$N]].Count[Zeitraum]
Although this function is much shorter, its result is identical to that of the original four-line formula.