Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Technical Analysis using R Software - Quantmod Package - Basics & Candlestick Charts

2,968 views

Published on

Technical analysis in r software basics & candlestick charts using quantmod package

Published in: Data & Analytics
  • Be the first to comment

Technical Analysis using R Software - Quantmod Package - Basics & Candlestick Charts

  1. 1. Technical Analysis using R Software Basics of Technical Analysis & Candlestick Charts Rajesh Prabhakar Kaila http://facultyofbusinessanalytics.blogspot.in/
  2. 2. Introduction to Technical Analysis  Technical analysis is based on a completely different approach compared to Fundamental Analysis ( based on "value" of a company or a commodity) and Technical Analysts also called chartists are more focused on the price movements and volumes of the stock or commodity or currency in the market.  Basically Technical Analysts study the trends, direction of movement of the prices.  Technical Analysts forecast the direction of movement of prices through the study of past market data, primarily price and volume
  3. 3. Technical Analysis – Basic Assumptions  Market Discounts Everything – All the company's or commodity’s or currency’s fundamentals, including broader economic factors and market psychology, are all priced into the stock price movement. technical analysis assumes that, at any given time, a stock's price reflects everything that has or could affect the company.  Price Moves in Trends – Technical Analysts assume price movements follow trends and once a trend has been established, the future price movement will mostly be in the same direction rather than be against it.  History Tends To Repeat Itself – Technical analysts assume history tends to repeat itself in terms of price movement based on the assumption of market psychology that repetitive nature of price movements are based on market participants react consistently to similar market stimuli over time.
  4. 4. Technical Analysis – Candlestick Charts  The candlestick chart can be considered as a type of bar chart, but it differs visually as it is constructed using the Open, High, Low Close prices of the stock or commodity or currency is used to construct it.  The candlestick also has a thin vertical line showing the period's trading range.  The difference comes in the formation of a wide bar on the vertical line, which illustrates the difference between the open and close. Also colors are used to indicate movement.
  5. 5. Technical Analysis – Candlestick Charts  Long white candlesticks indicate that the Bulls controlled the ball (trading) for most of the game. Long black candlesticks indicate that the Bears controlled the ball (trading) for most of the game.  Small candlesticks indicate that neither team could move the ball and prices finished about where they started. A long lower shadow indicates that the Bears controlled the ball for part of the game, but lost control by the end and the Bulls made an impressive comeback.  A long upper shadow indicates that the Bulls controlled the ball for part of the game, but lost control by the end and the Bears made an impressive comeback.  A long upper and lower shadow indicates that the both the Bears and the Bulls had their moments during the game, but neither could put the other away, resulting in a standoff. Source: http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:introduction_to_candlesticks
  6. 6. Candlestick Charts – R Software  Candlestick charts are created in R Software using Quantmod package.  library("quantmod“)  Sample Code  getSymbols("YHOO",src="google") # from google finance [1] "YHOO" > getSymbols("GOOG",src="yahoo") # from yahoo finance [1] "GOOG" > getSymbols("DEXJPUS",src="FRED") # FX rates from FRED [1] "DEXJPUS" > getSymbols("XPT/USD",src="Oanda") # Platinum from Oanda [1] "XPTUSD“  Data Sources  Yahoo! Finance (OHLC data)  Federal Reserve Bank of St. Louis FRED® (11,000 economic series)  Google Finance (OHLC data)  Oanda, The Currency Site (FX and Metals)  MySQL databases (Your local data) Source: http://www.quantmod.com/examples/intro/
  7. 7. R Code for Candlestick charts • For downloading data into R using quantmod package. • getSymbols (explained in earlier slide). This will download data from Yahoo finance in OHLC format • Sample Code getSymbols('INFY.BO',src='yahoo') INFY=INFY.BO['2015-01-01::2015-05-31'] # download from 01/01/2015 till 31/05/2015 chartSeries(INFY)
  8. 8. Infosys Candlestick Chart

×