anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.15k stars 557 forks source link

Add Tweezer Top & Tweezer Bottom #146

Closed marcus-n3rd closed 6 years ago

marcus-n3rd commented 6 years ago

Changes Made

Indicator Logic

Tweezer Top

Tweezer Top

  1. Upward trend is determined from the first three days of closing data (indexes 0, 1, and 2)
    1. AverageGain and AverageLoss are used to extract the respective values from the subset
    2. If gains are greater than losses, then upward trend is true
  2. The high for both the fourth and fifth day's data are equal

Tweezer Bottom

Tweezer Bottom

  1. Downward trend is determined from the first three days of closing data (indexes 0, 1, and 2)
    1. AverageGain and AverageLoss are used to extract the respective values from the subset
    2. If losses are greater than gains, then downward trend is true
  2. The low for both the fourth and fifth day's data are equal