Assignment | Mastock Help

Short Name: =

Definition: Assignment operator

Usage: variable = expression

  • Compute the expression on the right side of the equal sign.
  • Define a new variable with the name equal to the text on the left side of the equal sign.
  • Store the result in the new variable.
  • Use variables extensively. Anytime you use the same function twice, a variable is preferable. This will speed up the program, by preventing a dual calculation. A variable is just a piece of memory that can be read over and over. A function will trigger a calculation.

  • Expression on the right can be a scalar value or an array or a series of operation or logic tests.
  • You cannot redefine the same variable twice.

  • dummy = 14
  • dummy = rsi(14)
  • dummy = macd(12,26,9) > macdAvg(12,26,9)
  • dummy = (high + low + close) / 3