Helper macros
setf (int Mode, int Flag)
Macro that sets a Flag or flag combination in the variable
Mode. For
instance, setf(TradeMode,TR_PHANTOM) sets the TR_PHANTOM
flag for the TradeMode variable.
resf (int Mode, int Flag)
Macro that resets a Flag or flag combination in the variable
Mode.
isf (int Mode, int Flag): int
Macro that evaluates to nonzero when the a Flag in the Mode
variable is set. For instance, if(isf(TrainMode,PEAK))
... checks if the PEAK flag is set in the
TrainMode variable.
swap (var a, var b)
Macro that sets a to b and b
to a.Remarks
- setf(a,b) is equivalent to a |= b; and
resf(a,b) is equivalent to a &= ~b.
- The difference of setf(Mode,Flag) and Mode =
Flag
is that the latter resets all other flags in Mode.
- After if, use winged brackets for swap,
f.i. if(some_condition) { swap(A,B); }.
- The macros are defined in variables.h.
Example:
function run()
{
setf(TrainMode,PEAK);
setf(Detrend,SHUFFLE);
...
}
See also:
set, PlotMode,
TrainMode, TradeMode
► latest version online