The Risk/Reward R Calculation
Someone recently purchased Risk/Reward (thank you!) and had a concern about the cost of trade in relation to gains. With his permission, this is the email be sent me:
I just downloaded the app and noticed that “cost of trade” ( assume to
be commission expence) works correctly for loss on sales where stock
price goes down, however it appears to be additive on gains (profit)
when stock price goes up. I would have expected the cost of trade to
always reduce the return; increase losses and reduce gains. Will this
calculation be revised in future app release?
So, let’s take a look at what a calculation looks like. With an upcoming version of Risk/Reward you will be able to email yourself the results, so let’s use that feature for this. We’ll take a simple position so that the math is easy to see:
Risk/Reward Results (2009-9-27 10:44 AM)
Trading Parameters
Share Price: 10.00
Max Loss/Share: $1.00
Number of Shares: 100
Cost To Trade: $10.00
Type of Trade: Long
Risk (1R)
R Sell Price Loss
1R 9.00 110.00
Reward (nR)
R Sell Price Profit
1R 11.10 110.00
2R 12.20 220.00
3R 13.30 330.00
4R 14.40 440.00
5R 15.50 550.00
6R 16.60 660.00
7R 17.70 770.00
8R 18.80 880.00
9R 19.90 990.00
10R 21.00 1100.00
In the trade above, the cost of the trade was $110.00, so this is the 1R. Cost of trade, or, as Van K. Tharp calls “The cost-of-trading opportunity”, includes commissions (to buy and sell), execution costs (slippage, i.e., you never get the exact price you want), taxes, and psychological costs. So, altogether, for this trade, you are risking $110.00 (1R). In order to realize a profit of 1R (again, $110.00), you would have to exit at $11.10. To gain 2R, or $220.00, you would have to exit at $12.20, and so on. The R-value is a multiple (i.e., straight multiplication) of the risk.
If this calculation does not match up with your take on the R-multiple risk for a trade, please let me know, either by commenting below, or sending me an email: lucasrockwell at lucasrockwell.com.
You should buy my iPhone App
Taking a cue from Dustin Curtis in his article You should follow me on Twitter, I thought I would try the same thing with my iPhone app:
You should buy my iPhone app here.
Thanks!
Tracy
Tracy, a move by our friend Dan Scanlon and staring Bernadette (as Tess) is hitting the film festival scene and is starting to get noticed:
Check out the trailer!
twittbookspace
I set up a crazy new site to keep track of the “social networks” I am on:
Maybe I will turn this into a service… It would be cool if it worked like posterous, where you could just email the URL to your twitter, or facebook, etc., page, and it would figure it out and put the logo on your twittbookspace page.
Maybe someone has already done this… Let me know what you think.
500 Risk/Reward Apps Sold
As of yesterday, 5/16, I have sold 500 Risk/Reward apps! This is certainly beyond my wildest dreams. My original goal was to just recoup the $100 I had to pay to become part of the iPhone developer program, and that happened about 2 months ago. Of course, I am still waiting to be paid by Apple, but I’m sure that will happen any day now. :-)
I am working on a new update to Risk/Reward — the ability to save your calculations. This update should be out around mid to late June.
Thanks to everyone who has purchased Risk/Reward!
We’re in the semi-finals
Update: We won Round 2, and now onto Round 3. http://contests.apartmenttherapy.com/2009/small-cool/main/faceoff/29
Please vote for “Lucas Rockwell”.
Thanks!!!
Our apartment is in the semi-finals for the Apartment Therapy Small Cool contest! We have even made it past the first “faceoff”! The voting for us begins again at 12:00 AM PDT Monday, April 27.
You can check out the “brackets” for the Tiny division here:
http://contests.apartmenttherapy.com/2009/small-cool/main/bracket/tiny
Thanks to everyone who has voted for us so far!!! And we hope you keep voting for us throughout the week of April 27.
Please vote for our apartment!
Our apartment is on Apartment Therapy in the “Small Cool 2009″ contest. We are in the tiny category (600 Square Feet and under (but over 300 Square Feet)) and currently have the second most votes. So please check out: Lucas’ Stylish Studio and vote for us!
Thanks!
Redcar is cool, but I still can’t use Linux
With the arrival of Redcar, which is a TextMate-inspired “text-editor/IDE for Gnome in pure-Ruby”, Linux is becoming more appealing as an everyday OS. Honestly, I am almost ready to install Ubuntu in a VM just so I can try this out…
As cool as Redcar is, there isn’t one, or even a collection of applications that would make me switch to Linux. Let me put it this way, even if every application I use on OS X worked on Linux, I still couldn’t use Linux as my everyday, desktop OS. Why? Because OS X is the only OS that distinguishes between GUI editing and line editing.
Let’s start with a little background. The Mac was a GUI-based OS from the start, i.e., there was no command line. And because of this Apple, for whatever reason, created a new key on the keyboard: the Apple key (which is still in use today, but the Apple logo has been removed, and everyone refers to it as the “Command key”). There are two Apple/Command keys: one to the immediate left of the spacebar and one to the immediate right of the spacebar. (For some reason, I have never used the one to the right of the spacebar.)
So, what’s the Apple/Command key for? Well, it’s the equivalent of the Control key in Windows and Linux (but only for GUI editing in Linux, and now you can probably see where I am going with this…). If you want to “Select All” in a GUI Mac program, you use “Command A”, whereas in Windows and Linux, you would use “Control A”. Ok, so, great, what’s the difference? Well, what happens when I am writing an email and I want to go to the beginning of the line? Anyone? Anyone? … The suspense is killing me… On the Mac I would type “Control A”! How do I go to the beginning of the line in a GUI app on Linux? Please, you tell me. Oh, right, that special key, which is way out of my way, that had to be invented to do this simple task.
Now, let’s pull out the command line. How do I go to the beginning of the line? “Control A” of course (thank you emacs!). So, on Linux, if I am writing an email in Thunderbird and I want to select all, I hit “Control A”, but on the command line, “Control A” takes me to the beginning of the line… Excuse me? On OS X (and yes, this is with OS X, as (I believe) the only use for Control prior to OS X was the contextual menu support in OS 9), the Command key commands work in every app, and the Control key line editing commands work in every app.
Even in iPhoto, if I am editing the Title of a picture, I can use “Control A” to take me to the beginning of the line, and “Command A” to select all. Same is true for the Terminal (the command line) where I can use “Command F” to open the find dialog box (like on every other GUI app!) and search for something. And yes, “Command A” in the Terminal selects everything in the buffer, and then I can “Command C” to copy, switch over to another program, and “Command V” to paste.
As clean and amazing as this is, the pièce de résistance of this is that the command line “cut” — “Control K” — and “paste” — “Control Y” — both work in GUI apps, too, and uses a separate clipboard than the GUI cut and copy! So, this effectively gives me two clipboards! But, actually, it gives me n clipboards because the command line cut and paste are for that application only, whereas the the GUI cut, copy, and paste are global. So, this means I can use “Control K” in TextMate, and “Control K” in the Terminal, and when I do a “Control Y” in either of those apps, that app remembers the thing that I last “cut” in that application. This takes advantage of the fact that in OS X there are literally n clip/pasteboards.
Some Linux users have pointed out that you can switch to command line-like editing on a per-app basis — the concept is “enabling emacs key bindings” — but when you do this on Linux, you now have to use another key for doing GUI things like “select all”. So, to me, this is not a solution, in fact, it makes things worse because now you have to remember which apps have emacs key bindings enabled, and which don’t.
In closing, until Linux, or more precisely Gnome, KDE, or any other desktop environment makes a clear distinction between GUI editing and line editing, and it is implemented across all of the applications I would want to use every day, there is no way I can switch to Linux. Emacs line editing commands* are embedded in my brain, so are GUI editing commands, and it is a massive (which is an understatement) productivity killer to have them be inconsistent or just outright broken in Linux. And forget about Windows. I used Windows at work for 4 months and thought I was going to go nuts. I switched to Linux and got maybe another 4 months before I told my manager that I either get a Mac, or I’m leaving. (They gave me the Mac.)
* The GUI line editing in OS X is only a subset of the things you can do with emacs/command line. For instance, you can’t do “meta f” to skip ahead one word in the GUI, but for that, you have the “Option right arrow key”, which is universal in all GUI apps on OS X. The same goes for all word, line and page skipping, forward/back/up/down in GUI apps.
Risk/Reward 1.2 Out
Risk/Reward is now available on the App Store. The new version has been updated as follows:
With version 1.2, Buy Price has been changed to Share Price, as share price is more accurate, especially when short selling. Thank you to a very loyal Risk/Reward user for suggesting this change!
Also new in 1.2, the app now remembers the last value for Cost To Trade, as this cost is most likely to stay the same from trade to trade. This way you do not have to enter this value each time you use the application. Once you enter a value in Cost To Trade, it stays at that value until it is changed.
Version 1.3 will be out in the next few weeks, and this version will allow you to shake the phone (if you have an iPhone) to clear the input screen.
Why not LDAP?
I just read Evan Weaver’s blog post about Improving Running Components at Twitter and I just have to ask: “Why not LDAP?”
Let me start by saying that I do not work at twitter, so I really have no idea how they put things together there. Reading a bunch of articles on the web is not going to give me the full picture, either, so I might just be completely off-base with this post. However, I do know LDAP (very well actually), and it seems to me like a lot of the performance problems twitter is constantly trying to solve could be best handled using LDAP.
LDAP not just a fancy white page system. If it was, I don’t think Verison would stake the business of its entire 75 million wireless subscribers on it. LDAP is designed to scale, and it seems perfect for what twitter is doing (at least for 1/2 of what twitter is doing, as messaging is probably appropriate for the other 1/2).
So, from a “backseat driver” perspective, I would suggest that twitter consider doing the following:
- Put all users in LDAP. So, this means that I have one LDAP record like, uid=lucasrockwell,ou=twetters,dc=twitter,dc=com
- Put the people each user is following into groups — one group per user. So, now I have a group: uid=lucasrockwell,ou=groups,dc=twitter,dc=com, which is made up of hundreds to thousands of “uniqueMember” attributes, each pointing to the DN of another user.
- Do queries against the groups to figure out who I am following, and who is following me.
- Break out the ou=groups and ou=tweeters containers into smaller containers based on username if you have too many to fit on one server. (LDAP was designed for this.)
- Use LDAP proxy servers to figure out where the user is located, and send the traffic directly to that server (or cluster of servers).
- Of course, run it all in memory. (Again, LDAP was designed to do this. Or, should I say, modern LDAP servers were designed to do this.)
Of course, this does not address the actual tweeting, but for that, I would think they would want to use a messaging system. Tweets do not need go in LDAP. They could, but that is a lot of writing to a system that is designed for fast reads. But, given the flexibility of LDAP, its ability to do fractional replication, multi-master replication, and logical separation of data into different physical servers, all while making it look like one monolithic system from the outside, I think they could probably solve most of their design needs with LDAP.
If any twitter people read this: If you have looked at LDAP and it was deemed not appropriate, I would love to know why.

