View Full Version : I Love the Stock Market.
Kranar
06-30-2008, 09:39 PM
Well today has got to be one of the most rewarding days of my life.
So, as some of you may know I took a pretty big risk awhile back and started a small company based on some hypotheses I had about the stock market. Now as I fully admit, I am not a finance or business guy, when I hear business people discuss all these economic theories or stock market theories, I have no idea what they mean, and honestly I don't much care either.
My approach to the stock market has been and will always be based purely on principles derived from physical, mathematical and computational methods. In my world, the same laws that govern the transmission of a digital signal over a noisy channel can be used to understand the transmission of a stock's price over the stock market.
Now, one algorithm I wrote in particular is incredibly sensitive, even the tiniest mistake in a calculation due to rounding errors or bugs in the system or errors in data from the stock market can have pretty disastrous results. Because of this I usually run a scaled down version of the algorithm that is more fault tolerant but doesn't yield as great of a return.
This algorithm is also the most intense and nerve wracking to watch. It trades for precisely 31 minutes of the day and not a millisecond more and it trades with 100s of thousands of shares. On Friday, as a result of the enormous market activity over the course of this month in what was an absolutely dismal month for the stock market, I knew that today was going to be massive. So I decided that I was going to let my algorithm go full force on the stock market so as to not miss this opportunity. I spent all weekend long doing the needed preparations, stress testing the living crap out of my system, subjecting it to extreme scenarios to see if it could properly handle the crap load of data that was going to be thrown at it.
Admittedly I am making this seem far more grandiose than it probably was, but for me, today was a test for me to throw at the market everything I was made of and all I had come to understand about how this jungle of system of works. Literally months of hard work engineering this system and finally today I was going to let it run at its fullest, unrestrained.
I have a small numbered company with one other business partner and two people who have invested in us (to whom I'm grateful for). The result for today was a whopping $83,296 over the course of 31 minutes. This number totally shattered our previous record and the second we hit it our phones lit up with our investors phoning us, our clearing firm phoning us to ask if this was real or a bug on their end. Word spread fast and of course our competitor, Infinium Capital, who currently employs someone who used to work for me noticed this as well and the guy actually phoned to congratulate me.
Now for some companies like Goldman Sachs, you laugh at a number like this, but for a team of two guys in a small office with no background in business, this was a defining moment for us and we celebrated.
A picture showing the final result of the algo trading is attached below.
The algo picked very few losing trades, and even on the trades it did lose, it was like maybe 50 dollars here or 100 dollars there. Whereas the winning trades it picked like POT.TO (Potash) were 25 grand, TD was 10 grand, and there are numerous 5 grand winners. With little exception pretty much everything went right according to plan over the 31 minutes.
This for me has been the best practical manifestation of the power of math and physics and I only hope a situation like this occurs again next month.
I'm glad I got to post this here, I don't normally post personal info about myself but I couldn't keep this in.
Renian
06-30-2008, 09:45 PM
Congrats, Kranar. That's absolutely awesome.
Though I'm surprised the amount you made was that big, given the trading fees.
Oh, btw...You must never release that algorithm. Benjamin Graham, in The Intelligent Investor, noticed something about algorithms and tricks with the stock market: once you let the cat out of the bag, it stops working.
Warriorbird
06-30-2008, 09:46 PM
Nice!
Stay small so you don't get priced into the market.
Apathy
06-30-2008, 09:46 PM
Sorry, but all I could comprehend was Superman 3.
http://img2.timeinc.net/ew/dynamic/imgs/080425/office-space-02_l.jpg
Grats.
Kranar
06-30-2008, 09:48 PM
Though I'm surprised the amount you made was that big, given the trading fees.
Thanks.
So we trade directly on the exchanges, not through a brokerage firm. Because of this, we actually get paid to make a trade. Whereas say on eTrade or other brokerages you have to pay 5 bucks per trade or whatever they charge, when you trade directly on an exchange and you're adding liquidity to the exchange, they will actually pay you approximately 0.0005 cents per share. It's not much at all, but as you point out, it's a lot better than having to pay large fees to trade.
Bobmuhthol
06-30-2008, 09:48 PM
<<Though I'm surprised the amount you made was that big, given the trading fees.>>
Trading fees are only really significant on lower-end personal accounts.
Renian
06-30-2008, 09:51 PM
Thanks.
So we trade directly on the exchanges, not through a brokerage firm. Because of this, we actually get paid to make a trade. Whereas say on eTrade or other brokerages you have to pay 5 bucks per trade or whatever they charge, when you trade directly on an exchange and you're adding liquidity to the exchange, they will actually pay you approximately 0.0005 cents per share. It's not much at all, but as you point out, it's a lot better than having to pay large fees to trade.
That's awesome.
Trading fees are only really significant on lower-end personal accounts.
There's still losses in higher-end ones.
Mistomeer
06-30-2008, 09:53 PM
Congrats, that's awesome man.
So what's the long term goal for the company? Is it to make money off investing or is it to sell the program?
At any rate, that's outstanding work.
Renian
06-30-2008, 09:54 PM
Congrats, that's awesome man.
So what's the long term goal for the company? Is it to make money off investing or is it to sell the program?
At any rate, that's outstanding work.
It better be the first one. You don't want to do the second.
Hulkein
06-30-2008, 09:56 PM
What's to stop you from running the algorithm more than once a month for ~30 mins?
Kranar
06-30-2008, 10:02 PM
So what's the long term goal for the company? Is it to make money off investing or is it to sell the program?
This company for me is mostly a great excuse for me to program what I want. The stock market is such a rich source of chaotic data that it will more than supply me with a life time of programs to write and data to analyze. The investors also have full faith in us and that helps a lot.
I keep in the back of my mind the full knowledge that any day now something bad can happen and put an end to it, so I just take it one day at a time and hope for the best and appreciate whatever outcome I get.
I don't really think I'll be selling my algorithmic trading platform. To do so would open a can of worms, such as having to document it, provide support for it, and it could reduce our flexibility. Right now my business partner and I am happy with the situation. We get to brainstorm a lot, come up with wacky experiments that we throw into the simulator, and just have fun that way.
Kranar
06-30-2008, 10:12 PM
What's to stop you from running the algorithm more than once a month for ~30 mins?
We've been running a watered down version of this algorithm every single day for 31 minutes. Why don't we run it full force every day? For one, if for what ever reason the system crashes, our source of quotes dies, execution fails, anything goes wrong... the result could be disastrous.
We're still new as well, only been doing this since October. As we get more comfortable with the system we will gradually take off the breaks. The reason I let it run full force today is because several indicators lead me to believe that today was going to be big so I decided it was worth the risk for today.
Sometimes indicators will show up for just one particular stock and so I'll run an instance of the algo full force just on that one particular symbol, and those usually turn out well, but this is the first time we let the thing loose on every single eligible symbol and I was very nervous.
Hulkein
06-30-2008, 10:31 PM
Gotcha. Well sounds like you found a pretty good combination... Something you enjoy doing that can make 80k in a day.
Daniel
06-30-2008, 10:37 PM
Congrats man!
Mistomeer
06-30-2008, 10:46 PM
<<Though I'm surprised the amount you made was that big, given the trading fees.>>
Trading fees are only really significant on lower-end personal accounts.
Not really. It depends on what you're doing. You take a discount brokerage that's charging you a flat rate per trade and it's like $7/trade. On the other hand, you have to have a direct line to a Market Maker for trade execution and that's dicey as well. What he's doing is obviously working.
JohnDoe
06-30-2008, 10:49 PM
Not sure if this is asking you to reveal too much information, but how much money do you have on hand to invest with to turn that type of profit? Curious what the actual % gain was.
PS - congratulations. Sounds like you've got a tight stop to cap losses and let your gains run high is in place. 10+ days like this a year and you're golden. I think the hardest thing for me would to not get greedy, but if you're using software to remove the emotion from making trades, you're already ahead of the game.
Methais
06-30-2008, 11:03 PM
tldr version please?
Fallen
06-30-2008, 11:08 PM
That is insane. Congrats, Kranar. Being good at math allows one to cheat at life in comic bookesque type ways.
Kranar
06-30-2008, 11:21 PM
Not sure if this is asking you to reveal too much information, but how much money do you have on hand to invest with to turn that type of profit? Curious what the actual % gain was.
There is no simple answer to this. Basically our investors also own the company SwiftTrade/Orbixa which is a prop day trading firm. That firm has access to a pool of literally billions of dollars worth of buying power that is used by tens of thousands of traders around the world. When our algos make a trade, it will tap into that pool of money. So there's no dedicated money reserved just for us, but you can pretty much guarantee that there will be enough money in the overall pool to satisfy our algos needs.
So how much do we typically tap into? We'll it's usually the case that we'll use 1-2 million dollars for a matter of seconds in a few positions, then unload and use 1-2 million dollars for another few positions and then unload and repeat that many many times.
We have guidelines not to exceed 10 million dollars at any given time, and we never do, we typically use no more than 5 million at any point in time. If we do it's not the end of the world but it would be pretty disrespectful of us to break that rule without a good reason.
I think the hardest thing for me would to not get greedy, but if you're using software to remove the emotion from making trades, you're already ahead of the game.
Watching the algo trade is intense. Once it starts, and it starts every day at a precise time, there's no turning it off, or tampering with it, or changing anything about it.
Greed really isn't part of the equation, we come up with a model of how the price of a stock should vary with respect to certain factors and we roll with it. My number one frustration is that for many of our algos we can't run them with a lot of money because we end up influencing the stock which invalidates our model. This is stuff you can't test in the simulator and it's a tough problem to solve. For example even on Microsoft, which is a heavily traded stock, posting a size of 10-20 thousand shares in the middle of the day is enough to have a small effect on its behaviour even though that's only 300-600k worth of capital. In the long run 10 thousand shares is nothing, but when your trades are executed over a matter of seconds, 10 thousand shares is a lot.
Sean of the Thread
07-01-2008, 12:18 AM
No where near as complicated as the WIN by Winthrop but you're making progress.
Just kidding congrats man!
http://i20.photobucket.com/albums/b236/Japgross/trading-places.jpg
AnticorRifling
07-01-2008, 09:13 AM
Awesome! Now make me an program that will prevent my wife from spending my money.
LOL Anticor. - thats right up there with death and taxes.
Congrats Kranar. Aside from the fact that you cashed in pretty quickly - there's nothing like the entrepreneureal feeling of watching something you've created take wings. Pretty soon we'll be reading about you in the financial times.
Fallen
07-01-2008, 09:53 AM
I was thinking, does this mean the PC is going to be up forever, then? I have to imagine it costs a fair bit to keep the site up with all the bandwith it must eat.
Kranar
07-01-2008, 10:22 AM
I was thinking, does this mean the PC is going to be up forever, then? I have to imagine it costs a fair bit to keep the site up with all the bandwith it must eat.
Yes it means the PC will likely be up for a long long time and advertisement free...
It won't, however, be spam free or bot free. :(
Fallen
07-01-2008, 10:25 AM
Please pay in advance so if your crazy computerized take over of the stock market implodes you will still be set on the webpage front.
Deathravin
07-01-2008, 10:37 AM
Step 1 to not having it crash and lose millions: get off windows XP! LOL... made me cringe when I saw that...
Linux of some kind. Server edition most certainly... and with 5-10 grand you can buy a very nice server-class machine, throw linux server on it, toss it in a rather inexpensive rack, put a good UPS on it, get a business-class cable line (or does trading directly on the market make you have a direct connection to them?), and an A/C unit pointing right at it...
As for your software crashing, that's up to you... but you can make the hardware immensely stable... at least you won't be on XP anymore...
At any rate, good luck on future adventures man. It really is very cool. Sometimes I think I'd want to be rich, and not have to work, but then I realize that rich people are (as far as the ones I've met in my life) completely nuts. I think it has something to do with that they don't have to do anything... They're happy and all, but bored. And borem leads to shows like 'my super sweet 16' and all the dumbass shit paris hilton does.
Much more fun to screw with computers all day IMO. I get paid to do what I like doing (for the most part) and if I didn't have to work anymore, I'd be stuck on Gemstone 24/7...
Renian
07-01-2008, 10:55 AM
Step 1 to not having it crash and lose millions: get off windows XP!
The computer running it looked very barebones, so that's probably not that huge of an issue.
But I'll still agree with Linux. It's magically delicious.
Stanley Burrell
07-01-2008, 11:07 AM
That is truly awesome, congrats man. I like what you said about how you didn't have to practice speaking the language of Wall Street, but instead, used one of your existing assets; that being math PWNAGE and compy skillz (definitely skills with a "Z".)
Make sure to keep your proggy well-protected from HAX0R SPIEZ.
Kranar
07-01-2008, 11:14 AM
Step 1 to not having it crash and lose millions: get off windows XP! LOL... made me cringe when I saw that...
Haha... good point. We run a variety of different OS's depending on what we need, for example stuff related to the processing and distribution of the raw market data feed is done by Solaris machines. I could be wrong, but I actually find SQL Server to be the best production database so that's run on Windows Server 2003 Enterprise. I believe a lot of it has to do with how much faster Windows is at synchronization than most Linux distros. Also it's kind of deceiving since the algo doesn't really run on one single machine, it's distributed across several computers where each computer is designed to perform a specialized task. One component of the algo will request data from another computer which in turn will need to do some processing on another computer etc etc... and then report back to the first computer. It's a mess, but it's needed evil since there's no way a single computer can handle the volume of data thrown at it by the market. Initially when I was doing this in my own personal account at a much smaller scale, and everything was nice and simple I literally ran it off my laptop. Unfortunately those days are no more.
That Digitrade app in the picture is just a ghetto GUI that lets you manage the system from one access point. It should be pretty evident that I suck at designing GUIs.
inexpensive rack, put a good UPS on it, get a business-class cable line (or does trading directly on the market make you have a direct connection to them?), and an A/C unit pointing right at it...
Virtually all connections to the stock market are done via a financial extranet, the one we use is called BT Radianz http://www.btradianz.com (http://www.btradianz.com/%29)
At any rate, good luck on future adventures man. It really is very cool. Sometimes I think I'd want to be rich, and not have to work, but then I realize that rich people are (as far as the ones I've met in my life) completely nuts. I think it has something to do with that they don't have to do anything... They're happy and all, but bored. And borem leads to shows like 'my super sweet 16' and all the dumbass shit paris hilton does.
If I catch myself watching My Super Sweet 16, I will definitely slap myself. Your point is well taken though.
Much more fun to screw with computers all day IMO. I get paid to do what I like doing (for the most part) and if I didn't have to work anymore, I'd be stuck on Gemstone 24/7...
Sounds good.
BigWorm
07-01-2008, 12:43 PM
Haha... good point. We run a variety of different OS's depending on what we need, for example stuff related to the processing and distribution of the raw market data feed is done by Solaris machines. I could be wrong, but I actually find SQL Server to be the best production database so that's run on Windows Server 2003 Enterprise. I believe a lot of it has to do with how much faster Windows is at synchronization than most Linux distros. Also it's kind of deceiving since the algo doesn't really run on one single machine, it's distributed across several computers where each computer is designed to perform a specialized task. One component of the algo will request data from another computer which in turn will need to do some processing on another computer etc etc... and then report back to the first computer. It's a mess, but it's needed evil since there's no way a single computer can handle the volume of data thrown at it by the market. Initially when I was doing this in my own personal account at a much smaller scale, and everything was nice and simple I literally ran it off my laptop. Unfortunately those days are no more.
That Digitrade app in the picture is just a ghetto GUI that lets you manage the system from one access point. It should be pretty evident that I suck at designing GUIs.
Virtually all connections to the stock market are done via a financial extranet, the one we use is called BT Radianz http://www.btradianz.com (http://www.btradianz.com/%29)
If I catch myself watching My Super Sweet 16, I will definitely slap myself. Your point is well taken though.
Sounds good.
Yeah, Solaris is what most of the financial institutions run, although I will concede your point that MS SQL Server is pretty decent for most applications, though its not Oracle. MySQL and Postgre (to a less extent) just aren't up to the insanely high reliability requirements needed for financial transactions.
Tisket
07-01-2008, 03:44 PM
Yes it means the PC will likely be up for a long long time and advertisement free...
It won't, however, be spam free or bot free. :(
Get us more skin choices man.
Kranar
07-01-2008, 03:51 PM
Get us more skin choices man.
Good idea. (http://forum.gsplayers.com/showthread.php?p=755463#post755463)
Soulpieced
07-01-2008, 04:11 PM
Best PC thread ever. Keep us updated.
Kranar
09-02-2008, 05:59 PM
I am in major need of a miracle for tomorrow.
Essentially today was going to be yet another colossal day that would have completely eclipsed the result of the original post. Yet system issues between our sponsoring broker and the TSX resulted in a system wide failure and so I have 16 million dollars worth of stock that I am now short over night.
I am short pretty much all of Canada. I need for tomorrow gold to tank, oil to tank, financials to tank, and agriculture to tank. If you look at the chart for today you'd see that had the system been running we'd have made an absolute killing since all of these sectors got smoked in Canada, unfortunately since our system went down we were stuck with these short positions and will not be able to close them until tomorrow morning, 9:30.
Even so much as a 1% overnight move against us will cost us $160,000 which would be a hefty blow. All I'm doing right now is watching the oil and gold tickers on Bloomberg praying they go down heavy. I'm pretty nervous about this whole thing, it's the biggest amount of money we've ever been caught with over night and usually the results end up being a coin toss.
The Ponzzz
09-02-2008, 06:09 PM
Good luck man!
BigWorm
09-02-2008, 06:13 PM
I am in major need of a miracle for tomorrow.
Essentially today was going to be yet another colossal day that would have completely eclipsed the result of the original post. Yet system issues between our sponsoring broker and the TSX resulted in a system wide failure and so I have 16 million dollars worth of stock that I am now short over night.
I am short pretty much all of Canada. I need for tomorrow gold to tank, oil to tank, financials to tank, and agriculture to tank. If you look at the chart for today you'd see that had the system been running we'd have made an absolute killing since all of these sectors got smoked in Canada, unfortunately since our system went down we were stuck with these short positions and will not be able to close them until tomorrow morning, 9:30.
Even so much as a 1% overnight move against us will cost us $160,000 which would be a hefty blow. All I'm doing right now is watching the oil and gold tickers on Bloomberg praying they go down heavy. I'm pretty nervous about this whole thing, it's the biggest amount of money we've ever been caught with over night and usually the results end up being a coin toss.
What kind of terms of service do you get with the broker and TSX? It seems like anything that is entirely their fault that costs you money should be their problem.
If you are an atheist, you may wish to take up a deity. Good luck!
NocturnalRob
09-02-2008, 06:26 PM
I need for tomorrow gold to tank, oil to tank, financials to tank, and agriculture to tank.
let's hope that gustav continues to be a big pussy. metals tend to follow oil recently. and financials should keep sucking fat elephant dong. sorry, man. hope it works out.
Kembal
09-02-2008, 06:47 PM
Oil should go down, and if the U.S. dollar keeps strengthening, gold should go down as well. Financials have generally sucked. Agriculture, though, might be rough.
Revalos
09-02-2008, 06:55 PM
Fundamentally, Kembal is right, however...in this market, people seem to buy into any downturn because of very similar automatic purchase mechanics to what you are doing Kranar.
However, Oil should continue down tomorrow due to the fact that it didn't fluctuate too much due to the hurricane, even though the taps were turned off. I'd be confident in that one.
The Dollar is the strongest it has been against the Euro in several months, that is kind of a mixed bag, it could be a time for the dollar to rise and gold to fall...or all the Euro traders buying gold like mad due to European recession fears driving it up.
Financials is an unknown quantity. I know Fannie Mae's bonds almost reached junk status today...that should help the overall financial markets fall tomorrow. Not sure about Canada specifically, but it isn't bad news.
Agriculture is another difficult one...Hanna may drive prices up. That is the only one I'd be worried about if I were you.
Sean of the Thread
09-02-2008, 07:08 PM
Sounds like you need a failsafe in place pronto. This kind of overnight shit ...well I don't need to say it.
Best of luck.
Kranar
09-02-2008, 07:51 PM
What kind of terms of service do you get with the broker and TSX? It seems like anything that is entirely their fault that costs you money should be their problem.
Well in situations like these we just talk it out with them. The actual terms of service is they have no obligation to do anything for us, but in reality, the fact that we do a crapload of business with them means we can negotiate this. Interest on 16 million dollars is a lot, about 2-3k a day, so we're not going to have to pay that.
Other than that, I just gotta pray. System failures like these unfortunately are part of the game, what really sucks is that it happened today of all days, first trading day of the month after a long weekend where everyone was previously on vacation. Like today was a monster day for the stock market and we just had some really bad luck.
Thanks for the support though.
Danical
09-02-2008, 08:16 PM
Man. I'm sorry to hear that.
Best of luck.
NocturnalRob
09-03-2008, 09:07 AM
oil down. gold down. what's the word? 20 minutes-ish. drop, bitches! kranar needs some new shoes!!
Seran
09-03-2008, 09:37 AM
Oil opened down 1.21 a barrel on NYM, gold only down 1.50/troy ounce unfortunately. Dollar is up less than a fourth of one cent against the Euro.
Cross your toes that the EIA releases their weekly stocks report with a rise in both oil and gas. Any upward increase in light of the reduced hurricane threat could see oil plummet further.
Kranar
09-03-2008, 10:06 AM
Yep, I got the miracle I needed. At 8:30 AM it was looking like a 40k loser from the indicating open price but at roughly 9:15 AM everything started to drop. Thank God the Bank of Canada decided to keep the current interest rate because if that went down, as some speculators were anticipating, we'd have been smoked. Net result was $93966.25 USD but money made as a result of a system failure is reserved to offset future disasters.
Anyhow, thanks for the support, I can now sleep tonight.
Seran
09-03-2008, 10:23 AM
Congratulations Kranar.
Keller
09-03-2008, 12:13 PM
I was going to recommend some sort of terrorist activity.
I'm glad that will be unneccessary at this time.
Danical
09-03-2008, 01:26 PM
Good on ya!
Sean of the Thread
09-03-2008, 03:41 PM
Well today has got to be one of the most rewarding days of my life.
I'm glad it worked out for you but I just wanted to quote part of your original post that stuck out to me.
I think one of the best days and most rewarding of your life IMO was landing a Google.
Anyways congrats on recovering. Now send me some cash so I can pay some bills. :)
<3 in a non gay way.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.