R language is a statistical language, mainly used in mathematical modeling, statistical calculation, data processing, visualization and other directions, R language is inherently different from other programming languages. The R language encapsulates the computational functions of a variety of basic disciplines, and we only need to invoke these computational functions in the programming of the R language to build a complex mathematical model for different fields and businesses.
First, the role
1. The purpose of the TTR package is to construct the functions of technical analysis and other technical trading rules in R. TTR can be found in Cran, the current version number is 0.22 (update 2013-3-18).
TTR Current function is to provide some common technical analysis indicators of the function, can be divided into the following categories:
Moving average
Trend detection and strength
Oscillator Index
Volatility Index Volume analysis
Reference: Building R-based trading Systems (3) TTR,http://site.douban.com/182577/widget/notes/10568316/note/299629860/
2. Functions commonly used in TTR
The SMA () function in the R's "TTR" package can smooth the time series data with a simple moving average.
Reference:R language Time series analysis , http://wenku.baidu.com/link?url=ejwsbRrNbml8CDJc29EtpUv5HSPet9YjzecO_ Cfvhoozlhrys9c40nl3kzwwmz7ku4pna4qzblrxwwqsl7ssfjah9q90f7pllmeelzl41wa
Second, installation
Installation is actually very simple, a total of three steps. The first step: set the mirror site of the download package; The second step: Select the Cran Warehouse; step three: Find the TTR package in alphabetical order, click OK, wait a moment, download, install complete.
1, set the download package mirror site, the general choice of China (Hefei). May have a site in China University of Science and technology, other sites have not tried. Menu: Set Cran image with package.
2, select the Cran warehouse and extension library, the default is selected.
3, find TTR package point determination, its automatic completion of the download and installation of the package.
If there is no error, then the TTR package is installed. You can use the command:
Library ("TTR")
Load the TTR package.
Installation of the R language TTR package