4.09.2013

2013: Quarter 1 Results

Yes, I'm alive! More importantly I wanted to share some results. One of the best things about automated trading as that like yourself dear reader, I wasn't sure of how well the strategies have been performing this year; especially those that are not running on live accounts :-) So here's some pretty pictures for you.

The strategy 'b' and strategy 'rs' are both on live accounts. b is one of my oldest strategies; a simple solid performer. rs is something that was moved up at the beginning of the year after very promising results. It's slightly down for the year after a great start. It will be one to watch.
Strategy b
Strategy rs
These are some testing strategies still being run on demo accounts. In general they need various amounts of love before they could be considered ready for live -- some are potentially even unfinished ideas. That said, monitoring how they do is an important part of determining eligibility to move them to live. Hopefully we'll see some more ideas be added to this list as the year goes on.

This one might be turning around. Might just need some tweaks.
Strategy con

Hmm, not so good.
Strategy cor
 Up/down? Movement? I'll have to dig into the basically flat results here.
Strategy l


5.16.2012

Tunnel Vision

Whoosh! Gone is the spring! Well, things have been ticking along on the trading front, and recently I found time to dedicate to coding again :-) There were some design changes to make and some wishlist items. But most importantly, there were strategies to port to the new abstraction layer. They haven't been running in some time due to the switch.
I spent a few hours this past week in earnest porting the strategies and making them work, adding new features to the common framework in support of the strategies, etc. It was only once the first one was running that I begun to wonder -- what in the world is this strategy attempting to do?
While I do like to think I do an honest job of commenting my code, it could always be improved. However the worst part of trying to port the code was the fact I failed to comment (aka, in simple concise English) what the purpose of the strategy was! This omission found in my earliest work was noticed and rectified at some point, but this strategy pre-dated that.
Desperately I searched through my revision history to find an older version that was perhaps simpler and more likely to be understood. Looking at the old version (before porting) did answer my question, but not in a good way. I now understood what the strategy was doing, but I hadn't a clue as to why. It simply made no sense at all.
This sent my head spinning -- I opened up some of the current strategies and although successful, they made no sense to me. I've simply had tunnel vision for too long.
Here I have been porting these things to run in the new and improved layer (making coding a strategy much simpler), but now I have no idea what the point and purpose of the strategies I have running and/or am porting is. I still have the idea of the general concepts of strategies I wish to employ -- some that should perform better in trending versus ranged markets, etc. However, the execution and implementation of those strategies seems to have gotten lost in the focus of coding the framework and making things robust. Time to sharpen my pencils and step back for a minute.
I realize I haven't looked at a chart, I mean really looked at a chart in a long time. Far too long.

2.08.2012

Price Feed Success

Success! I have implemented a proper notification failure system as well as solved the disconnection issues I have been having with my price feed. It seems my request was a bit malformed, and overall everything is running much snappier now. I am retaining the idea of a backup fail-over feed "just in case" it is needed, and the coding is done on that as well. However, I did shy away from having automatic fail-over, so for now, this will be a manual thing if needed. I hope the days of endless disconnections are gone now.

1.28.2012

Price Feed Failures

Lately, I have been having trouble keeping a connection to Oanda's pricefeed. I keep getting disconnected and then eventually my programs tolerance level is exceeded and it times out and dies. If you will recall, last year I migrated everything to the cloud. Sadly when I did that migration I failed to replace my fail-over system which alerted me when failures like this occurred so I could take action. Since my desktop was my trading server until that point, it was simple enough to have alerts be generated on it to awaken me even from sleep if necessary.

Due to programming changes I made in separating out the individual bots from the price feeds, the bots themselves are completely unaffected by the price feed failure, at least from a technical standpoint. From a practical standpoint, they will not be getting any updated pricing information, and will therefore not be able to properly manage trades. I think the next step here is to implement some more automatic failovers to potentially other datafeeds if necessary. I have found a couple potential feeds that can work as a failover in a pinch -- the question is would you rather have data that is potentially 10 pips or more off your brokers feed, or no data at all?

In most cases (depending on the strategy) I think having a general idea of where the price is, even if it's a bit off, is better than sitting blind. If we execute trades on the prices generated from the failover feed, we'll chalk up the execution price against the opening price as slippage anyway.

Automatically failing over, and then rotating back to the real feed at some point will be a technical brain teaser to solve. The most interesting piece will be making the transitions transparent to the strategies using the feed. However, I also need to bulk up my alerting system so I am aware of what's going on as needed. This will likely consist of getting email alerts sent to my phone again. As it stands, if I can get the email, I can login and respond to whatever issue may be occurring. Last but not least, I need to figure out why the feed is failing and if possible fix it.

I started what is now a half finished debugging session almost a week ago. There has been with no movement on my end to finish it. The potential for some better trading should hopefully be motivation enough to take a serious look and overhaul the alerting, failover and reporting systems I'm currently using. The importance of this infrastructure can't be understated. Now to find the time to implement.

1.26.2012

Still watching the euro

Since my last post, the euro has indeed put on an impressive rally back. People are doubling down on there shorts and just getting crushed. This momentum was really easy to feel in the ticks before the event. Still, I like to sit out counter rallies as a matter of safety -- it's way to easy to get caught in reversals and whipsaws. So what is the new trend for the euro this year? That anyone's guess -- as for me I'll just being watching and waiting for new trends. With statements like "low rates through 2014" from the Fed and Bernanke, the euro might not be the worst of the failing currencies in 2012 and could instead see us rally back towards 1.4X.

1.21.2012

Some manual trading down the euro

While the breakout bot has been holding a ~1.33 EUR/USD short for almost a month now, I decided to get in on the action with a little manual trading of my own. I was inspired by my visit to Hungary and being on the ground in Europe again, I felt the urge to get in on the action. My trading coincided with the large downtrend starting right after the new year and ending only a few days ago. Oanda's new trailing stop feature came in very handy, and I must admit it was nice to trade from the UTC+1 timezone. The euro is now counter rallying and we'll see if indeed this short play is over and we'll tread water again, or if the 1.2X's are here to stay this year for the euro. Time will tell.

1.20.2012

Visiting a currency crisis

In my time trading forex, I never really stopped to consider the physicality of it all. We're dealing with real money here. Most of it is paper mind you, but it's physical nonetheless. And it's being exchanged for goods and services. People are collecting it, spending it, or simply wishing for it. In general more people understand and are involved in the stock markets, but honestly the currency markets play a much more vital role in there lives.

Now despite the dollar gloom and doom, we're in luck that our currency is one of many fiat currencies trending to zero. Since the rates change at any time, we're not always winning that race (here's to hoping the dollar comes in last, cheers). We can look to our European friends to find several examples of failed currencies, not only within my lifetime, but also my trading lifetime. The Turkish lira, and the Icelandic krona to name a couple. I remember watching the bid price on kronas blow up live. What a crazy day that was! However, I was not in Iceland at the time, nor invested in the currency. What happened on the ground when the paper became worthless? What did people do?

This past week I got to experience the fragile beginnings of such an event. Visiting Hungary let me see and touch the bills that may one day be worthless or otherwise replaced. Hungary has never quite recovered from the 2008 financial crisis and the pain is getting worse. Having accepted one IMF bailout, they find themselves asking for another.

So what did the country look like? The bars certainly seemed full. The streets still busy and the restaurants still serving food. Yet there were rallies and protests in front of the parliament building, and whispers on the streets. Currency was leaving the country and locals talked of moving money to nearby Austria and other foreign banks. The feeling in the air was a nervous laughter, ripe with anticipation of knowing what must come, while still hoping it wouldn't.

So what does the collapse of the dollar look like? What will history say? I can imagine a similar story when the time comes.

11.17.2011

Trading engine update

Sucess! As of this evening I have a live version of the new strategy engine running a breakout strategy in demo. Porting the old strategies over and refining the engine will likely continue for several weeks. I'm quite happy with how things turned out, but there is always more to do. I'm sure this will not be the last update to the strategy engine.
For the technical minded, let's just say hashes are really neat data structures, and without them this consolidation would not have been possible. ;-)

11.10.2011

Updating the trading framework

It's been some time since I spoke about the engine behind the robots and strategies I trade. I had a wonderful coding marathon last weekend the result of which is many new improvements in the trading framework I am using. Although I solved several issues and cleaned up many things, there remains a piece I haven't quite been able to clean up.

I have the dilemma of writing code that is clean and maintainable, while having client side strategies that are really one-off programs. The server side backend pieces are abstracted away and objectified nicely, but that doesn't help with the client side implementations. Simply stated, I have a template I wish to use for all new strategies. This is easy to do. The trouble comes when I update the template (fixing a bug, adding new cool stuff, etc), the strategies of course don't get this update without me manually merging it across. This is not scalable as the number of strategies grows. The trouble with creating a generic class and having each strategy extend it is that each strategy has unique pieces and I don't believe I can abstract anymore pieces away. This is of course despite the fact each has a common workflow. Creating a generic client class is the answer (unless a programmer out there can shed some light). Regardless this is a wall that is slowing progress on new trading ideas.

11.08.2011

Jesse Livermore, speculation, and people

I just finished re-reading Jesse Livermore's auto-biography,Reminiscences of a Stock Operator. What a wonderful read. In this post besides advocating anyone who hasn't yet read the text do so (you can find it FREELY available here: http://www.archive.org/details/ReminiscencesOfAStockOperator), I wanted to highlight a couple quotes from the book on people:

"I absolutely believe that price movement patterns are being repeated. They are recurring patterns that appear over and over, with slight variations. This is because markets are driven by humans and human nature never changes"

"On the other hand there is profit in studying the human factors, the ease with which human beings believe what it pleases them to believe; and how they allow themselves indeed, urge themselves to be influenced by their cupidity or by the dollar-cost of the average man's carelessness. Fear and hope remain the same; therefore the study of the psychology of speculators is as valuable as it ever was. Weapons change, but strategy remains strategy, on the New York Stock exchange as on the battlefield. I think the clearest summing up of the whole thing was expressed by Thomas F. Woodlock when he declared: "The principles of successful stock speculation are based on the supposition that people will continue in the future to make the mistakes that they have made in the past.""

"The message of the tape is the same. That will be perfectly plain to anyone who will take the trouble to think. He will find if he asks himself questions and considers conditions, that the answers will supply themselves directly. But people never take the trouble to ask questions, leave alone seeking answers. The average American is from Missouri everywhere and at all times except when he goes to the brokers' offices and looks at the tape, whether it is stocks or commodities. The one game of all games that really requires study before making a play is the one he goes into without his usual highly intelligent preliminary and precautionary doubts. He will risk half his fortune in the stock market with less reflection than he devotes to the selection of a medium-priced automobile."

On the surface, Livermore traded in a completely different world. Insider trading was rampant, stock manipulation and tip buy/selling was popular, bank runs were common... Hah, see not so different after all? In truth however, humans are the same. The same emotions that drove and controlled the market in Livermore's time do so today. We simply need to accept and understand this. I'll include a few more highlighting the inherent laziness and gullibility of man.

"The average man doesn't wish to be told that it is a bull or bear market. What he desires is to be told specifically which particular stock to buy or sell. He wants to get something for nothing. He does not wish to work. He doesn't even wish to have to think. It is too much bother to have to count the money that he picks up from the ground."

"At first, when I listened to the accounts of old-time deals and devices I used to think that people were more gullible in the 1860's and 70's than in the 1900's. But I was sure to read in the newspapers that very day or the next something about the latest Ponzi or the bust-up of some bucketing broker and about the millions of sucker money gone to join the silent majority of vanished savings."

How true! There is nothing new under the sun1! Re-reading Livermore's observations brings to mind the recent EVE Online ponzi scheme that rather successfully executed it's mission, netting a cool ~50k USD for its creators2.

All said, I will be continuing to study people. In understanding people, I will understand markets.



1. Ecclesiastes 1:9
2. http://www.evenews24.com/2011/08/14/the-1-trillion-isk-ponzi-phaser-inc-speaks/

11.05.2011

Gaming and Trading

I have been undertaking further study of people. The analytic mind is constantly amazed at what others will do. Indeed, when time and abstraction from the situation allow, my own actions are utterly confusing for me to understand.

To this end, I got into online gaming. Specifically, online PVP or player versus player gaming. Obviously while exciting to play, playing against a computer has no comparison in dealing with a human opponent. While I did chose a game I enjoyed playing, I also made sure to chose something which required team play. That's right, while the game was PVP, it required playing as a team with 2, 3, or 4 other people you may or may not know. Success came to those who understood how people work, how to be a leader, how to motivate; indeed how to succeed at a common goal when given a random selection of people. Alexander the Great's success can be attributed to his mastery of this skill.

This gaming binge culminated in me running a semi-professional team, entering contests for real money (who knew people would pay to watch this?) and competing with other teams. I must tell you from the start that this ended as one can expect. We had some great early successes, but slowly and surely personalities began to outshine our success. Being human, mistakes are inevitable. As the fearless leader, I ultimately saw the team disband after an especially egregious series of mistakes and loses. It's almost like a bad dream. In just 2 short hours we went from a successful, united team to splintered and disbanded.

So what happened? In short, people. I had lessons yet to be learned on understanding people's actions and taking control. While this spectacular defeat is meaningless in the grand scheme of life, it's lessons are not. I experienced all portions of the emotional spectrum while undertaking play. I have raged, confronted my own disappointment and fears, and accomplished my own goals through what can only be called undying perseverance and study. It must be said I am not a gamer. This PC upon which I type is not a "gaming rig". I didn't have all the best tools, nor the natural skill that would allow me to succeed. But succeed I did. Before I ended the experiment a few weeks ago, I rose to the top 15% of players, the small percentage who can say they have a > 55% winning percentage1.

So what does this have to do with trading? Well, the untold story above is what it cost me. I said I accomplished my goals, but it was a year long struggle. My devotion and study was immense. I had to learn many lessons the hard way, and not unlike trading, had to pay my dues. Digging myself into a hole only made my eventual rise that much more difficult, but it also allowed it to be more rewarding.

Trading is about people. People make markets. To pit your brain and might against another is the greatest thrill in the world. To walk away successful is to know no greater joy. So many lessons have been learned about people, about leadership, and about anticipating other actions. I hope to apply these thoughts into my future strategies and having learned these lessons in a virtual world I trust I can carry at least some of the answers into the real world.



1. It's interesting to note a vast majority of people never rise above a 50% win ratio, many never even coming close. This corresponds extremely well to what we find in trading. It's the top 5% in trading who are truly successful, perhaps 10% more who manage to scrape by with minor success. The overwhelmingly majority hardly break even, with most losing much more than they win.

4.25.2011

Maximum Achievable Skill

I realized today I enjoy competing mentally against others. The statement seems silly. Many people enjoy competing against others in various ways. For my part, being unwilling / unable to compete in many phsyical events (I'm happy to race you in cycling or sailing), I've found mental competitions more suiting. It would seem logical then to assume I am "smart". I can assure you, I am not ;-) I have a terrible memory, ontop of a split brain which excels neither at the creative and abstract nor the logical.

This desire however does explain my attraction towards trading. It's a player versus player game with real life stakes and consequences. In addition, some of the brightest minds in the world have been tasked with outplaying each other; but the playerbase itself and potential payoff is huge. Perfect for the obsessive, the game doesn't end until you quit or lose1.

Now, I like to think of myself as a capable learner. Given enough time, I should be able to achieve success and become competitive in whatever area I apply myself to. However, the real world is a harsh reality for such a fragile mind as myself :-) Experience has shown I am unable to do well in things that are player versus player, such as PC or board gaming. Sure, I may find some limited success in a small audience, but normally I find myself outplayed and not quick to pick up the tricks to winning.

Let's consider an example. Consider a chessmaster. I understand the basic rules of chess enough to be able to move all of the pieces properly, as well as pursue the objective of taking the opposing king to win. However, the chessmaster will continually beat me at games. We play several times daily for months, and yet I find myself unable to beat him. This brings us to an interesting question. At some point, will I be able to compete against the master? Eventually thru the games I play, our knowledge should equalize -- or can I never catch up to his level of knowledge? By definition he is my teacher, and has a headstart on his knowledgebase, all the while expanding it with every game he plays. Assuming the master never allows his human error to make a wrong move, it would seem impossible for me to ever beat him, save for him making a mistake.

To fully understand the problem, we must look at how someone can become skilled at something like chess. In my example, I am assuming my skill comes from me emulating the chessmaster and learning his moves. If I am capable only of emulation of skill, aside from human error I should not ever beat him. I may indeed find success against other players, assuming my mentor was more skilled than those I play against, I by extension will also find success. However, there is another way. I could apply new thought and originality to the problem. In theory, I could best the chessmaster in my first game with him.

It is this second method of successfully competing against others that the thinker is driven to. It would seem for most who wish to do well, simply emulate someone who has had success. For the thinker, your task is so much greater. You are compelled to see beyond the skill of your opponent; to understand them, and then compete above and beyond them. For the thinker, there can be no other path. Suffice to say I'm a thinker (or someone hopelessly wishing himself to be one).

1. Humorously, you can't really "win". You can only stop playing. Any definition of winning or losing when you stop is up to you.

4.17.2011

Why exits are more important than entries

Often when looking at trading strategies you find yourself looking for keys to figure out the start of a breakout or trend. Jumping on-board when a trend is starting ensures you have a good ride on the trend for healthy profits. But focusing on the entry point is flawed logic. It is the exit point that determines your profit, and ultimately, your success.

Exits are much harder to get right. Whenever you start something you have to think about your exit strategy. It's so easy in the beginning to get into a trade; think about the end. I find the end of something is far more interesting and telling than the beginning. This applies not only to trading, but life as well. Look over your trades for the last week. When did you exit the trade? Why? Don't get caught up on the P/L, or attempt to optimize the exit based on hindsight. You need to understand the raw thought process behind your exit. Study yourself, watch yourself. You'll find your logic may or may not hold when examined after the situation.

A wise sailor once told me, better to be on land wishing you were sailing, than sailing wishing you were on land. It sounds cliched, I know; but think before you trade. Not about profits, entries, or leverage, rather focus on how you're going to get out of the trade.

For myself, I think it's time I changed my exit strategies to be more focused for success, instead of minimizing damage. I guess one should play to the outcome you wish to see, and not the outcome you're trying to avoid.

4.04.2011

On being away

I've been way undertaking a study of man. Of his creations, the cities and their history. There is something that you can take away from a place. Seeing to the extent possible those places and things that others before you have seen and walked. Who can understand the birth of Wall Street, or the spirit of the same place in the 1950's without seeing it?

Who would say "no" to visiting the Bahamas in the 1960's? How about the same place in the 1920's? I think Jesse Livermore had the proper idea in his "Reminiscences of a Stock Operator". Taking a month to fish in the Bahamas -- being totally removed from any knowledge of something as simple as the price of wheat or the latest quote on GOOG. Those sorts of disconnected experiences are hard to come by now.

Time and place are a unique combination in life. They can't be recreated. We all have unique opportunities to experience during our allotted time here on earth. While hindsight is 20/20, we can still seek out those times and places that others may one day speak of and think about. It is a worthwhile endeavor to see not only the birth, but also the life and death of a thing.

4.01.2011

An english gentlemen

On my recent tour I was pleased to discover not only the stories of those magnates from the golden age of capitalism, but I was treated to a step back in time. Seeing their possessions and the cities they helped grow and thrive within was an invigorating experience.

Wikipedia describes an english gentlemen as follows:

To a degree, "gentleman" signified a man with an income derived from property, a legacy or some other source, and was thus independently wealthy and did not need to work. The term was particularly used of those who could not claim nobility or even the rank of esquire.

It's a romantic dream, but a dream nonetheless. To have been one of those gentlemen during the birth of a nation; rather not just a nation, but an Empire. Does such a chance still exist elsewhere in the world? The time for the gentlemen has occurred in both European and North American history1. Perhaps, there is indeed room for it to occur elsewhere.

1. Likely someone else can point to this occurring in central and southern Americas as well

3.29.2011

Living in the cloud

Mobility and moving around often has it's downsides. As I prep for yet another move, (I guess I just like change, or is it that I enjoy new experiences?) I decided to fix my current server instability.

Up until this point I have been self-hosted. I kept and maintained my own subversion server, in addition to the development workstation and application server for the bots to run on. And I had to keep those boxes plugged in and connected to the internet at all times. I remember coding the extensive disconnect logic for the (almost) daily disconnects that occurred at the one location I had the server running. Moving really threw a wrench into those plans. I had trouble keeping them plugged in and powered on, let alone connected to a high speed and stable connection.

When the time came for an extended trip, it was an easy decision to also give the bots a break. I did this mostly for myself, to allow my brain to focus on other tasks, but also to avoid having to deal with the server management while physically located thousands of miles away. They really have always belonged on a managed server. As of this past weekend, that's been corrected. I went with amazon ec2 -- it's completely scalable (and priced accordingly). The uptime, bandwidth and price cannot be beat. In fact, combined with wireless data on my android phone, I can admin the bots from anywhere. Having them running somewhere else and happily churning along is actually quite freeing. I check in once a day and look at the P/L's. So far, so good. I'm in love with the cloud. Now I need to move the subversion server also and everything will be migrated from my box.

3.24.2011

My awakening

I am awake again. I've re-entered the world of the trader. Sometimes your brain simply needs time away. In this case, I took quite a hiatus. I was not only physically away, but I left mentally as well. My absence was dominated by my own mind's need for data. I have need to understand people and places. My trip(s) placed me directly into the individual world's of others.
For example, standing on the street corner in New York, you will see many people. Some will be standing, others walking, perhaps some working and some sitting. If you force yourself to look closer you will see more than this.


There are several little worlds going on in that picture. Each one represents a person, a life, and a world all to themselves. The fascinating thing is that so many people can live so close, and be so physically close together and yet live in such separate worlds.


2.01.2011

A summer away

So I've been away fro a bit -- on a long summer if you will. It started out as a summer trip in August I never returned from. I went to view the America of old and to find the great cities and the people that lived there. Driving through sleepy New York towns founded hundreds of years ago. In many ways the towns are unchanged from there humble beginnings. The main crossroad still contains only a stop sign, and the town square is still a hub of activity. In a land of rolling hills, why did the founders stop in this valley? Or on this hill? I can see no reason to stop, yet they stopped there and settled. I admire this desire to strike out on your own, to have potential to become great, despite the costs.

In the coming posts I'll try and reflect on my thoughts gained from this trip and the trading hiatus. It's strange how you find yourself back thinking about the same problems after such an absence. The only thing I find funny is that the "solutions" are still the same -- even if you wish they weren't.

8.06.2010

How to deal with a financial planner (CFP)

Let's cut to the chase here -- I've been given "free" money. Not really, it's free! FREE! You just have to . . .

So started my newest conversation with a CFP / sales representative with a major bank / insurance company / mortgage lender / broker. No conflicts of interest here right? So a typical engagement involving what to do with the "free money" I'd been given. First, though my employeer had been oh so generous in providing matching funds when I contribute I still felt conned and shackled. Indeed, after a couple years of recieving the contributions, I ultimately stopped contributing anything to my 401k. Despite the matching funds and my foresight (or luck) to get out of the market before the big finacial fallout I still lost money. This was due to me being unable to chose the broker or investments to invest in. Sadly, this is steadily becoming worse as pension plans (and the impending bailout) are increasing displaced by lackluster retirement accounts. The laws can change at any time (and they will), but most are being misled into staking there life and work on a single number. It's a fools' game and I want no part.

So back to the CFP, what to do with him? I'm now being shown some boxes and asked to chose which one I like the best. Perhaps color plays a part here, or commissions, or just the person's current attitude and emotion1. The boxes of course are some sort of rehash of the MorningStar boxes which attempt to define risk and performance. A pretty graph of course shows you how the whole procedure will work. You contribute $X a week for XX years, and at the end of the rainbow *poof!* you retire a millionaire. Nonetheless, a choice is made and money starts to funnel. Into the acount, into the CFP's company coffers, and to those manipulating the investments.

I shake his hand, thank him for his time and in a flash he's gone. I feel ill and internally lash out against myself for not striving harder to take control.

How else can I deal with a CFP? I don't believe him. I don't want what he is selling. At the end of the day, he knows I'll sign the paper anyway. And so do I.

1. Seriously, I'm sure it would make a fascinating study of how the box is actually chosen. Assigning logic to the choice would only make explaining the choice worse. Human actions can be controlled, but not predicted :-)

7.16.2010

In the end there is only socialism

Really, at the end of time, power will be so consolidated there will be only one world leader1. And the "greater" good of mankind will be the primary focus of that government. When those days come I don't think the free thinkers will find any happiness in saying "I told you say".


1. http://en.wikipedia.org/wiki/Antichrist