Machine learning for next 30 days price

Hello, i am using this lines of code

 

data['future_returns']=data['Close'].pct_change().shift(-1)

and below for the creation of signal columns
 
data['signal']=np.where(data['future_returns']>0,1,0)


in this type i am calculating if the next days will be more than today close.

But if i want to calculate for the next 30 days what will be the price, or in a specific date for example 15 december 2022.

How can i write ?

thanks for the help.

 

Hi Irene,



Your current approach lets you predict today's price using yesterday's price. You can use the same approach to predict the next 30 day's price by using the last 30 day's price data.



If you choose to do this, though, you will be relying on the currently available price data, which might not be adequate to produce results that are accurate that far into the future.



Thanks,

Rushda Ansari

Thanks Rushda, i think i will use a smoothed period of last 30 days closing price from daily data, but, i supposed alternativly maybe it s more right to use the monthly data and so use the last closing price to predict the next price…(with monthly price closing).

what do you think is more correct?

the first thing i know , and absolutly agree with you, more the prediction is far from here, less power have in accuracy.

thanks, have a good day.

Hey Irene,



More data is always better, therefore, you can try to use the price data of the last 30 days. However, the accuracy of both the approaches you mentioned above would remain low owing to the adequacy of this data.



Hope this helps!



Thanks,

Rushda Ansari

i will try to emplement my model. thanks rushda really kind.