Showing posts with label S&P500. Show all posts
Showing posts with label S&P500. Show all posts

Sunday, 19 August 2018

SP500 vs Gold, using their correlation to make a trading strategy (Part 1)


This post is part of a new series in which I will show how to figure out if we can build a strategy using some assets’ correlation. Let me introduce the assets:


S&P500

Mini S&P500 future (continuous contract), daily, Source: TradingView
    Mini S&P500 future (continuous contract), daily, Source: TradingView

The Standard & Poor's 500 is one of the main American stock market index based on the market capitalizations of 500 large companies having common stock listed on the NYSE or NASDAQ. As you can see, this index hasn´t stopped raising since 2011. 

Gold

Comex Gold future (continuous contract), daily, Source: TradingView
    Comex Gold future (continuous contract), daily, Source: TradingView

The Comex Gold is one of the most important futures. You can trade it directly or you can use it to hedge your stock portfolio. Historically this hedge has been successful and has protected the portfolios versus big drawdowns. It´s recommended to have at least a small part of your investments in gold (even if it´s in an exchange-traded fund that tracks this metal)


I reviewed Gold futures and ETF´s last year: Gold Analysis

 


Spread between SP500 and Gold

Spread between SP500 and Gold futures, daily, Source: TradingView
    Spread between SP500 and Gold futures, daily, Source: TradingView

To simplify the calculation, I decided to make the spread as 1 E-mini S&P500 future minus 1 Comex Gold future. As you can see, the relationship was negative before 2013 because the gold price was higher than the S&P. Since then, this spread has raised almost like the US index. This explains that the different QE programs calmed down the uncertainty (so the investors started buying the S&P and started selling or reducing their gold portfolio)


Introduction to the study

Correlation series

For this part, I chose 4 correlation series (20, 60, 120 and 250 days) that represent different time frames. 


Correlation time frames table, own elaboration
      Correlation time frames table, own elaboration

The main reason for choosing this time frames is to make comparisons and to see if I can work out a strategy in the following posts. 



 S&P500 and Gold correlation series, own elaboration
     S&P500 and Gold correlation series, own elaboration

We can’t get any conclusion from this chart apart that the long-term correlation between S&P500 and gold is negative (the most part of the time).  One of the things I would like to study in the following days is if I can build a profitable system based on the correlation series divergences. For now, I can show the different charts with the asset prices and the correlation (The Y left axis represents the price of the assets and the Y right axis represents the correlation coefficient):


 S&P500, Gold, and  20 days correlation serie, own elaboration
     S&P500, Gold, and  20 days correlation serie, own elaboration

This chart doesn’t show any clear relationship. Another problem is that is a short-term correlation that generates a lot of noise in the signals and it´s difficult to know if it´s worth to check this correlation to trade the spread.



S&P500, Gold, and  60 days correlation serie, own elaboration
    S&P500, Gold, and  60 days correlation serie, own elaboration

The 60-day correlation is smoother than the previous one. I think that we can take advantage of the correlation every time that is above 0, however, a statistical study is required. 


 S&P500, Gold, and  120 and 250 days correlation series, own elaboration
  S&P500, Gold, and  120 and 250 days correlation series, own elaboration

As I said before, we can see that the most part of the time these correlations are below 0. Like in the previous chart we can take advantage of the correlation above 0. In addition, I would be interesting to study a trading system based on the 120 days correlations that trigger a trade every time is under -0.2. In terms of correlation’s divergence, we need to backtest it properly.

Sum up

I’ve chosen these assets because they are really important. The S&P500 reflects the US economy and the Comex Gold can be used as an investment or as a hedge vs the main index in a recession. Sadly this post is an introduction. I will analyze the systems proposed using advanced statistics and some backtests. As a reminder, the systems will be based on the correlation and its divergences. 



#trading #investing #correlation #ES #GC #SP500 #Gold #statistics

Sunday, 4 February 2018

Buy the red candle strategy


We have seen how the indexes around the world have been raising since the financial crisis. Obviously, the best strategy was buying in 2009 and holding. I’d like to introduce a trading system based on buying at the final of the day if the underlying is down “X”% and selling before the close of the following day.
In order to make it simple and with statistical meaning, I decided that the system would buy when the underlying security is down 0.20% or more.
The underlying
I´ve chosen the Vanguard S&P500 ETF that is an exchange-traded fund that tracks the S&P 500 index. The ticker is VOO.


     VOO, daily

The period studied is from 2012. As you can see this ETF has doubled like the S&P500.



     VOO daily returns own elaboration

The most part of the daily returns were positive for the period studied. I would like to highlight that there were more down days in the first 4 years (2012 to 2016) than in the last 2 years. As you can see almost every negative day trigger the signal to buy.

Performance of the system


Now it´s time to check the performance of the system. Sadly is not as good as the buying and holding strategy. The starting capital is 100000$.


       Trading system statistics own elaboration

The system returns 94$ per day on average. The maximum profit was 4372$ while the worst loss 4634$. I don´t like the fact that losing this amount of money in a day so it would be interesting to set up a reasonable stop loss. The system returns 43084$ in 6 years without considering commissions. The winning trade ratio is not that good, but we can optimize the target return to trigger the signal in order to get better results in terms of performance and risk. The Sharpe ratio is not that good.


       Maximum Drawdown own elaboration

The maximum drawdown was 13269.14$ which was the equivalent of 11.90% of the portfolio. As far as the drawdown is below 20%, I’m happy.


    Portfolio performance own elaboration

It has grown consistently but as I said before I would like to see a smooth line. Adding a stop loss can improve the trading system.

Sum up


We have seen a simple trading system. Sadly on this occasion, its performance is worse than its benchmark. There are a lot of things in which I can improve this system such as adding a stop loss or modify the return that triggers the signal. We need to be careful with the overfitting. In addition, the commissions are not included in the trading system. I hope you like it.

Have a good trading!!



Disclaimer


I wrote this article myself, and it expresses my own opinions that shouldn't be used as a trading advice. Trading carries considerable risk due to the high leverage involved

#ETF #performance #Rprogramming #risk #S&P500 #systematictrading #Trading #Vanguard

Sunday, 21 January 2018

Canadian interest rate decision, the falling USD and the indexes rally


We had a busy week in terms of news and economic releases. The UK CPI and the European CPI were in line with the expectations. The Bank of Canada raised the interest rates. We saw a better than expected building permits in the US. Maybe the biggest surprise on Friday was the UK Retail Sales that show the third-worst figure in the last 5 years. On the other hand, the speculation of the government shut down drove the USD down. Sadly, now it’s official, as it happened yesterday night.


Interest Rate decision

    Source: TradingView, USD/CAD (FXCM), 15 min

As you can image, the CAD went up with the interest rate decision. The market participants expected a hawkish statement considering that the Canadian economic outlook is expected to keep strong and allow to raise the interest rates in the future. Sadly, the BOC showed its dovish side confirming that some monetary accommodation will be needed.


     Source: TradingView, USD/CAD (FXCM), daily

We can see that the USD recovered in the last 2 trading days after the dovish comments of the Bank of Canada and the uncertainty about NAFTA.


US Dollar Index


    Source: TradingView, US Dollar Index, daily

The USD has been falling during the last 3 months while the bond yields have been raising. If we only consider the FED policy, the dollar should be going up. On the other hand, and in my humble opinion, some policies are not coordinated to meet certain economic targets. In addition, some political issues such as the government shut down are reflected on the USD.

Unstoppable Indexes

DAX

    Source: TradingView, DAX future, daily

The Dax is trading on its all-time highs and seems that it´s not going to stop. The European indexes are not as directional as the American indexes. One of the biggest risks, in my opinion, is an expensive euro because this will slow down the trading with other economic areas.  The ECB will hold a meeting next week that will guide the traders about the future economic policy.

FTSE

     Source: TradingView, FTSE future, daily

The FTSE is another example of great performance. The recovery since the Brexit referendum has been incredible. The uncertainty of the possible split up with Europe hasn´t affected the index. It´s true that after the referendum the British Pound fell a lot and helped some funds to take bigger positions in the stock market.

US indexes


S&P 500

     Source: TradingView, SP500 future, daily



     Source: TradingView, Dow Jones future, daily

The last 2 charts are identical. If an investor opened positions in 2013, now he would have doubled his investment. Some of the biggest investments banks have warned their clients about a possible big sell off to take profits. One of the reasons behind this is that these indexes have never been overbought in their history. In addition, we have seen the largest inflows ever in equity funds.  When everyone is buying after the biggest rally ever, it´s better to take profits while we can. If you don’t believe in this theory, ask the bitcoin investors that bought the cryptocurrency at 19000$.

Opinion

We have seen interesting movements this week. Everyone is monitoring the Central Banks statements. We need to focus on the Bank of Japan and the European Central Bank next week. I would like to see how the ECB deals with a strong Euro. I don’t think that the US government shut down will last long. About the stock markets… well, I said before. These things don’t end well.

Have a good trading!!




Disclaimer


I wrote this article myself, and it expresses my own opinions that shouldn't be used as a trading advice. Trading carries considerable risk due to the high leverage involved


#BankofCanada #bitcoin #DAX #DowJones #FTSE #FX #indexes #InterestRates #opinion #SP500 #Trading #USDollarIndex

Friday, 13 October 2017

Index analysis, DAX, FESX, S&P500 and Nasdaq

Today I´m going to talk about some of the biggest indexes around the world. The year to date performance is really good in all of them. We have seen an improvement in the economic data which always help the stock market and brings confidence to the consumers. If you understand the movement of the stock market, you can guess what’s going on around the world, sadly, you need the experience to do it. Let’s say that I consider the stock market as it was a leading indicator of the economy. Other examples of leading indicators are the bond yields, the interest rate yield curve, new housing starts and money supply. Apart from them, the rest of the economic indicators are based on the last month or the last period of time.
For example, when the market participants expect positive data and the economic indicator is negative, there is a big movement in the market.


Let´s see how the indexes are performing this year:

DAX


    Source: TradingView, Dax Index, daily

The Dax went up during the first six months of the year. After this period, and due to the big fines of the German automotive sector and the uncertainty of the German elections if fell to the 11900 level.  It’s been raising since September without stopping.  As you can see it tested two times the 200EMA but it couldn´t consolidate the downward movement.


   Source: TradingView, Dax Index, daily

This is the German index from July until now. As I said before it went down to the 3rd support (11941.5) where we can see a double support. The technical figure and the buying pressure helped the Dax to look for highs again. At the moment, it´s around 12900 and probably this movement will continue in the short term.

Eurostoxx (FESX)



    Source: TradingView, FESX Index, daily

You can think that it´s the same chart as the section before with different scale. The shape is the same. I really like the FESX because there is a lot of liquidity. This index represent the 50 biggest companies in Europe. It respects the technical levels. The main difference with the Dax is that it has exposure to different countries in Europe. The peripherical countries in Europe don´t perform as well as the most conservative ones like Germany, and this fact is reflected on the EuroStoxx index. This is why there are more retracements than in the Dax or S&P500. 


    Source: TradingView, FESX Index, daily

This a stable contract full of liquidity as I said before. The shades highlighted in yellow are really important because they show of the buyers took control of the situation and reversed the downward move.  When the 20EMA crossed the 50EMA, this contract accelerated the move.

S&P500



   Source: TradingView, SP500 Index, daily

What can I say about the S&P500? It’s the best chart I´ve ever seen for a technical analysis book. It respects the trendline I drew on the chart. The moving averages don’t cross between then and this shows the strength of this bullish trend. The broken triangle pattern led the S&P500 to 2480, where it retraced to the trendline and rocketed to the current levels.


    Source: TradingView, SP500 Index, daily

This shows the last 4 months. You can see how technically this contract trades.


Nasdaq


    Source: TradingView, Nasdaq Index, daily

This is almost the same case as the S&P500. I’ve noticed that the buying strength is decreasing. If you see the red lines drawn by me, each rise is not as strong as the previous one. It means that maybe it’s consolidating or maybe the sellers will be back testing the 5900 or even the 5775 levels.

The main reasons for these strong performances are: improvement in the economies, the consumer confidence the change in the economic policy from the central banks When will this move stop? I'm not sure, but this move is supported in part by the central bank stimulus policies. I think the transition of these supportive economic policies will be a challenge and it can affect all the financial markets.The approval of the US tax reform can boost the US markets in the short term. I hope that this post helps you.

Have a good trading! 



Disclaimer

I wrote this article myself, and it expresses my own opinions that shouldn't be used as a trading advice. Trading carries considerable risk due to the high leverages involved



8th day small profit that helps me to keep going in the competition

After a successful week and most importantly from recovering almost $6k, I wanted to consolidate my positive results. My desire was to b...