#Tech and Communication- IBM, AAPL, RTX, NFLX, ANET, SMCI
#Other: GE, KO, BA
#Retail and Consumer Cyclical: LULU, GPS, SBUX, WMT, AMZN, BBY, COST
#ETFS: QQQ, XLE, PRGSX, VOOG, SPYMore information on Boeing will go here
library(plotly)
dfUAL <- data.frame(Date = index(UAL), coredata(UAL))
dfUAL <- tail(dfUAL, 60) # Fix typo in tail() function
# Custom colors
i <- list(line = list(color = 'green'))
d <- list(line = list(color = 'red'))
(UALPLOT <- dfUAL %>%
plot_ly(x = ~Date, type = "candlestick",
open = ~UAL.Open, close = ~UAL.Close,
high = ~UAL.High, low = ~UAL.Low,
increasing = i, decreasing = d) |>
layout(title = list(text = "The Bills - UAL Price Behavior Over Project", font = list(color = "white")),
xaxis = list(title = "Date", color = "white"),
yaxis = list(title = "Price (USD)", color = "white"),
margin = list(l = 50, r = 50, t = 50, b = 50),
plot_bgcolor = "black", # Set background color to black
paper_bgcolor = "black", # Set paper background color to black
annotations = list(
list(x = as.Date("2023-09-18"), y = max(dfUAL$UAL.High), xref = "x", yref = "y",
text = "Start", showarrow = TRUE, arrowhead = 4, ax = 0, ay = -40, font = list(color = "white")),
list(x = as.Date("2023-09-21"), y = max(dfUAL$UAL.High), xref = "x", yref = "y",
text = "Buy", showarrow = TRUE, arrowhead = 4, ax = 0, ay = -40, font = list(color = "white")),
list(x = as.Date("2023-11-14"), y = max(dfUAL$UAL.High), xref = "x", yref = "y",
text = "Sell", showarrow = TRUE, arrowhead = 4, ax = 0, ay = -40, font = list(color = "white"))
)
))More Information on UAL will go here