SteadyOptions is an options trading forum where you can find solutions from top options traders. Join Us!

We’ve all been there… researching options strategies and unable to find the answers we’re looking for. SteadyOptions has your solution.

SBatch

Crude Oil/30 Year Treasury Yield Correlation

Recommended Posts

There is a definitive correlation between crude oil prices and the 10 year Treasury yield, led slightly by crude. That's the edge. The option trades around this are endless. It makes sense, higher crude price, higher inflation, higher yields.

1 year chart:

 

image.thumb.png.0d5d64bc5548fb45410e5fde40d1619b.png
image.thumb.png.3e659572e215226721a34c8466a017e0.png
 
Sure looks like the 10 year yield is about to move higher very soon.
 
5 year chart:
image.thumb.png.4e7c740de46dea2fb3fd41a9ef1ec04b.png
image.thumb.png.1a6376d7a0c44e39dfc6df959a42a550.png
Absolutely remarkable. Directional trades can be huge winners here. Crude leads the 10 year yield (therefore their prices are inversely correlated).

Share this post


Link to post
Share on other sites
On 1/5/2024 at 2:32 PM, Sunshine25 said:

How do you personally play this trade? 

If the trade is highly correlated, and led slightly by crude, do you take a position in a financial instument (TLT?) to play the trade? Short Call against crude and long call on tlt?  I am just spit-balling trades.

I just use a put or call directional debit spread (or theta positive neutral spread) on TLT/TMF after I see the move in oil but before rates start to follow. I recommended this one in October, just about 100% return. Basic idea, higher crude, lower TLT and vice versa. 

 

https://steadyoptions.com/forums/forum/topic/9288-bond-market-implosion/?do=findComment&comment=187802

Share this post


Link to post
Share on other sites

image.thumb.png.587ee4ec22f2357c59d19f076cf45182.png

image.thumb.png.bc72c4f59da3cda76a1e17dc20c8a94f.png

Getting interesting. This hot inflation report could fuel follow-through upward momentum on oil. It is certainly set up from a technical perspective, and now it has the fundamental. With a break of $76 on crude I would go short on TLT with a near or in the money debit put spread.

Share this post


Link to post
Share on other sites

image.thumb.png.27372a59ed1b390c37f52bc4eb504b8a.png

image.thumb.png.ecc9f3683cd1f9164b587328234f2e80.png

The setup is good for more of a sideways play. I think the 10 year will move to around 3.9% before pushing back toward 4%, tracing the same pattern as oil. This would have TLT slightly lower over the next several weeks. I opened the trade below:

 

01/12/2024 10:34:19information.svg
01/12/2024 10:34:19information.svg
Buy Open
Sell Open
20
20
TLT 03/15/2024 102.00 Put
TLT 03/15/2024 98.00 Put
Net Debit 2.79 DAY  
Bought @ 5.55
Sold @ 2.76

 

 

Share this post


Link to post
Share on other sites
20 minutes ago, Chuck451 said:

@SBatch What is your exit strategy for this trade?   Curious spectator here...

image.thumb.png.d79291d5df3f6361d986b5ee7d8b1f95.png

It will depend on the price action, but looking for around 30% gain. The above is just the DPS, not including the TMF calls. Worst case, we give back about $200 on those, but that would have us at around 40%, still hitting 30% net.

Share this post


Link to post
Share on other sites

I opened the below Iron Condor:

image.thumb.png.e9ea31bdd8e37f7ae0e038063e069b05.png

 

01/16/2024 11:35:55information.svg
01/16/2024 11:35:55information.svg
01/16/2024 11:35:55information.svg
01/16/2024 11:35:55information.svg
Buy Open
Sell Open
Sell Open
Buy Open
20
20
20
20
TLT 03/15/2024 90.00 Put
TLT 03/15/2024 92.00 Put
TLT 03/15/2024 100.00 Call
TLT 03/15/2024 102.00 Call
Net Credit 0.67 DAY  
Bought @ 0.49
Sold @ 0.86
Sold @ 0.75
Bought @ 0.45

 

 

Share this post


Link to post
Share on other sites

image.thumb.png.cbc3c19d2592ed5f58eaade7cc5ebeb5.png

image.thumb.png.90de2fe9f8d25718283539fba21023aa.png

The 30 year Treasury yield usually follows the trend of crude oil with a lag of about three weeks. That has us around Christmas where crude made its most recent peak. I believe we are at or near that peak now on the 30 year treasury. Therefore we can expect the yield to drop slightly and then move sideways for a couple weeks. This would have TLT slightly higher and then sideways; perfect for the Iron Condor.

Share this post


Link to post
Share on other sites

I read the references you mention. I was wondering about correlation between Crude Oil and 30Y Treasury Yield, and so about the correlation between TLT and the Future CL1. For a technical reason I was not able to download past data of CL1 so I used WTI (which has the same OHLC diagram). Here are the plots of both since 2010 :

image.png

Then I compute a coefficient of correlation between both and I got -0.51, the sign "minus" meaning "anti-correlation" (one up, the other down and opposite), like in this example where anti-correlation is perfect (coeff. corr = -1):

image.png

This coefficient of -0.51 means that the correlation is there but not strong (max correlation is "1" or "-1"). May be is it because we have to look as TLT as a "trailer" and that a "shift in time" should be analyzed for every trade. I don't know, I am just exploring, questioning and wondering if the correlation is really so strong. Just to be curious and understand. Comments welcome!

 

Edited by Romuald

Share this post


Link to post
Share on other sites
1 hour ago, Romuald said:

I read the references you mention. I was wondering about correlation between Crude Oil and 30Y Treasury Yield, and so about the correlation between TLT and the Future CL1. For a technical reason I was not able to download past data of CL1 so I used WTI (which has the same OHLC diagram). Here are the plots of both since 2010 :

image.png

Then I compute a coefficient of correlation between both and I got -0.51, the sign "minus" meaning "anti-correlation" (one up, the other down and opposite), like in this example where anti-correlation is perfect (coeff. corr = -1):

image.png

This coefficient of -0.51 means that the correlation is there but not strong. May be is it because we have to look as Crude Oil as a "trailer" and that a "shift in time" should be analyzed for every trade. I don't know, I am just exploring, questioning and wondering if the correlation is really so strong. Just to be curious and understand. Comments welcome!

 

Treasuries are the trailer, not crude. And yes, the time delay is necessary to determine the correlation.

Share this post


Link to post
Share on other sites
53 minutes ago, SBatch said:

Treasuries are the trailer, not crude. And yes, the time delay is necessary to determine the correlation.

Yes, sorry, TLT is the trailer, that is what I meant, corrected in the original. OK, so I tried with different time shifts on Crude and it did not improve the correlation. But my time shift was the same all over the 10 years and this is certainly not true. So, as I understand, time shift makes the correlation and this time shift is different from one period to the other. Quickly summarizing, Crude "shows the future way" to Treasuries but this "future" is different from one period to the other, and so is the correlation. Correct?

Share this post


Link to post
Share on other sites
20 minutes ago, Romuald said:

Yes, sorry, TLT is the trailer, that is what I meant, corrected in the original. OK, so I tried with different time shifts on Crude and it did not improve the correlation. But my time shift was the same all over the 10 years and this is certainly not true. So, as I understand, time shift makes the correlation and this time shift is different from one period to the other. Quickly summarizing, Crude "shows the future way" to Treasuries but this "future" is different from one period to the other, and so is the correlation. Correct?

Correct. There are fundamental issues such as inflation that can dislodge the correlation in the short term, but they always link up again at some point.

Share this post


Link to post
Share on other sites

So TLT follows WTI moves by some days and some issues and so WTI could be viewed like an 'indicator'.

By curiosity I coded a Recurrent Neural Network (RNN) called Long Short-Term memory (LSTM) in Python.

I am not a fan of such deep learning programs. A lot have been created these last years but the success in stock price prediction is weak due to the fact that stock price is a stochastic process. And randomness cannot be predicted. But, when a correlation does appear, these kinds of learning neural networks could be efficient. So why not to try with WTI and TLT since it seems that a (negative) correlation does exist.

These kinds of RNN's need features to be trained on : they observe two signals and try to find a (anti-)correlation between both. Then, based on what they see, they try to make a forecast on how one of the signal (the trailer) would behave based on the model defined on past data. By the past, when I was still trying to forecast the future using neural networks :) I remember that I tried quasi all possible indicators (Bollinger, Ichimoku, all EMA's, etc.). None was sufficiently correlated to a given ticker to make a correct forecast. It is quickly said but just to give the idea.

So, I wrote the code. This code utilizes a Long Short-Term Memory (LSTM) neural network to train a model for forecasting the TLT (Treasury Bond ETF) prices for the next nDaysForecast days based on the historical WTI (West Texas Intermediate) crude oil prices. Here's a brief overview of the steps involved:

  1. Data Downloading: Historical data for WTI and TLT for the past nYearsBack years is downloaded using the download_data function from Yahoo Finance.
  2. Data Preparation: The downloaded data is preprocessed using the prepare_data function. It scales the closing prices of the respective stocks to a range of (-1, 1) using Min-Max scaling.
  3. Sequence Creation: Sequences of input features and target variables are created using the create_sequences function. This function segments the data into input sequences (X) and corresponding target values (y).
  4. LSTM Model Definition: An LSTM model is defined using the LSTMModel class. This model consists of an LSTM layer followed by a fully connected layer (linear layer) to produce the output.
  5. Model Training: The LSTM model is trained using the historical WTI data. The training is performed for numEpochs epochs using the train_model function.
  6. Prediction: The trained model is used to make predictions for the TLT prices based on the historical WTI data. Predictions are made for the next nDaysForecast days.
  7. Uncertainty Calculation: The uncertainty in the predictions is calculated based on the root mean square error (RMSE) of the model.
  8. Plotting Results: The actual TLT prices, predicted TLT prices, WTI prices, confidence interval, and forecast range are plotted. Dashed horizontal lines are added for the max and min of the confidence interval, with their values annotated at the extreme right.

So, in summary, I say to the program : look at the past data for TLT and WTI, see whether or not there is correlation (even negative) and, based upon what you see on WTI moves, build a model to try to forecast the future prices for TLT. Do it on 20 years of past data. I know that the correlation is not perfect, so compute the mean square error, based on what you observed in the past. Note that I do not say anything to my LSTM. I just ask to

Here is the plot of the results :

image.png

"Num Epochs" is a number of "generations". To say it quickly, the LSTM is training and learning. Each time it controls itself it improves itself by keeping only the best parameters of the model. Then it starts a new computation with the new parameters : it is the next "epoch". Here 2000 epochs have been used. Of course it must improves at each epoch, which is the case when I look at the "loss" curve (no shown here).

We can see that RMSE is very low, which is a good news. I never got a RMSE so small using classic indicators by the past.

I plotted the results in a dashed dark blue line and the confidence interval (based on RMSE) in results. 

What the LSTM says here is that, during the next 20 days, TLT would be supposed to go between $91.48 and $97.15, based on the correlation the program observed over the last 20 years between TLT and WTI.

I am not saying that it is true. It is just a research, an exploration, a reflexion to be a base of discussion.

As usual, any comments welcome!

 

 

 

 

 

Share this post


Link to post
Share on other sites
33 minutes ago, Romuald said:

What the LSTM says here is that, during the next 20 days, TLT would be supposed to go between $91.48 and $97.15, based on the correlation the program observed over the last 20 years between TLT and WTI.

I am not saying that it is true. It is just a research, an exploration, a reflexion to be a base of discussion.

As usual, any comments welcome!

I like the idea of applying ML to this strategy. Thanks for the detailed background on your process!

Did you do any testing splitting up past data into a training set and a test set? And if so, what sort of accuracy have you seen for those predictions?

Share this post


Link to post
Share on other sites

03.10.2020-Image-1.png

The above is an excellent chart of the correlation. As can be seen. The correlation is extremely strong until the pandemic, where yields needed to forge out an even lower low. However, as soon as that correction was made, the two synced right back up again.

 

Share this post


Link to post
Share on other sites
2 hours ago, Romuald said:

So TLT follows WTI moves by some days and some issues and so WTI could be viewed like an 'indicator'.

By curiosity I coded a Recurrent Neural Network (RNN) called Long Short-Term memory (LSTM) in Python.

I am not a fan of such deep learning programs. A lot have been created these last years but the success in stock price prediction is weak due to the fact that stock price is a stochastic process. And randomness cannot be predicted. But, when a correlation does appear, these kinds of learning neural networks could be efficient. So why not to try with WTI and TLT since it seems that a (negative) correlation does exist.

These kinds of RNN's need features to be trained on : they observe two signals and try to find a (anti-)correlation between both. Then, based on what they see, they try to make a forecast on how one of the signal (the trailer) would behave based on the model defined on past data. By the past, when I was still trying to forecast the future using neural networks :) I remember that I tried quasi all possible indicators (Bollinger, Ichimoku, all EMA's, etc.). None was sufficiently correlated to a given ticker to make a correct forecast. It is quickly said but just to give the idea.

So, I wrote the code. This code utilizes a Long Short-Term Memory (LSTM) neural network to train a model for forecasting the TLT (Treasury Bond ETF) prices for the next nDaysForecast days based on the historical WTI (West Texas Intermediate) crude oil prices. Here's a brief overview of the steps involved:

  1. Data Downloading: Historical data for WTI and TLT for the past nYearsBack years is downloaded using the download_data function from Yahoo Finance.
  2. Data Preparation: The downloaded data is preprocessed using the prepare_data function. It scales the closing prices of the respective stocks to a range of (-1, 1) using Min-Max scaling.
  3. Sequence Creation: Sequences of input features and target variables are created using the create_sequences function. This function segments the data into input sequences (X) and corresponding target values (y).
  4. LSTM Model Definition: An LSTM model is defined using the LSTMModel class. This model consists of an LSTM layer followed by a fully connected layer (linear layer) to produce the output.
  5. Model Training: The LSTM model is trained using the historical WTI data. The training is performed for numEpochs epochs using the train_model function.
  6. Prediction: The trained model is used to make predictions for the TLT prices based on the historical WTI data. Predictions are made for the next nDaysForecast days.
  7. Uncertainty Calculation: The uncertainty in the predictions is calculated based on the root mean square error (RMSE) of the model.
  8. Plotting Results: The actual TLT prices, predicted TLT prices, WTI prices, confidence interval, and forecast range are plotted. Dashed horizontal lines are added for the max and min of the confidence interval, with their values annotated at the extreme right.

So, in summary, I say to the program : look at the past data for TLT and WTI, see whether or not there is correlation (even negative) and, based upon what you see on WTI moves, build a model to try to forecast the future prices for TLT. Do it on 20 years of past data. I know that the correlation is not perfect, so compute the mean square error, based on what you observed in the past. Note that I do not say anything to my LSTM. I just ask to

Here is the plot of the results :

image.png

"Num Epochs" is a number of "generations". To say it quickly, the LSTM is training and learning. Each time it controls itself it improves itself by keeping only the best parameters of the model. Then it starts a new computation with the new parameters : it is the next "epoch". Here 2000 epochs have been used. Of course it must improves at each epoch, which is the case when I look at the "loss" curve (no shown here).

We can see that RMSE is very low, which is a good news. I never got a RMSE so small using classic indicators by the past.

I plotted the results in a dashed dark blue line and the confidence interval (based on RMSE) in results. 

What the LSTM says here is that, during the next 20 days, TLT would be supposed to go between $91.48 and $97.15, based on the correlation the program observed over the last 20 years between TLT and WTI.

I am not saying that it is true. It is just a research, an exploration, a reflexion to be a base of discussion.

As usual, any comments welcome!

 

 

 

 

 

Personally, I have TLT between 90 and 95 over the course of the next three weeks.

Share this post


Link to post
Share on other sites
3 hours ago, vralln said:

I like the idea of applying ML to this strategy. Thanks for the detailed background on your process!

Did you do any testing splitting up past data into a training set and a test set? And if so, what sort of accuracy have you seen for those predictions?

 

The typical length of training and testing data for a Long Short-Term Memory (LSTM) neural network can vary depending on several factors, including the complexity of the problem, the amount of available data, and the specific requirements of the task. However, there are some common practices and considerations. The training data length should be large enough to capture the underlying patterns and relationships in the data effectively. I use a significant portion of the available data for training, typically around 70%-80% of the total dataset. The accuracy is the RMSE and is equal to 1.4%

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account. It's easy and free!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.