stock<-structure(list(week = c(1L, 2L, 5L, 2L, 3L, 4L, 3L, 2L, 1L, 5L,
1L, 3L, 2L, 4L, 3L, 4L, 2L, 3L, 1L, 4L, 3L),
close_price = c(774000L,
85
I think I could do a bit better with a reproducible example but I think the problem may be one (or more) of several reasons. Firstly, do a str(data) to make sure each variable is of the correct type (factor, numeric, etc.). Also, Neural Nets usually respond better to standardized, scaled, and centered data otherwise the inputs get oversaturated with larger numeric inputs which might be the case if the 'week' variable is numeric.
In summary, definitely check the types of each variable to make sure you are inputting the correct forms and consider scaling your data to be smooth and so the inputs are of comparable magnitudes.