Script: CrossBelow | Mastock Help



Short Name: CrossBelow

Definition: Returns an array of values representing index of the days where curve1 crosses below curve2 or a specific level

Usage: CrossBelow(curve1,curve2) or CrossBelow(curve1,level)

Objective:
  • This instruction is used when defining triggers, to signal a buy or sell day
  • Returns an array of days.

Note:
  • The parameters can either be arrays representing a curve, or a value representing a level

Examples:
  • crossBelow(rsi(14),50) returns an array of days when RSI crosses below 50
  • crossBelow(macd(12,26,9),macdAvg(12,26,9)) returns an array of days when macd crosses below its average
  • cross MACD:
  • premier = macd(12,26,9)
  • deuxieme = macdavg(12,26,9)
  • buy = crossabove(premier,deuxieme)
  • sell = crossbelow(premier,deuxieme)
  • notifyresult(buy,sell)