When is the best time to enter the stock market?

Short answer: “Today”. Always

Longer answer: Today, unless you’re psychologically stressed out about putting a huge lump sum into the market all at once. In that case dollar cost averaging is a worthy strategy to reduce the risk and stress at the cost of some expected returns

Theory: It is an axiomatic assumption that stock markets will always have an expected (in statistical meaning) positive return through combination of capital gains and dividends. If you don’t believe in this assumption, stock market investing is not for you.

Since stock markets have a positive expected return and cash does not, it follows that the maximal return is to move all cash to the stock market asap. Today.

Does this mean you should move all your money into stock markets? Maximizing return isn’t the only consideration – one must consider risk tolerance too…

Practice: Lump sum investing “today” will work out better 66% of the time compared to dollar cost averaging

Expert view: Vanguard on lump sum vs DCA

“We conclude that if an investor expects such trends to continue, is satisfied with his or her target asset allocation, and is comfortable with the risk/return characteristics of each strategy, the prudent action is Vanguard research July 2012 Dollar-cost averaging just means taking risk later Authors Anatoly Shtekhman, CFA Christos Tasopoulos Brian Wimmer, CFA 2 investing the lump sum immediately to gain exposure to the markets as soon as possible. But if the investor is primarily concerned with minimizing downside risk and potential feelings of regret (resulting from lump-sum investing immediately before a market downturn), then DCA may be of use. Of course, any emotionally based concerns should be weighed carefully against both (1) the lower expected long-run returns of cash compared with stocks and bonds, and (2) the fact that delaying investment is itself a form of market-timing, something few investors succeed at.”

The Bogleheads view: https://www.google.com/search?q=bogleheads+best+time+to+enter+the+market+site:www.bogleheads.org

Author’s view: When I first started investing, I was cautious due to inexperienced so I always DCA’d. I’m glad I did because it reduced my risk and stress levels. Going forward now that I’m experienced, I would always lump sum invest

Strength training and personal investing have a lot in common

I’m one of those outlier people who gets interested in the fields where the majority is usually wrong. Strength training and personal investment are two such fields. (Blockchain is another). And it is this topic I’ll be posting more on my blog!

Strength training and personal investing have lot in common! Firstly, both are a minefield because

  • Most internet information out there is unhelpful or often wrong
  • Professionals make it out like it is complicated and needs you to pay to get the right custom plan
  • Professionals will make overly complicated plans for you
  • Professionals will charge you huge sums for their services just because you don’t know better
  • Over the long term, you don’t get the gains you could be getting due to the cost and complexity
  • What people think is important often is not what is actually important

But if you have the right information in getting started, you can do much better than most of the average punter

  • Investment and strength training are both very simple
  • 2-3 funds, or 4-5 compound lifts are all you need to get going
  • Set a plan and stay the course!
  • It is psychological – it is hard to believe that simple can be best
  • If all you do is the basics, you will be ahead of at least 80% if not 95% of the population
  • The time and effort in self learning the basics are well worth it compared to paying pros
  • All the advanced stuff doesn’t make as much of a difference as one may think, even though it is fun to talk about

Migrating AngularJS html5mode links to Cordova

Gainstrack is implemented both for the desktop and for mobile – a true hybrid app. 90% of the code and views are shared with 10% having to be specifically customised.

One key difference is that a desktop AngularJS app looks much better with html5mode enabled so that URLs look natural without the # character. However, Cordova apps must have html5mode disabled. Thus links in vanilla <a href=”/foo”> tags would only work on one platform or the other but not both (only desktop in this case). It can be worked around by having links on both platforms like <a href=”#/foo”> and disabling html5mode link rewriting on the desktop side. However, clicking such a link on the desktop side would cause a page reload while Angular removes the #.

After hours of trying different solutions including Grunt building two different targets, trying to get html5mode working on Cordova, creating a urlFor method to put links in, in the end this simple snippet solved all problems on the mobile side.

angular.module('Gainstrack').directive('a', function() {
  return {
    priority: 1,
    restrict: 'E',
    link: function($scope, $element, $attrs) {
      $attrs.$observe('href', function (value) {
        if (value && value.indexOf('/') === 0) {
          $attrs.$set('href', '#' + value);

With this snippet only on the mobile side javascript, vanilla html5mode links are rewritten to hashbang links as required on the mobile side. Problem solved

Gainstrack 0.0.8 updates

A critical bug was found in 0.0.6 where one couldn’t edit historic workouts. That’s now fixed in 0.0.8. Assuming no more bugs found, I’ll also push this to the Android store.

In addition, thanks to feedback from “britPaul”, the workout planner is starting to make progress again – it is now unit aware like the rest of the site, able to handle planning in lbs or kgs. A fair amount of work is still needed for it to be truly useful though.

The only other technical update is the removal of the jQuery dependency. AngularJS doesn’t need jQuery and neither do I. That reduces the 3rd party javascript payload by 20%, which should result in slightly faster loads.

One final mention is my anecdotal testing of the mobile site is that it is definitely performing better on my phone! With all the changes, I can’t tell if it is Cordova, Angular or what but the speed increase is definitely useful.

Gainstrack 0.0.6 Updates

The website has been updated and the Android app will be updated in the app store shortly. Feature-wise, the main items are to fix the previously mentioned annoying issues

  • Navigating away from the app mid-workout and coming back – your workout will still be there
  • Using the app without internet reception will still allow you to record your workout
  • A news link so you can see this blog for updates

The last feature is only really for the Android app but if you are using the iPhone app, you can still pre-load by opening in reception and then using while out of internet reception.

Behind the scenes, a bunch of technical updates have been maded

Ideally these changes won’t have any functional changes but should boost performance a little by using libraries a year newer. On the other hand there may be a few glitches on the way. If so, please email or message me.

Annoying issues

So I’ve been back lifting regularly again and therefore been dogfooding my own app and mobile website. I like to log my workouts from my phone as I do them in the gym. Here are the most annoying things about my own app!

  • If you switch away from the app and your phone is low on memory, your workout in progress gets wiped out. Super annoying. (Need to persist progress in local storage to fix it). Workaround: Regularly submit/save and edit it. Pain
  • If you aren’t in internet coverage, it appears as if you are not logged in. And then logging in doesn’t help. Workaround: Wait for network coverage

Chinese new year is probably a good time to address some of these issues! If they are bothering you too are have found other bugs, please drop me an email (just reply to your registrastion mail)

Back with the power cleans

It’s been a while since I’ve been either lifting or working on this site! I’ve been busy with other sports, getting married, honeymoon and all the other things that happen in life.

But then a CrossFit gym opened up near my workplace. Upon visiting, I realised a CrossFit gym (or box…) has all the equipment one would ever need or want for gaining strength. While I’m not so into CrossFit because it trains you to be a more jack of all trades from endurance to strength, even if you’re after strength alone there is something there. Crucially the owners are happy to let me get one with getting strong and missing out on the WODs. And they still help me out with technique. So for the first time ever, I got some education on power cleans.

Here’s my latest attempt at a power clean. While it is me giving the analysis, some of the points (particularly the lack of leg extension) came from the coach there.

Outage from 19th April to 24th April

Unfortunately, I’ve had a difficult time with the backend this past week. The server unexpectedly shut down on April 19th and I wasn’t able to even log into my account until April 21st. Even having brought up the server, I experienced some data screw-ups.

The good news is that although most people couldn’t log any workouts, no data was lost and those of you who were able to log your workouts, that data is all safe as well and should be recovered to their rightful locations!

I’m still working on the root cause but I’m not overly worried as the system operates with numerous backups and the backend data is write-only so no data should ever get totally lost.

Plan your workout before you go to the gym

Failing to plan is planning to fail. Successful gainers know what they are going to do in the gym before they go to the gym. What weights they will do, how many reps they will attempt.

With this in mind, I’m incubating a new feature were you create your workout first – with some help to auto-generate the workout perhaps. Next up is a more simplified mobile interface to actually perform the logging.