Introduction to signals

Financial Trading in R

Ilya Kipnis

Professional Quantitative Analyst and R programmer

What are signals?

  • Signals are the interactions of:
    • Market data with indicators
    • Indicators with other indicators
  • Examples:
    • 50-day MA crossing over 200-day MA
    • Oscillator crosses under 20
  • Signal is necessary (but not sufficient) for buy/sell order
Financial Trading in R

Using add.signal()

  • Very similar to the process for creating indicators

  • Only a few signal functions

add.signal(strategy.st, name = “function",
           arguments = list(arguments), label = "label")
  • Again, similar to apply family
Financial Trading in R

Four types of signals

  • sigComparison : Relationship between two indicators, returns 1 if relationship is true

  • sigCrossover: Similar to sigComparison, returns 1 on the first occurrence

  • sigThreshold: Compares range-bound indicator to a static quantity

  • sigFormula: Flexible signal function

Financial Trading in R

Examples

Financial Trading in R

Examples

Financial Trading in R

Let's practice!

Financial Trading in R

Preparing Video For Download...