If I understand you correctly, each point on the plot is assigned to either 'Yes' or 'No', and you would like the line to change color according to this. In geom_line
, the color aesthetic cannot vary along the length of the line. Perhaps the neatest way to achieve this effect is to plot the whole thing as a series of line segments, where the start point of each segment is your data, and the end point is the lagged data:
library(tidyverse)
ggplot(df) +
ggtitle(df$symbol) +
geom_segment(aes(x = date, y = adjusted, xend = lag(date),
yend = lag(adjusted), color = Signal)) +
xlab('') +
ylab('Price') +
theme_bw()

Incidentally, I think this is a difficult plot to read. If you want to be able to read off the 'yes' and 'no' values more easily, you might consider using a geom_rect
background instead:
ggplot(df) +
ggtitle(df$symbol) +
geom_rect(aes(xmin = date, xmax = lag(date), ymin = -Inf, ymax = Inf,
fill = Signal), alpha = 0.2) +
geom_line(aes(x = date, y = adjusted)) +
xlab('') +
ylab('Price') +
theme_bw()

Data used
You did not provide any data for this example, so I created some with the same names and similar values using the following code:
set.seed(5)
df <- data.frame(date = seq(as.Date('2019-01-01'),
as.Date('2022-12-22'), 'day'),
adjusted = round(cumsum(rnorm(1452)) + 150, 1),
symbol = 'QQQ')
df$skew <- 0
for(i in seq(nrow(df))[-1]) {
df$skew[i] <- ifelse(df$skew[i - 1] == 0,
sample(0:1, 1, prob = c(0.9, 0.1)),
sample(1:0, prob = c(0.9, 0.1)))
}
df <- df %>% mutate(Signal = if_else(skew >= 1, 'Yes', 'No'))