diff --git a/BlackSholes.R b/BlackSholes.R index 2628162..7f787cd 100644 --- a/BlackSholes.R +++ b/BlackSholes.R @@ -1,4 +1,4 @@ -## Black-Scholes Function +## Program for Black-Scholes Function BS <- function(S, K, T, r, sig, type="C"){ d1 <- (log(S/K) + (r + sig^2/2)*T) / (sig*sqrt(T)) d2 <- d1 - sig*sqrt(T) @@ -12,7 +12,8 @@ BS <- function(S, K, T, r, sig, type="C"){ } -## Function to find BS Implied Vol using Bisection Method +## This is a function to find BS Implied Vol using Bisection Method +## Feel free to fork this and add your own changes! implied.vol <- function(S, K, T, r, market, type){ sig <- 0.20 @@ -41,3 +42,4 @@ implied.vol <- return(sig) } } + diff --git a/FOSS.R b/FOSS.R index 4939bcc..9a55dca 100644 --- a/FOSS.R +++ b/FOSS.R @@ -33,7 +33,7 @@ initPortf("faber", symbols=symbols, initDate=initDate) initAcct("faber", portfolios="faber", initDate=initDate, initEq=initEq) initOrders(portfolio="faber", initDate=initDate) -# Initialize a strategy object +# Initialising a strategy object stratFaber <- strategy("faber") # Add the 10-month SMA indicator diff --git a/README b/README index f833e44..8569f6c 100644 --- a/README +++ b/README @@ -1 +1,8 @@ These are just some R scripts that I've found useful for school or just saw them online as snippets and wanted to see how they work. + +I have put them on my github for you guys to refer to if you get stuck in R programming related issues. + +Feel free to fork and add things of your own and if i find them useful i might merge them as well:) + +LOVE YOU! +(MY IMAGINARY GIRLFRIEND;) diff --git a/capm.R b/capm.R index 0cd1151..eda929d 100644 --- a/capm.R +++ b/capm.R @@ -1,4 +1,5 @@ #Uncomment this to install the quantmod package for the first time +#did you uncomment?? #install.packages("quantmod") #Load required libraries diff --git a/twitter.R b/twitter.R index def92dc..22d0fe5 100644 --- a/twitter.R +++ b/twitter.R @@ -131,7 +131,7 @@ twitterMap <- function(userName,userLocation=NULL,fileName="twitterMap.pdf",nMax followingLL = followingLL[!is.na(followingLL[,1]),] followersLL = followersLL[!is.na(followersLL[,1]),] - +#twitter cat("Plotting results.\n") # Set up the colors cols = brewer.pal(7,"Set2")