My Journey to Fully Automate My Trading: Can’t Believe Two Months Have Passed

image

Last week marks the end of my second month of automated trading. It was a relatively quiet month with not much activities. Since everything is working smoothly, it is time to raise the number of contracts again. It will be interesting to see what happens when volatility picks up again at this all time high level in the indices.

My reference account is now opened at Striker. Interestingly, due to various delay, the actual trading started from May 1st. It is now trading Big-Game Hunter ES, my first trading strategy offered there. As part of my plan to make things as transparent as possible, the actual statements will be made available for download. It also opened the door for me to openly discuss the trading results without the issue of legitimacy.

I will work with my team to figure out how to offer the viewing of the statements more effectively.

Striker will also have a page in their site reporting the actual results based on the accounts trading Big-Game Hunter ES. I will post the link and other related information by the end of this month.

Next step for this project is to get more trading strategies to go live. So back to development mode and focus on getting these other strategies ready!

More Trouble from Hackers

image

I spent at least 20 hours this week working with my team to defend DaytradingBias from all kinds of attacks by hacking robots. It is mentally exhausting when we think that we have fended off the hackers already and then another class of attackers swamped the site again. And again.

We ended up using multiple layers of defense to protect the site but even now these bots are still knocking at the door.

Although they failed to hack the site so far (touch wood), they are causing inconvenience to my site members.

These bot attacks overwhelm the server from time to time affecting the normal services provided by the site.

I cannot understand why the bots like my site so much.

Very frustrating but I am still hopeful that we will contain the problem soon.

And for those of you curious like where the hacking bots are coming from …. they come from everywhere. If you guess that the majority of these bots are coming from Russia or China, you are wrong.

DaytradingBias was Brute Force Attacked and Luckily Survived

image

Last two weeks DaytradingBias.com experienced multiple incidents of database issues causing the site not reachable at times and also database corruptions. Due to the fact that we were doing major updates to the site, we thought it was probably related to the changes we made. I was forced to restore the site to a backup copy and ended up losing several days of posts and updates. Everything looked normal for a day and then the problem resurfaced again. With help from the hosting company and several experts, we finally realized that DaytradingBias was attacked by a swamp of robots.

It was really our fault – when we’ve decided to update the site about a month ago we found that we need to disable the security plug-in in order to install various new functions into the website. We disabled the security plug-in but then totally forgotten about it because nothing bad happened and we were just very happy with the faster and improved backend. Little did we know the site was being probed on its weaknesses already.

The attack was brutal. Based on the logs, there were like a thousand login attempts per minute at the peak of the attack. Although the site was not hacked, thanks to the basic measures we took originally to protect the site without the security plug-in, but the site was so overwhelmed by the amount of traffic hitting it that it crashed several times. We have no idea back then it was an attack.

I learned something out of this experience. First, the wordpress platform turned out to be one of the most targeted platform by hackers. Second, the hackers are way more sophisticated than last time DaytradingBias was attacked years ago.

It was really luck that DaytradingBias was not compromised this time. Hopefully the security measures we now put on is enough to stop similar attacks from affecting normal operation.

For now, my team can finally take a break. Right on Easter Friday too.

Happy Easter!

My Journey to Fully Automate My Trading: Radical Transparency

image

One principle I’ve decided to follow in documenting this journey is Ray Dalio’s radical transparency. To be honest, radical transparency may not be such a good idea for many organizations or businesses. For trading and investing, however, it is a very interest model that can root out, if not all, majority of the human weaknesses, from affecting the performance. But I am not doing this just for performance sake. I am doing it for other reasons too.

What Do I Plan to Make Transparent

I have just arranged with Striker Securities to allow automated trading on one of my trading strategies on restricted number of contracts. And I am signing up with them as the first person to trade it. This will allow me to fully disclose the trading results without affecting my privacy in other areas of my private life. There will also be the third party witness, namely Striker, that can track the overall results of my trading strategies traded through them.

So there is nowhere to hide. I will report the results here regularly. I will be held accountable for what the strategies do in the future.

It will be a really interesting experience as I never need to answer to anyone else in public about my trading results.

What I see is that this process will help me discover better ways to trade even faster because of the accountability I put onto myself.

To Inspire

Many traders choose to trade discretionarily because there is really no other alternatives offered to them.

And they are being put into a path of self-destruction without knowing about it.

By putting myself out there, showing them that there is a way to make trading work for them, I hope I can inspire many aspiring traders to sit down and think about their trading seriously. Maybe there is a better way to learn to trade. Maybe it is time for them to look at trading from a different angle.

My point is simple. It is really not necessary to go through the brutal mental and physical challenges to make trading working for you.

Personal Vendetta

Ever since I “came out” to write about trading many years ago, I was and still am being trashed by trolls and enemies I made in the industry over the years. They could not argue with what I wrote because what I presented to the world has been undeniable evidence on how the markets function. So, they thought they are so clever to go for personal attacks. Little did they know that my experience in trading and every part of the industry is something beyond their wildest imagination.

This time, I am going to take this to their doorstep.

Would they dare to do what I am doing here?

FAQ: My Morning Routine

image

For some reason people are really obsessed with morning routines lately because all these “successful” people all have their morning routines that help them conquer the world. I get the same question a lot lately so why not share it here.

First, my morning routine follows a pretty fixed structure but the components for each part changes according to my circumstances. I have to adapt to the situation because I have to travel from time to time to look at new investment opportunities and also managing my businesses in other parts of the world. Depending on the amount of time I have before some pre-scheduled activities, I choose among different options to complete my morning routine.

Wash My Face Cold

Where ever I have access to ice or ice cold water, I wash my face with that. And it’s the first thing I do after waking up.

There are many parts of the world where you cannot do that though and washing with normal tape water or even bottle water is all you can do.

But I never wash with warm or hot water.

Simple Stretching

I rotate through different sets of stretching depending on the amount of time I have. So it can go as short as a few minutes or as long as 10 minutes. I may even skip the next step of doing my wake up exercises if I my body is sore from heavy duty training sessions from the day before.

There is one set of stretches I do that came from classic Chinese martial art training. It is a combination of stability, strength and stretch. If I am doing that, I can definitely skip the exercises. I will post a link if I find a video on that.

Wake Up Exercises

A simple combination of doing push ups, leg raises and squats one set each would take less than 5 minutes. I would do that when I have an area to lie down on the ground.

When I have the proper equipment I would do pull ups and other exercises.

This is not full session training. Just a way to wake up the body with the goals of pushing for reasonably higher heart rate and better blood circulation. So using each major muscle group once is enough.

This can go from 5 to 10 minutes depending on the pace and the amount of time I have.

Deep Breathing

The kind of breathing exercise I do varies depending on what I want to achieve for the day.

If I skip the wake up exercise, I would do more types of breathing like rapid abdominal breathing to at least activate the abs.

This takes only a few minutes.

Mind Priming

As oppose to jump into the day to think of what to do and what has to be done, I round up the routine with relax breathing while thinking about things in my life that I am grateful for. It is a very powerful tool that anchor oneself to reality with a positive attitude.

It only takes a few minutes to complete this part too.

This is the last part of my morning routine.

Mind Wandering

When I am not on a tight schedule, I would allow my mind to wander around with new ideas. It may come from reading a book. It can come from reading an article online. It may even happen when I am looking out of my window.

The reason for doing this is that after the morning routine, my mind is at the peak of its clarity from the conditioning. It is the best time for me to figure new things out. Many of my creative ideas from new trading strategies to business planning are coming from this deliberate practice of mind wandering.

End Notes

I complete all these tasks before I sit down for my first sip of coffee.

I do not eat breakfast. My first meal is often my lunch. And my lunch is often done over meetings with my business associates to save time.

If you want to duplicate what I do, remember the following rule:

It is very important to do all of the above except mind wandering to focus on the task you are doing and feel it through your body. Do not think of anything else. You should not be able to think of anything else if you really pay full attention to how your body feels.

The whole purpose of having a morning routine is to condition your body and mind to certain level of higher alertness and calmness so that you can carry out the rest of the day with better decision making which leads to more consistent performance in essentially everything.

Side Notes

Seriously, the routine is essentially the same as practicing traditional Tai Chi correctly for one round. It has all the ingredients choregraphed into its sequence but people rarely realize what they are supposed to accomplish with that. The drawback with doing one complete round of Tai Chi is that it takes more time (30 to 45 minutes) and a lot of space, so one cannot afford to practice that in small place or on a tight schedule.

Ancient people are really smart …

My Journey to Fully Automate My Trading: What I Learned After a Month Into Fully Automated Day Trading on TradeStation

image

I still remember the day I launched my automated trading – sitting tight in front of the screen waiting for something to happen. And then suddenly it is already a month since the launch. Time really flies!

Over this month, I actually learned quite a few interesting things that many you will find useful.

TradeStation Second Login

First trouble I ran into was that once the automated trading went live the account is logged in 7/24 from my trading server. So, if I need to develop new strategy or code on TradeStation I have to remote login to the trading server. That is not a good idea because bad coding and human mistakes can interfere with the live automated trading strategies. It turned out TradeStation can provide you with a second login id. The trick is to use this 2nd id only with the sim account so that it does not interfere with the real trading account.

As long as you do not need real-time data on this 2nd login, there is no extra data fees. I now work happily on my laptop with TradeStation this way. It is a very nice discovery.

Fills are Not as Bad as I Thought

Since I am converting my existing models developed on my proprietary platform into TradeStation, I thought latency is going to be an issue. I am pleasantly surprised that it is not the case. Fills are timely and no real slippage.

It makes sense though.

First, the day trading strategies I converted to TradeStation so far are not my HFT ones. They are slower and just need reasonable execution speed. In the past, internet stability and speed were big issues. Hence people like me did highly customized work with co-location servers near / at the exchanges. From the results so far, those concerns are no longer an issue.

Second, infrastructure has improved so much that order routing at retail brokerages are now much faster as well. So, unless you are really into HFT space, retail day trading in this era is pretty level with the institutions.

Latest Generation Computers are Overkill

TradeStation and many other retail trading platforms used to require serious computing power just 5 to 6 years ago. That is no longer true thanks to the improvement in hardware over the past few years.

You can just pick up a cheap 2nd hand computer with Windows 7 Pro for trading for as low as $300-$400 Canadian dollars. It is less than $300 US dollars. The most important thing is to get a quad core CPU so that Windows can run smoothly alongside your trading platforms.

What’s Next

I am converting next set of trading strategies now and plan to incorporate that by end of April. For the first set of trading strategies, I ended up having a complete framework ported over to EasyLanguage. This time, another framework will have to be converted too. I plan to release all these useful code libraries in near future. I just need to figure out how to do it properly.

For example, I don’t see a decent set of functions providing information like holidays and FOMC meeting schedule on any trading platform. But it is critical to know these things even for a normal trader. This is a fundamental tool for building reasonably robust trading strategies yet it is nowhere to be found.

Maybe all the pros are keeping these tools to themselves. Just kidding.

What Supplement I Took to Cure My Seafood Allergy

image

So, people want to know what supplement I took to cure my seafood allergy since I wrote about it last time. I did not put that in the blog because it may not be applicable to everyone since it was prescribed to me by the good doctor. However, for the sake of science, I will cover the topic in more details.

First, my seafood allergy is not something I acquire later on in life. No. It was there since I was born. I know because my mother likes seafood and I was allergic to her milk right from the start.

Second, the supplements I took is a combination of vitamin B12, vitamin A, vitamin E, flax oil and borage oil. Pretty much over the counter stuff you see out there. It is not any special magic formula at all. The most interesting thing though, is that the dosage I took is a lot higher than the recommended daily intake by whatever bullshit standard out there.

Third, the doctor had me taking the supplements for a full month. And he said that I must avoid all allergic reaction during the month or the treatment may not work, meaning that I have to restart the one month treatment after the allergic reactions ended. I was told that once the allergy is cured, there is no need of maintenance of any kind to keep me allergy free from seafood.

On the treatment method itself, I can explain it in the view of traditional Eastern medical practice.

From what I learned when I was young, that for certain types of long term body ailment, Chinese medical doctors often give the patients herbal drugs that mildly damage their bodies to induce self recovery. Moreover, similar to what I was told by this doctor, that if the ailment occurs during the treatment process, the delicate treatment process will have to be done all over again after the ailment is taken care of first.

So the concept is not that difficult to understand. For those who like investigate further, you now know the details.

My Journey to Fully Automate My Trading: Never Day Trade from Your Laptop

image

One extremely silly thing people do is trading from their laptops. There are so many things that can go wrong with that I seriously wonder if the motto “Hope for the best, prepare for the worst” ever come across the minds of these traders. Wireless connection can drop easily at the wrong moment – when you have a size position on and need to get out, or that you need to get into a position yet your order is not transmitted.

So it is not just an issue for mechanical traders. It is something affecting discretionary traders too. So all these people out there showing themselves trading off their laptops, is really doing the aspiring traders a disservice.

The VPN + Remote Control Workaround

The solution is really simple – have a half decent computer installed at home with a stable Internet connection. Run your trading platform on that computer. Problem solved.

But you want to be able to trade from anywhere instead of being confined to the seat in front of your computer at home. No problem – the trick is to connect your laptop to your home network through VPN and remote control your trading computer.

There are many advantages to trade through this arrangement:

– stable connection means active orders and automated trading strategies will not be affected by your flaky wireless internet connection with your laptop

– you can easily upgrade the setup to a professionally managed server that you lease near the exchange for even better stability and security

– minimize the chance of computer virus and other malwares from infecting your trading applications since they are setup on a clean computer, not your laptop for which you may visit one too many times naughty websites

– you can use any kind of computer or tablet to remote access the trading computer. For example, you may love to use Macbook Air yourself for day to day computing but your trusted trading platform could be Windows based application.

– instability of connection to your trading computer from your remote access will not affect the trading application itself from talking to your brokerage, hence your live orders, especially those target and stop orders have a much better chance to survive

There are several ready-made solutions you can try out.

If you use Windows only computers, you can use its built-in Remote Desktop application to access just your trading computer.

If you like to mix and match, TeamViewer is a functional platform allowing you to do the same.

What I Do

For my own setup, I have chosen a barebone core-i7 Windows 7 Pro computer as the trading computer. The reason why I choose Windows 7 Pro is that it is stable and we can easily stop it from getting new updates from Microsoft. It is very important that a trading computer does not automatically doing whatever it feels like and reboot randomly as if it has a mind of its own. On this front, Microsoft has totally failed itself as a mission critical OS since Windows 8.

On the trading computer, it has absolutely nothing except the trading platforms.

For VPN access, I use Softether VPN because I also like to access all the other computers in my home network. But you can keep it simple with just standard Microsoft Remote Desktop to access the trading computer only by poking a hole to your home network.

I often have to travel and this setup with the trading computer safe and sound in a secure location makes it much easier for me to monitor the automated trading from anywhere in the world.

I am very happy with this setup so far and the trading computer has been running 7/24 with no trouble at all for several weeks already. If you are serious about day trading and mechanical trading, consider doing this as soon as possible. I am sure you will be happy with the results.

How My Lifelong Seafood Allergy Was Cured

image

I was allergic to certain kinds of seafood. Just some of them like lobsters and shrimps, not all of them. It has been a lifelong issue since I was a baby. Interestingly, I suppose it is now cured. It is a fascinating story to share.

Being allergic to food is not a minor issue. Many people who do not have such problem have all sorts of wrong ideas about it, making the life of those who have it suffer badly. Unluckily, both of my parents are not allergic to food. Just imagine what traditional parents, both Western and Eastern worlds, do when they think that you are just picky with your food but in fact just one bite would send you to hell.

The story of how bad my allergic reactions were can go on and on for many pages which I am going to skip them all for now. The main point is that my allergy is at the serious level for which rashes would flare up almost instantaneously and other symptoms like fever would follow as well. It used to take weeks of heavy dose of anti-allergy drug to suppress the symptoms until they go away.

The turning point is what I like to focus on here.

My friend found a doctor who cured his son’s allergy. And I saw it with my own eyes that indeed his seafood allergy is gone because he was enjoying a feast of seafood with no problem at all. So I determined to get an appointment to meet with this doctor to see if I can fix my allergic issue for good.

I eventually met with this doctor and went through the examination process. He prescribed a set of supplements for me to take over a month period. I faithfully followed the prescription for the month with a few days for which I could not do so when there was schedule issues.

That was more than a month ago.

Yet, I did not have the courage to try some seafood to see if the allergy is gone. It is not that I am afraid of the reactions themselves. What I worried about is that it would keep me in bed for days which would delay the progress of my projects.

Last week, when several projects were finally completely. I have decided to finally take the ultimate test of my treatment. I ate shrimp. There was no rashes, no itchiness and no other issues whatsoever. Since then on other occasions I tried to eat other types of seafood with no ill effects at all.

I am cured. A lifelong medical condition that is supposedly not treatable is now gone for good. Amazing!

My Journey to Fully Automate My Trading: Your See a Hammer, I See a Doji

image

I conduct my research on trading strategies on multiple platforms from Excel to almost everything that I can get my hands onto. From concepts to actual strategies, it can be as simple as just several lines of code to thousand lines of code. To say the least, It is a long and tedious process that takes patience. Similar to any other scientific research, even if your method of analysis is rigorous, your analysis is as good as your data only. If the data you get has consistency issues, your analysis will be questionable. And here I am, dealing with exactly that – data inconsistency across various data sources made available to retail traders.

Forex Traders Live With Data Inconsistencies All the Time

This data inconsistency issue is very common with forex trading. In general, the quotes you are getting are just consolidated quotes from several major banks that a brokerage has clearance through. Hence if you switch to a different brokerage that use some other banks for their forex clearance, your quotes would be drastically different. You may wonder why that matters since the price would be moving in the same direction within seconds. After all, due to arbitration opportunities from this type of discrepancies, they will be taken advantage of and quotes across different sources will go back in sync quickly. However, this minor difference can alter the decision making process on hundreds if not thousands of autotrading robots when a binary condition is flipped from one way to another.

For example, an hourly closing price can be very close to the previous day closing price. Many simple trading algorithms and human traders will take the cue very seriously whether such closing price is above or below that reference price level. Drastically different actions would be taken based on that simple logic alone. Hence, many professional traders never change to a different data source for trading because they know very well that such difference can lead to disastrous effect on their trading.

Centralized Trading at Exchanges is Supposed to Avoid this Problem

For index futures like the Emini S&P and stocks, they are traded in various exchanges with centralized bid and ask queues. The quotes are unified with trades recorded in sequence. Ignoring the dark pools which are not part of the normal markets, the centralized trading of these markets is supposed to avoid this inconsistency in data issue completely. In fact, we do get very clean historical data for all these markets going all the way back for at least 20 years.

So the data inconsistency problem should not exist with these markets, shouldn’t it?

Well, that’s not what I find out from my back testing of the same trading strategies across various platforms on Emini S&P.

And after careful analysis of the different versions of the algorithms based on the same logic, I discover the root cause of inconsistency in historical trading performance has nothing to do with my code. Luckily, I have experience is dealing with such issue with my forex trading so it does not affect me much. I am just surprised that the problem of such inconsistency still exists today.

Welcome to the World of Sub-Second Timestamp

On tick data resolution, meaning that every single trade is being compared, there is really ignorable differences among the various sources of historical data. This means the centralized trading at the exchanges in fact unified the data. The problem, interestingly, comes from various implementations of data collection methods into time based records.

The issue really boils down to a simple question – what do you consider as part of a one minute interval?

What I am talking about is how a programmer choose to collect data into 1 minute records can make a big difference in the charts you see everyday.

Conceptually, a minute starts the moment right when the zero second mark hit and the it ends right before the moment the next zero second mark is hit. This is pure science. There is really nothing to dispute about this definition. However, the programmers who are tasked to write the code to record the historical data, may have interpreted the concept of a minute with their personal interpretation.

From what I see, there are programmers who keep all the trades that happen with the zero second time stamp (e.g. 1:00:00) into the current 1 minute record. i.e. 0:59:00 to 1:00:00

However, that is technically wrong because all these trades actually belongs to the next minute. i.e. 1:00:00 to 1:01:00

These programmers do not realize there is no such thing that happens precisely at zero second mark. Anything that is recorded with that time, must have happened after. If they pay attention to the fact that these trades are happening between :00 and :01 with sub-second timestamp. e.g. 0:59:00:30

I can tell you that the most expensive institutional feeds have this done correctly. So are the more expensive retail data feeds that you have to pay money for. But not true for many others platforms out there.

Nightmare of Data Inconsistencies

What does this inconsistency implies?

Well, if you use price patterns on intraday data (and on daily data occasionally too) with your trading strategies, you may get totally different results when you switch from one brokerage to another.

Your moving averages are not really that precise depending on which data source you are looking at.

For some platform, your trading strategies do not execute until 1 second later while the institutional traders have a head start of 1 second before you do.

All sorts of technical indicators including oscillators will suffer from this data inconsistency.

It is not just the close of a minute record that is being affected. If the high or low of the minute happens to be the last second and that your feed includes the extra one second of data, the high and low could be affected too.

A Lesson to Remember for All Traders Not Just the Mechanical Traders

I am not saying that the data inconsistency would render intraday price data analysis completely useless. What I am saying is that you have to be aware of this widespread issue to build robust trading algorithms. And it does not just stop there because this matters much for discretionary traders too.

Many people who have never used multiple brokerages and different data sources have a simplistic worldview of the financial data they are working with. They have no idea that when they see a bottom in the making on their trusted 5-minute bars showing a candlestick hammer is in fact just a doji for thousands of traders out there.

Or that they are getting their favourite moving averages making a turn or crossover is just a kiss between those lines for many other traders out there.

Stop seeing the charts in black and white like that is the first step towards a much more robust approach to chart reading and technical trading.