Creating macros: Expanding the language
Instead of doing something repeatedly, make a macro and have the language do it for you.
For example, if you frequently look at the midrange of daily prices, making a macro can save you considerable time:
Click on the Macro Wizard
and you will be presented with a template:

Select “Create New Macro”
and enter the definition of your macro in the edit box. In this example the definition is quite simple, and can easily be done on one line. Just type: ((hi #R) + (lo #R))/2.
That is, take the high of “#R”, add it to the low of “#R” and divide the sum by 2. “#R” is a placeholder for what is to the right of the macro name. It is also referred to as the “right argument” of the macro. If your macro name is “midrange” and you enter “midrange djia”, then #R is obviously djia.
Next click on
and you will be asked for the name of your macro.
Macros can be as detailed as you want to make them. Your macro definition may use other macros, and can even plot a dataset with a particular plottype. If your macro definition is too long or complicated to fit on one line, then break it up into several lines, with each line being defined as a local variable. For example:
C: close #R
H: high #R
L: low #R
V: vol #R
A: ((C-L)-(H-C))
cumsum (A*V)/(H-L)
This is the generally-accepted definition for ACCDIS (accumulation/distribution). In the above code, each line defines a local variable (used only inside the macro) and the last line puts it all together. If you want to add comments for yourself, just add them on any line after the “@” character. The @ designates all subsequent text on that line as not to be executed.