-
Notifications
You must be signed in to change notification settings - Fork 2
/
3_RunAnalysis.R
43 lines (34 loc) · 1.16 KB
/
3_RunAnalysis.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
### Stock Analysis
setwd("~/GitHub/quantstuff")
library(quantmod)
source(file="2_QuantFunctions.R")
######################################################################################
############# SCAN ALL STOCKS ########################################################
scanned <- scanner(stocklist)
write.csv(scanned,"TodaysPicks.csv")
##### how to include today's current values as part of the scan?
############# GET STOCK DETAILS ########################################################
mySymbol <- "PAYX"
days <- 90
myStock <- eval(parse(text=mySymbol))
#tail(myStock)
#last(PAYX,10)
#chart_Series(last(PAYX,10))
############# CHART THE SELECTED STOCK ########################################################
getChart(mySymbol,days,myStock)
#addEMA(n=5)
addSMA(n=50)
addSMA(n=100)
addRSI()
addBBands()
addMACD(50,100,50)
addGuppy()
addTA(Vo(myStock) * Cl(myStock), legend="Dollars Traded")
#AAPL.OPT <- getOptionChain("AAPL")
#needs work: addPoints(Cl(last(myStock,days)),pch=25,col='red',offset=1.03)
#
# addTA(thisStock$BBand_pctB)
# addTA(thisStock$PPO)
#addATR()
#addMomentum()
#tail((EMA(Cl(stockData), n=3) - EMA(Cl(stockData), n=30))/EMA(Cl(stockData), n=30), n=30)