CppCon 2017

I am lucky to be able to attend the CppCon 2017 in Bellevue, Washington for the second year in a row. I am excited to attend the sessions on C++17 as well as the proposals for C++20.

This post is basically a collection of my tweets and shower thoughts from the conference.

Crypto Trading Framework

https://github.com/itsff/m3f-trading-system

In my free time, I’ve been messing around with cryptocurrencies. Bitcoin, Ether, Litecoin as well as a couple of other, lesser known altcoins. I am mainly using GDAX and Bitfinex for my trades. It’s a lot of fun!

Pretty much all exchanges offer some sort of API. I created a simple .NET client for the GDAX and wrote a simple trading framework. I decided to learn the Akka.net actor model for this project, as it makes writing trading bots easier. Speed is not an issue, as I’ve noticed GDAX’s position tracking system cannot keep up with my apps.

Today I have open sourced my framework on GitHub under revised BSD license. You can clone it from here. It ships with a simple “buy low sell high” strategy which illustrates how to consume prices and interact with orders.  More exchange backends to come (or feel free to contribute more).

CppCon 2016

One of the great perks of working at Chicago Trading Company is our conference budget. We get to attend two conferences a year. Even though I just started, the company sent me to Bellevue, WA for CppCon 2016. It was an awesome, seven-day experience! We attended a two-day advanced C++ training session, then spent the remaining five days attending the different CppCon tech-talks and presentations.

I learned a lot, met some of my old friends and made new acquaintances. I even bumped into Bjarne Stroustrup, the father of C++, who happened to be staying at the same hotel. It was great!

My schedule: https://cppcon2016.sched.com/filipfracz (PDF)

By far my favorite session was the keynote by Jason Turner where he built a Star Wars pong game in C++17 for the ancient Commodore 64. It’s really fun to watch, especially the optimizations that the C++ compiler performs on constants. Very neat.

 

All presentations are available on YouTube and the code is on GitHub.

Continue reading

Trump Wall, the game

Political satire

I had too much time on my hands in-between jobs, so I figured I would have some fun. I went to Florida to babysit my teenage sister during her spring break, but I quickly realized it was a pretty boring task. When we weren’t at the beach or driving, we would watch election coverage on TV. Political tensions were flying high. In-fighting within both political parties. Just bring out the popcorn. I was really rooting for Bernie, yet it was Trump who was getting the most press.

I decided to code up a little game in order to capitalize on the Trump love/hatred that was sweeping the country.

Enter: Trump Wall, the game!

Trump Wall has a very trivial gameplay. You are helping the newly elected President Donald J. Trump fulfill his (filthy) promise to build the wall along US-Mexican border. You do so by tapping the square outline of bricks. Obviously, the wall is built from the bottom up (you’ll be surprised how many people get confused by that). And since you start from the bottom, that’s a perfect place for me to place an advertisement banner. The more clicks, the better 😉
You complete the level by filling in all the bricks. Once you get all the bricks, you hear Trump proclaim that “the wall just got 10 feel taller”, and the background moves up towards the sky.

The background is usually a random “Welcome to xyz” sign for the southern states that share a border with Mexico. As you complete more levels, you eventually reach one of Trump’s planes or helicopters. Naturally, the game does not have score “points”. Instead, the score represents a number of pesos spent on building the wall.

 

It obviously wouldn’t be a Trump game, if it didn’t feature Trump’s (in)famous sound clips! (“Who’s gonna pay for the wall? Mexico! Who? Mexico!” “We’re going to have strong, incredible borders!”, and so on). I went through countless YouTube videos of his actual speeches to collect them. I cannot believe people are buying this racist stuff. What a world we are living in!

But what about Bernie? Well, I included Bernie in the game too! As the levels get harder, Bernie’s election stickers stand in the way of some of the bricks. You then really need to mash them in order to make Bernie disappear.

Overall it was a fun side project. Political satire is a great way of poking fun at our presidential candidates. I had no issues publishing the game to Google Play, but Apple gave me some serious grief. I was rejected multiple times and had to remove a majority of the controversial content. I understand they are just protecting themselves, but how is it my fault that we have such a “tremendous” presidential candidate? 😉

You can download the game here.

Continue reading

Docker Compose

While I was working for Trading Technologies, we always planned on using Linux Containers to provide secure hosting of user-written TT SDK algos. Docker was supposed to be the way of ensuring proper isolation, resource management, as well as means of convenient deployment of client strategies. The infrastructure was in place, but I left before we had a chance to materialize our plans.

Recently I decided to give Docker another go, this time as a way of managing my various cloud projects. I was happy with DigitalOcean’s offering, so I began migrating my websites and jobs to their cloud. Everything, of course, is containerized and managed together. I am using Ubuntu 14.04 with Docker Compose.

I must say I am pleased with the results. The migration has been rather painless, and I like how simple the config ended up. I am running a container with a shared MariaDB (MySQL) database, a reverse-proxy Nginx to manage routing, several WordPress blog containers, few C# ASP.NET sites (Mono, not CoreCLR), some Python sites (Flask), and bunch of Python/C++ apps. A sample docker-compose.yml file is shown below.

As you can see, I am using dmp1ce/nginx-proxy-letsencrypt image as a web proxy. Just like with jwilder/nginx-proxy, it’s dead simple to configure routes. All a container needs to do is to specify VIRTUAL_HOST=something.com variable, and the web traffic will be forwarded to its exposed port. Image dmp1ce/nginx-proxy-letsencrypt has LetsEncrypt.org support built right in. Specify LETSENCRYPT_HOST and LETSENCRYPT_EMAIL and voilà- free SSL for your site 🙂

Hacktoberfest

I finally got my Hacktoberfest gear from DigitalOcean. It was a fun opportunity to contribute to open-source projects while scoring a sweet t-shirt.
I fixed some annoying bugs in the weld build system that I’ve been using for my personal C++ projects. Hope you guys enjoy.

Hacktoberfest T-Shirt from DigitalOcean

Naturally this “hacktoberfest” made me take a closer look at DigitalOcean and what they have to offer. I’ve gotta say: I’m impressed! Seldom one finds such fast and cost-effective cloud providers. I’ve been using AWS and CloudAtCost, but now I am seriously thinking of migrating at least some of my projects to DigitalOcean. Well done, sirs, well done!

Six months at Thomson Reuters

It’s unbelievable how fast the time goes by. It was only in January that I started my new role of Lead Software Engineer at Thomson Reuters, and here we are six months later. Lots of things have happened during those two quarters, and I feel I really grew a lot professionally. I am part of a new team charged with revitalization of TR’s data feed architecture. I live and breathe C++14 and low-latency is my middle name 😉Thomson ReutersThomson Reuters is a much different place than any of my previous gigs. It’s a large, mature company with thousands of well-known clients. Oftentimes I need to interface with our developers in St Louis, Beijing and Hong Kong, sometimes at ungodly times of the day. Good organization is key. Our code is also well designed. I must admit this is the first time that I was forced to write extensive unit tests. It took some time to get used to, but now I really appreciate them. It’s much quicker to find obvious behavior bugs accidentally introduced by code changes. I cannot believe I’ve gone so many years without proper unit test coverage.

Despite Reuters’ size, I feel like I have a lot of power to innovate on my and cross teams. This was something I feared I’d lose in a large firm, but thankfully I was proven wrong. There is plenty of autonomy.

And finally – the people. I am lucky to be surrounded by lots of smart, kind people who are a pleasure to work and hang out with. I’m learning tons of new stuff, which is a definite plus. Let’s keep this thing going! 🙂

TT Mobile showcase

My friends at TT are really busy trying to get the mobile clients out the door and into production. TT’s twitter account is buzzing with all kinds of photos and videos. I am really happy and proud of how far my apps have come. The end result is looking beautiful and I am sure the end-users will be delighted by both the design and functionality.

I really enjoyed working on TT Mobile, as it presented a very unique set of challenges. How to effectively push price updates over potentially slow cellular connections? How to ensure users don’t accidentally place trades (butt trading anyone)? And how to effectively integrate with the rest of TT’s eco-system? I think the team did a splendid job and the apps are rock solid. One disappointing fact is that both Android and iOS apps could have been released over a year ago, had we chosen to re-use logic. There are ways to write the code once, and use it verbatim on multiple mobile platforms (naturally the look-and-feel needs to be done separately, so that the app feels “native”). I have long argued with the executives and advocated for shared business logic, since it seemed like a no-brainer.

  • Shorter time-to-market. In today’s fast-moving world it’s imperative to be there first.
  • Lower cost of development.
  • Less bugs.
  • Parallel releases on multiple platforms.
  • Lower long-term maintenance costs.
  • Less testing effort.

Other companies are not as short-sighted and have long recognized the benefits of writing the common logic once, instead of re-implementing it for every platform. Xamarin has their cross-platform C#. Google is pushing Java with its ability to share code between Android, iOS and the web. Dropbox uses C++ for shared logic. RemObjects has their cross-platform Swift. Not to mention frameworks like Flash and Cordova. I still cannot believe that the decision makers would rather have us maintain two separate codebases, but I guess you need to be good at engineering to comprehend the benefits.   

On a positive note, I am extremely pleased with the aesthetics of TT Mobile apps; graphical design and usability are essential. Nobody wants to use an app that looks “f-ugly” or that feels cumbersome. Folks at TT spent countless hours doing usability studies and polishing the design. Trust me – a lot of love went into making of these apps. They look awesome, they are snappy and I really hope you’ll enjoy them 🙂

TT Mobile in Google Play

Today marks an important milestone. TT’s next-generation mobile trading app for Android has been deployed to Google Play Store. It’s still in pre-release and available only to beta testers, but we are getting closer every day. It’s very stable and usable. The overall look has deviated slightly from my original design, but I like it better this way. It’s a little bit more intuitive. Below are the main functions of the app so far.

  • Watchlist of instruments
  • Instrument-centric view of orders and positions
  • Trading from order ticket
  • Trading and order management from price ladder (MD Trader)
  • Order management screen
  • Fills and Positions
  • Forever Audit Trail

The users can input trades from order ticket and MD Trader, monitor orders, have a watchlist of instruments, inspect their positions and watch the forever audit trail. Not too shabby for a mobile app! Very full featured, especially when compared to what’s out there. The team did an outstanding job. Oh, and iOS app is coming along as well.

If you have a @tradingtechnologies email address, head over to the link below and download your copy for Android.
https://play.google.com/apps/testing/com.tradingtechnologies.ntm
(pssst – can’t access the page? Make sure you’re logged in only with your TT account. Try incognito mode)

For those of you who don’t yet have access, take a look at some screenshots below.