Indicators

Pivot Points


Description

A pivot point is a technical analysis indicator, or calculations, used to determine the overall trend of the market over different time frames. The pivot point itself is simply the average of the intraday high and low, and the closing price from the previous trading day. On the subsequent day, trading above the pivot point is thought to indicate ongoing bullish sentiment, while trading below the pivot point indicates bearish sentiment.

The pivot point is the basis for the indicator, but it also includes other support and resistance levels that are projected based on the pivot point calculation. All these levels help traders see where the price could experience support or resistance. Similarly, if the price moves through these levels it lets the trader know the price is trending in that direction.

For more information, please visit Investopedia.


Params & Instance Methods

#initialize
@param series [Array] An array of high, low, and closing prices for a single period

#call
@return [Array] An array containing the current S3, S2, S1, pivot, R1, R2, and R3 values

#valid?
@return [Boolean] Whether or not the object is valid

Example

require 'ruby-technical-analysis'

series = [176.65, 152, 165.12]

pivot_points = 
  RubyTechnicalAnalysis::PivotPoints.new(
    series: series
  )

p pivot_points.valid? # true

p pivot_points.call # [127.88, 139.94, 152.53, 164.59, 177.18, 189.24, 201.83]
Previous
Mass Index