Is this logic correct for MA(1)?

Course Name: Financial Time Series Analysis, Section No: 15, Unit No: 6, Unit ty: Notebk

https://i.imgur.com/FNUaPi9.png

Hi I see in this notebook we're using current prediction (which actually predicts tomorrow price) and comparing with tomorrow closing. If current prediction is bigger than tomorrow price we buy, otherwise we sell.

This logic represent problems: 1) we go long even when the current prediction is lower the next predict & 2) look ahead bias.

I've found for AR model (same course, section 14, Unit 3 (notebook)) we used the following logic to generate trading signals

We compared today prediction with yesterday prediction. If today prediction is bigger than yesterday prediction then we buy, otherwise we sell.



Is this not more appropiate approach as we don't need to look for tomorrow values (something we don't have) and avoid buy even when current prediction (which predicts tomorrow price) is bearish?

Hey Daniel,



In time series data, shift(1) refers to shifting the data one period back. In that sense, the strategy logic is actually:

If current day's prediction is greater than yesterday's price we buy, otherwise we sell.



Hope this helps!



Thanks

Rushda

Hello Rushda,



Thanks for the explanation. However I don't understand why here we generate signals comparing current prediction against yesterday's price, as we know predictions can be mistaken in value but correct in direction (buy, sell).



In AR model we used another approach to generate trading signals:



Why we don't use the same logic? Comparing if today's prediction is higher than yesterday's prediction = buy and viceversa?



Doing that we generate a better model. Look at the result using the same logic for generate trading signals, used in the AR model:









 

Hey Daniel,



You're right, thankyou for pointing this out. This has been fixed



Thanks

Rushda

Thanks for your excellent support.