1
$\begingroup$

I’m looking at making predictions of close prices (stocks/commodities), and have access to various data sources to help predict.

However, most of these sources are in a different time frame, typically weekly or monthly as opposed to the daily close prices.

As an example: say you want to predict close price of oil based on the weekly oil rig count.

Would be grateful to receive input on how to approach this on: 1. A theoretical level - what to do and why? Does it make sense to predict daily based on weekly input, or should it be a weekly (i.e close Friday) prediction? 2. A practical level - how to most easy implement in Python?

Thanks in advance!

$\endgroup$
1
$\begingroup$

1) On a theoretical level you should start forming some hypothesis about how you expect prices to move depending on the data you have. Then look for ways to test your hypothesis! I do this by looking at distributions of price movement, seasonality, different indicators. Look for some piece of data that supports your prediction philosophy and try to expand on it. Does it make sense to predict daily based on weekly input? I think it depends. I'd probably revert to my first statement in that you should play with your data and look for indicators/theorize about the market. Then decide whether it makes sense or not.

2) In Python (my preferred language), you can probably get started with the Pandas library. Pandas makes it extremely easy to deal with time series data, index by date, column, and read/write to disk files. You might want to implement some signal processing features from SciPy! I like to use argrelextrema among others to determine points of momentum shift! If you're into machine learning, use Scikit-learn. Its regarded as one of the most powerful machine learning libraries available.

$\endgroup$
1
$\begingroup$

It is important to understand the sequence of events, i.e. how information is revealed.

For example the Baker Hughes Rig Count is published at 1300 Eastern Time, usually on a Friday. (But a few are not on a Friday, I recommend you use the actual dates).

The Bloomberg data for NYMEX Crude futures close is the price of Crude at 1430 Eastern time.

The simplest, or "zero information", forecast for the Friday closing price of Crude is just the Thursday closing price. The error of this forecast is equal to $\sigma(P_{Fri}-P_{Th})$ which can be estimated empirically.

The next step is to build a slightly more sophisticated forecasting model which takes the intervening rig count release into account. This model could be of the form $P_{Fri}=P_{Th}+\alpha+\beta *RIG\_INFO_{Fri}$ where alpha and beta are estimated by linear regression. Theoretically RIG_INFO should be the difference between the Rig Count data and the market's expectation of the rig count just prior to the announcement. If you don't have the expected value you could perhaps use the difference between the announced rig count and the rig count the previous week as a proxy for the "surprise".

In any case once you have estimated this model you can check how much better it is than the naive model. (In my experience a single explanatory variable, like rig count, will only reduce the error by a relatively small amount. This reduction, theoretically, measures the contribution of the announcement to the crude price).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.