BSE Stock Analysis Presentation

Praveen Kumar P
10th April 2019

BSE Trading Snapshot & Analysis

  1. Select Top 20 scrips from BSE daily bav copy.
  2. List of scrips that have gained / lost (in percentage) .
  3. A heat indicator depicitng green for the +ve stocks with their percentage. Red indicator showing stocks that are trading low.
  4. Pick a scrips “Jubilant FoodWorks Ltd” - Plot a box chart on their OPEN,HIGH,LOW,CLOS

Select Top 20 scrips from BSE daily bav copy.

EQ020419 <- read.csv("C:/Users/prave/OneDrive/bigdata/R/project/bse/EQ020419_CSV/EQ020419.CSV")
E<-data.frame(EQ020419)
View(E)

# Select required coloumns
EN<- subset(E,select =c(SC_NAME,SC_GROUP, CLOSE,PREVCLOSE))
# Find the % performance
Percent<- round(((EN$CLOSE-EN$PREVCLOSE)/EN$PREVCLOSE)*100,2)
# Bind the two datasets
EN1<- data.frame(EN, Percentage = Percent)
EN2<- EN1[order(-EN1$Percentage),]
View(EN2)
# Selecting the top 3 Rows
H<-head(EN2,n=15L)
View(H)
# Selecting the lower 3 rows
T<-tail(EN2,n=15L)
View(T)
EN3<-rbind(H,T)
View(EN3)

Heat Graph showing scrips that have gained / lost (in percentage)

View(T)
EN3<-rbind(H,T)
View(EN3)
library(tidyverse, quietly = TRUE)
EN3 %>% 
  ggplot(aes(strtrim(EN3$SC_NAME ,3), Percentage, fill = Percentage)) +
  geom_point(aes()) +
  scale_colour_gradientn(colours = terrain.colors(10))

plot of chunk unnamed-chunk-2

"Jubilant FoodWorks Ltd" - Box chart Plotting

Plot a box chart on their OPEN,HIGH,LOW,CLOS

            JFL is an Indian company which holds the master franchise for Domino's Pizza in India, Nepal, Sri Lanka and Bangladesh, and also for Dunkin' Donuts in India

Select required coloumns for analysis ========================================================

jubi533155 <- read.csv("C:/Users/prave/OneDrive/bigdata/R/project/bse/jubi533155.csv")
J<-data.frame(jubi533155)
View(J)

# Select required coloumns
JB<- subset(J,select =c(Date,Open.Price,Low.Price,High.Price,Close.Price))
View(JB)
x<-JB
View(x)
# Selecting the top 50 Rows
x<-head(JB,n=20L)
View(x)

Box Plot showing a candlestick pattern

library("ggplot2")
candlestickPlot <- function(x){
# x is a data.frame with columns 'date','open','high','low','close'
x$candleLower <- pmin(x$Open.Price,x$Close.Price)
x$candleUpper <- pmax(x$Open.Price,x$Close.Price)
x$candleMiddle <- (x$candleLower + x$candleUpper)/2
x$fill <- "red"
x$fill[x$Open.Price < x$Close.Price] = "green"
# Draw the candlesticks
g <- ggplot(x, aes(x=Date, lower=candleLower, middle=candleMiddle, upper=candleUpper, ymin=x$Low.Price, ymax=x$High.Price)) 
g <- g + geom_boxplot(stat='identity', aes(group=Date, fill=fill))
g 
}

Final graph