Thursday, January 30, 2020

EMA(13) & EMA(48) vs SMA(20) & SMA(50) Backtest Results

I've always wondered whether the SMA 20/50 combo would be better than the EMA 13/48.5 combo that I had read about through etfhq.com. So I back-tested both with the following set of rules:


  1. Initial Equity of Php 100,000
  2. Maximum number of positions: 3 (so we can keep track of our stocks)
  3. Maximum allocation per stock: Php 30,000 (30% of initial capital)
  4. Back-test period begins from January 1, 2010 to January 1, 2020 
  5. Entry would be 1 day after the golden cross, at the open.
  6. Entry would be a golden cross + RSI(28) being above level 50 to check for momentum.
  7. Stop Loss percentage of -8%.
  8. Stop Loss if price closes below the slower moving average.
The reason I am opting for a 10 year back test vs a 20 year one is simply because I am not confident with my data prior to 2010. As they say in data analysis, "Garbage in, garbage out".

Below is the code I used on my Amibroker. I am no master in coding AFL so if you know how to code using Amibroker, please check if my settings are correct.



First up is the SMA 20/50. Here are the results:


To summarize SMA 20/50 Golden Cross Results:
  • Net Profit: 510.61%
  • Ending Capital: 610,614.67
  • Total Trades: 302
  • Winning Trades: 83
  • Losing Trades: 219 
  • Win Rate (winning / total trades): 27.48%
Keep in mind that the above results meant that only Php 30,000 was used to buy up shares even if we had more capital. If we were to use 30% of total capital each time to buy shares instead of a flat rate 30k, then the results are as follows:


  • Net Profit: 1009.53% (holy cow!!! that's the power of compounding for you!)
  • Ending Capital: 1,109,525.93
  • Total Trades: 286
  • Winning Trades: 86
  • Losing Trades: 200
  • Win Rate (winning / total trades): 30.07%


Next up, we have EMA 13/48 Golden Cross Results. I chose 48 instead of the 48.5 because Investagrams doesn't allow for decimals in their chart settings for moving averages. Also, I did an EMA(48) vs EMA(49) backtest over the same period, and the EMA(48) had better results.

So, EMA 13/48 Golden Cross with flat rate of 30k pesos purchase per stock:


To summarize EMA 13/48 Golden Cross Results:
  • Net Profit: 583.05%
  • Ending Capital: 683,046.60
  • Total Trades: 382
  • Winning Trades: 105
  • Losing Trades: 277
  • Win Rate (winning / total trades): 27.49%
If we were to use 30% capital instead of the flat rate, the results are as follows:
  • Net Profit: 1323.2%
  • Ending Capital: 1,423,015.75
  • Total Trades: 352
  • Winning Trades: 98
  • Losing Trades: 254
  • Win Rate (winning / total trades): 27.84%
Here's a side-by-side comparison:


And there you have it folks. EMA 13/48 has a slight edge over SMA 20/50, but in all honesty, both systems are profitable. You just need to decide which one you are more comfortable, and more consistent with.

Belated Happy Chinese New Year and may God bless your investments.

Cheers!
Weekend Trader

Tuesday, January 8, 2019

Guide on how to use the End-Of-Day (EOD) Scan Results

This is a guide on how to use the End-Of-Day (EOD) Scan Results that I post everyday. If I miss a day, it will be because I came home from a long day at work and likely crashed into bed to sleep. In that case, I will post the scans as early as I can the next morning.

For the majority of the examples, I will use the EOD Scan Results of January 8, 2019. See image below (click to enlarge).



Let's begin by starting from the top left corner.

1.) Parabolic Scanner by Spyfrat and Pethuel Pomaloy

I have been a long-time follower of Senyor Spyfrat and his RSI(30) system, but it wasn't really until I read the articles of Senyor Pethuel that I really "got it". I highly recommend you read his blog at Medium.com to fully understand and appreciate the system.

Part 1 can be found here: Parabolic Burst Continuation

Part 2 can be found here: Parabolic Theory-Based Stock Trading

Part 3 can be found here: 2ND UPDATE: Parabolic Theory-Based Stock Trading and Some Reflections

Now, you might notice that I put a note below the Parabolic Scanner Box to state whether the scans are based on Daily or not. This simply means I used the scanner on a Daily time frame. Remember, if you read Sir Pethuel's articles, his scans are based on a Weekly time frame. I post the Parabolic Scanner Weekly time frame on FRIDAYS or weekends if I'm not too tired from work sa Fridays.

Here's the difference. For Daily it will look like this:

For the Weekly scans, it will look like this:

Priority is simply RSI Weekly minus RSI Daily. This is useful if there are multiple results. If memory serves me correctly, Sir Pethuel stated that the one with the highest priority should be entered into first, followed by the next and so on and so forth.

Why do I post daily scans when I can just post weekly scans all the time? Because the resulting data would not be accurate. If I used the weekly algorithm to scan on a Monday, the algorithm will reach back into the past week since it needs to calculate for 5 trading days. More often times than not, this produces zero results. So I opted to adjust the algorithm to work with daily data to show stocks that went parabolic on a daily time frame, but keep in mind that those that went parabolic on a daily time frame are high-risk plays.


2.) EMA 13-48.5 Golden Cross with RSI(28)


We tend to think that by tinkering with the parameters of our indicators, we will be able to improve our trading edge in entering setups. The problem is that we rarely back-test these parameters. Well, someone actually did, and across multiple international markets and across multiple time frames (e.g. Daily vs Weekly vs Monthly).

For as long as I can remember, the "Golden Cross" setting was supposed to be SMA(50) crossing over SMA(200), but as ETFHQ's blog shows, this is far from the truth. Based on his back-testing, the best combination for the Golden Cross is EMA(13) and EMA(48.5) on a Daily time frame. If you're an Investagrams user, just replace EMA(48.5) with EMA(48). I don't think 0.5 makes a big difference.

Why EMA? Just explore his blog, and you will find why EMA is superior to SMA.

You can find the article here: Golden Cross – Which is the best?

He also states that Fractal Adaptive Moving Average (FRAMA) is the best "moving average" indicator, but I'm still working on that. Will let you all know once it's up and running.

As for the RSI(28) setting, I read his back-tests on Technical Indicators - the fight for supremacy. He back-tests Stochastic, MACD, RSI, and others I don't know about, but these 3 have been completed and have results. Based on my reading, it was only RSI that had a "positive conclusion" wherein he states the following:

"Never before have I seen such a dichotomy of profitable and unprofitable trades when an indicator is above or below a level as is the case with the RSI being above or below 50.  This proves that momentum is a strong and valuable predictor of market direction and the theory behind the RSI is sound."

Kudos to J. Welles Wilder Jr. for making the RSI. It's my favorite indicator (obvious ba? hihihi).

You can read the entire RSI test results article here: Relative Strength Index (RSI) – Test Results

What's so weird is that Senyor Spyfrat had already been using the RSI(30) wwwaaaayyyyyyy before this test was performed! That's why Spyfrat is LEGENDARY!

Whether to use RSI(28) or RSI(30) is entirely up to you, but the scans will be sticking with RSI(28) to remain faithful with ETFHQ's back-test.

Here is my own back test results from Jan. 1, 2010 to Jan. 1, 2020

3.) 55 Day Breakout with Momentum Rank

Have you heard of the Turtle Traders?

This is the story of how a group of ragtag students, many with no Wall Street experience, were trained to be millionaire traders. This story answers the question of whether great traders are born or made. 

You can read the summary here: Amazing TurtleTrader Trading Story

Try to get your hands on Michael Covel's book, The Complete Turtle Trader to understand the rules that the Turtle Traders followed. I know there's a PDF version out there.



The Turtles followed two systems; System 1 and System 2.

System 1 used a 20-day breakout for entries with N as a measure of volatility (an equivalent of the present-day ATR, so just use ATR if you wanna use the N as a stop loss). I felt that System 1 was too complicated and had more probabilities of giving false signals, so I didn't like it too much since there were other signals that you had to look out for.

Example: If previous 20-day breakout was a winning trade, you do not enter this current 20-day breakout. If previous 20-day breakout was a losing trade, then you enter this current 20-day breakout.

Sorry, but having a full time job doesn't give me the luxury of keeping track of previous 20-day highs.

System 2 used the 55-day breakout for entries and had much simpler rules. If a stock broke through its 55-day high, you entered no matter what. System 2 was a fallback should System 1 provide a false signal.

Nice and simple.
Me likes.
Yes, please.

I use Donchian channels to monitor 55-day breakouts in my charts (Investagram has it) as well as to plot support and resistance levels (use weekly time frame). Try it out.

Recently, I've added a momentum rank feature to it. This is because if we get multiple results, how do we know which one is the "best"? Thus, the momentum ranking system will guide us with which stock we should be prioritizing, ergo, which stock we "should" be entering into first.




4.) 52-Week High/ Low


If you're a trend follower, you should already know why you ought to be buying 52-Week Highs. 52-Week Highs have the value of 1 (signifying "True", zero means "False") under the 52-Week High column, and is colored blue. I'm too lazy to change the code to True or False right now...maybe I'll do it over the weekend...get it? Over the wee....never mind.

For bottom pickers, the 52-Week Low is for you, but make sure that this is paired with a bullish divergence. For newbies, just google Divergences and you'll be good. Under the 52-Week Low column, the value is 1 and is colored red.

If you want articles, here's one by Senyor Pethuel: Trading the 52-Week High Breakout

I have another one, by North Star, but we'll get to that shortly. It's covered in the RSI(14) Weekly over Lvl 70 section a bit further down.

5.) Guppy MMA Crossover


Developed by Daryl Guppy, an Australian trader, the Guppy Multiple Moving Average(MMA) is a nice and simple trend following system.

You can read about it here: Guppy Multiple Moving Average - GMMA

He also mentions in his book that to create a scan out of the MMAs, you simply get the sum of the moving averages for the Short-Term(ST) Traders, and for the Long-Term(LT) Investors. If the sum of these 2 averages make a golden cross(ST over LT), then that's your "entry signal".

CAVEAT: read up on how Guppy uses trend lines as well as how to use the Guppy Count Back Line(CBL). In my experience, the MMA by itself is incomplete and is prone to whipsaw when the market is not in a trend.

You can read about the CBL here: COUNT BACK LINE™
Great tool as a stop loss and for determining entry levels.


6.) Volume Spike


A simple scanner for irregular volume. Ave. Vol is simply the average volume for the past 250 days. 52 Week High volume is the highest volume reached in the past 52 weeks.

This is good for stage analysis of stocks. For example, if a stock has above average volume but price hardly fluctuates, this means that someone or some people are accumulating large number of shares without trying to make the price explode.

7. Momentum Rank: Top 10


I am a momentum trader. To be more specific, I am a systems trader with a momentum model. I developed an algorithm to measure the momentum of a stock and assign it in ranks. This is based off of the research by Jegadeesh and Titman. The article was published back in 1993 in the Journal of Finance and discusses why you should buy winners and sell losers, though I read it only in 2017.

You can read the research paper of Jegadeesh and Titman here: Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency

Since you don't know about my system (just yet! 😉), how I suggest you go about it is, you start from the top, in the case of the image above, you start with GREEN. You check GREEN's stock chart, check support and resistances, check RSI / MACD / DMI / Stochastic / bearish divergence / hidden bullish divergence / etc.

If you like the chart, then buy. If not, move down to the next in line. This gives you a nice and simple list which shows stocks that are already in an uptrend.

If you want to know how to implement my system, I have a 2-part article for it.

You can find part 1 here: How to implement a Systematic Portfolio Trading Strategy thru Momentum

It's a but outdated, but you can find part 2 here: Implementing the Momentum-Based Systematic Portfolio

8.) Sector Analysis


The Rate of Change (ROC) concept is the same one that I understood from Jegadeesh and Titman's research. I used a 60-day ROC to see which sectors of the PSE were profitable.

Blue means positive ROC, and red means negative ROC. The higher the ROC, the better. In the picture example above, you should be checking out stocks in the Financial Sector, followed by the property sector, then holdings, and so on and so forth.

This is meant to supplement the other scans. Actually, each one is supposed to supplement the other. So yeah...ok, moving on.

9.) Bullish Divergence Scan & 10.) Bearish Divergence Scan
I remember reading an excellent post about Divergence by Trading Naked. Sadly, his website is down and the only copy I could find is in Scribd, which asks for a USD 8.99 membership fee. It has a 1-month free trial so you can get it that way, I guess. Sorry. I don't like risking my credit card online when I don't have to.

Anyway, the key takeaway was that divergences should be treated as an indicator and NOT an entry signal. Just because you see a Bullish Divergence doesn't mean you enter right away. You wait for other entry signals such as breaking through resistances or making a new 55-day high or RSI(28) crossing above level 50.

Another good divergence article is by babypips.com. You can find the divergence section here: Trading divergences


11.) RSI(14) Weekly over Lvl 70

This is a scan I made after reading North Star's blog (yes, the North Star we mentioned earlier in the 52 Week High/ Low section). You need to read it because he tries to dissect the way the ZeeFreaks tribe enters a trade.

You can find the blog post here: Trend Following - Reverse Engineering ZF System

12.) RSI(14) Weekly below Lvl 30

The opposite of RSI(14) Weekly over lvl 70. Use at your own risk. This is useful if your a bottom picker.

Best to use as a watchlist to look out for bullish divergences.

13.) RSI(28) Crossover Lvl 50 with Momentum Score

As discussed in the EMA 13-48.5 Golden Cross with RSI(28) section, this is purely the RSI(28) that crossed over level 50 where previous candle was below level 50. Remember the ETFHQ article? Here's the link again to save you the trouble of scrolling up: Relative Strength Index (RSI) – Test Results

I paired it up with the Momentum Rank so we can have a prioritizing method. Remember, just because the score is negative, it doesn't mean that you automatically ignore it. The score is simply there to help us rank the stocks from best to worst.

14.) Mod TTS2 *New addition*
Abangan. Coming soon to theaters near you.


And that's it! Use each scan type in relation to the others. For example, if a stock made a 55 Day breakout, check if it made a 52 Week High, and if there was a volume spike. Is it part of the Bearish Divergence list? Is RSI(14) Weekly above lvl 70? So on and so forth.

So there you have it. Remember... you need to make a system that fits your style, risk profile, and personality. The scans are simply there to help. In the end, it is just you and whichever system that you can be consistently profitable with.

FYI, I hardly check the comments of this blog so let me know if you have anymore questions by sending me an email: weekendtrader1@gmail.com

or feel free to add me in facebook.


God bless and more profits to you!

-Weekend Trader

Thursday, August 30, 2018

Historical Stock Dividends, Stock Rights Offerings, and Par Adjustments

This is based off the work of  The Dividend Observer. His website is no longer running,  so I mean to carry on his work.If you are reading this Sir, thank you very much for all you have shared.

For those wanting it in excel format and in alphabetical order, here's a link to the file in my google drive: Excel File as of October 2021

email me if you find any data that is incorrect: weekendtrader1@gmail.com
I hardly check the blog for comments. Thanks!

Last date of edit: October 08, 2021.
Additions:
1. Added COL Par Adjust for Jan. 12, 2021
2. Added MFIN Stock dividend for Aug. 23, 2021.






Wednesday, August 22, 2018

Investagrams was down, so I took the system live - update.

Screenshot of one of the 6 portfolios I'm handling. 

Percentage profits might seem nice, but when you look at the actual gains you might become dismayed due to the small amounts. 

However, look at the portfolio gain. 10% in 2 weeks. 
This system is a slow but steady one that allocates smaller positions to reduce risk and, most of all, anxiety. And before I forget, entries and exits were not timed. 

Here's a screenshot of another one with an 8.54% portfolio gain.


I never looked at charts during implementation. Imagine if you did...
I've already posted the how-to in my blog.

The process is 100% systematic (lookup discretionary vs systematic trading), but this is how I would define it.

Discretionary traders look at chart patterns, breakout systems, divergences, 52 Week highs, etc. When looking through all these charts, do you think you would be able to analyze them without bias? What about entry levels? Where would you look to enter? 

"Wait and see first might be a better decision, right? Oh no! it exploded the next day! I knew I should've entered yesterday! Next time, I'm gonna enter if the same pattern occurs.

Oh look! it happened in another stock! ok..I'm gonna buy...

Next day: WHAT?!?!?! Why did the stock drop?!? It made a breakout yesterday and even with volume? Why is this happening?!?"

Something like the above has happened to me countless times. And would've continued to happen if I kept on trying to be a discretionary trader. Just look at what happened to BCOR last week.

Now, if you've been in this game long enough and have the correct mental attitude and discipline like the people from Zeefreaks' tribe, Spyfrat, Boomietrader, and many others, then that is well and good. 

BUT, if you don't have this godly level of control and discipline just yet, stick to blue chips while you practice, or better yet, use Investagrams' virtual port while you develop your system.

Caveat and God bless your investments.



Sunday, July 15, 2018

Investagrams Virtual Port Week 3 (July 16, 2018)

The following actions have been taken with our portfolio in the past week:
  • Sold IRC last 7-11-2018 due to it violating our hard stop loss of -10%. Added to blacklist.
  • Sold MHC last 7-13-2018 due to it violating our hard stop loss and ended at -14% EOD. Added to blacklist.
  • Will sell LMG on Monday, 7-16-2018 because it is no longer in the momentum ranks list.
With the freed up capital, we will be making new purchases.
  • ISM - no good since ATR position size states to buy only 795 shares, but at 2.75 pesos, minimum boardlot is at 1,000 shares. Pass for now.
  • WIN - same as ISM. ATR position size is below minimum boardlot. Pass.
  • ORE - will buy 2,000 shares come Monday's open.
  • ANI - will buy 500 shares on Monday's open. Although ATR position size states 700 shares, however we have run out of capital and can only buy 500 shares. As I was buying the shares on Monday, 7-16-2018, I forgot that we already had 600 shares of ANI, so I moved on to the next stock in the list.
  • HOUSE - bought 1,100 shares at 7.25.
Below is a photo of the updated Dashboard (click to enlarge).

Since Week 1, two weeks have passed (Week 1 to 2, then Week 2 to 3). Week 2 to 3 was rather bumpy, but our portfolio is still up by 2.51%.


Let's see what Week 3 to 4 brings.

Also, if it would be your first time entering, and you see IRC and MHC in my blacklist yet they both are still in the Momentum Ranks, should you buy them? The answer is yes. Your entry price would be different from mine, i.e. lower. What matters here is the momentum and how the stock adheres to that momentum without violating the trend.

Caveat and God Bless!

Tuesday, July 10, 2018

Investagrams Virtual Port Week 2 (July 10, 2018)

Week 2 with our Investagrams Virtual Port shows that we are up by 4.74% (click on photo below to enlarge). Nice and steady, nice and slow, nice and systematic.



You can access the Dashboard and Momentum Rank sheets in the Weekend Traders FB group: https://goo.gl/Wxg7zv

Or you can access them thru my google drive: https://goo.gl/DjQbrX

Since I was attending a wedding from July 5 to July 9 in Guiuan, Samar, I wasn't able to perform my weekly rebalancing check over the weekend. I still can't believe I was made into a Ninong...my golly, I'm that old na pala? Toink.

After copying the Momentum Rank 7-09-2018 into my MOMENTUM Dashboard, I saw that no action was necessary since all stocks purchased in week 1 were still

  • in the momentum ranks list.
  • did not go -10% or below.
So no stop losses were necessary. I merely updated my column P to R to reflect that I had performed my duty as of July 10, 2018 stock rebalancing, and copy and pasted the active cells in my column F to N to update my journal/ trade history.

Anyway,  it can happen. Whether it be a family emergency or you are on a business trip, or attending a 3-day conference. Did it matter that I skipped a day, in the immediate short term, yes. But in the long-term, NO. Our portolio is up and doing well.

I checked the port on Saturday  and saw IRC and....I think it was MHC, were down -9.35%. I wasn't concerned because our position was volatility based and a -9% drawdown was only -200++ pesos. At that time, ATI was also up by 20%++. Was I ecstatic? No. Because one stock's performance should never cloud your judgement over the entire portfolio. That's the beauty of systematic portfolio based trading since you are looking at the big picture all the time.

Like I always said before, I am not criticizing discretionary traders. These guys make the big bucks by being full-time traders earning 6 digits over a span of a quarter or even a month. They are living the dream.

I wish I can be like them, but I know myself and being married and preparing for a child, I cannot allow myself not to have a stable income from a job.

If you're like me who wants more than your fair share of the market, then do this system. If you think the system is too complicated, read John C. Bogle's book titled: The Little Book of Common Sense Investing. Focus on buying Index Equity Funds which have the lowest cost, or simply buy FMETF using peso cost averaging.

If you can read charts, then a better approach would be to buy FMETF if the index is above the SMA200, and sell once the index goes below it.

Either way, reading too many books, and joining too many fb groups can just increase noise for you and make you forget the Mission which is to make your money grow above inflation. If you're like me who has a job and can't be a full-time trader, acknowledge that fact. Accept it. And make the best out of the cards that you have.

Caveat and God Bless.




Wednesday, July 4, 2018

Investagrams Virtual Port Week 1 (July 3, 2018)

I started a virtual port with investagrams yesterday, July 3, 2018 with 50,000 capital. I'll go step-by-step on how I went about purchasing the stocks so you can follow.

Step 1.) Import the Momentum Rank 7-29-2018 list into the MOMENTUM Dashboard. Simply copy and paste all the data from the Momentum Rank list into the provided area in the Dashboard. I do it by selecting all the cells in the Momentum Rank, then I go to the Dashboard, click cell A1 and paste or CTRL + V.

You can access the Dashboard and Momentum Rank sheets in the FB group: https://goo.gl/Wxg7zv

After that, copy or type down the stocks from column A into column F as shown below (click image to enlarge):



Step 2.) Determine the position size to be purchased by using the Boardlot table in columns V to Y. The sizes are based on 3 things: 
  • ATR or volatility (column I. System generated.)
  • Risk Factor (I used 0.004 in this case, in cell P2. Manual input)
  • Capital size (50,000 for the virtual port in cell P1. Manual input)
For example, IRC has an ATR Size (cell  K2) of 1,965. Based on the boardlot table, IRC's price of 1.39 per share will allow us to buy 1,000 shares per lot. So I put down 1,000 shares in column L (Actual Size to Buy). I also do this for RWM.

For JAS however, the boardlot size is larger than the allowed ATR size, so we do not buy any shares with JAS since doing so would exceed the volatility sizing allowed by the system.

We continue to do this until we run out of money/ capital, which in this case means we can only purchase 200 shares of WLCON.

Step 3.) Per purchase, I copy down my entry price for tracking purposes. I then update my record in columns O to Q.

Step 4.) Next I copy columns F to N (those only with entries, as selected and shown below).

Step 5.) And I go to the Action Taken sheet and paste it there (see below).

This acts as my trading journal. If you need a reminder of the buy and sell rules, you can just click the Buy Sell Cut Rules sheet.

And that's all there is to it! Current portfolio performance as of this writing can be seen below.

After End-Of-Day, I will check the port if there is any stock that went below -10%. If there are, I will immediately sell the stock in the next day's open. With the freed up capital, I won't make any purchases until the next stock rebalancing which occurs on Mondays.

If you have any further questions, just join the Weekend Traders FB group.

God bless!