Thursday, December 18, 2014

7L7W Week 2: Io Day 2 round 2 continued>Toddling

I should probably check to see if something has defined the sum slot on Number and List first, but... let's start this simple.

Number sum := method(call target)
List sum := method(
total := 0;
foreach(val, total = total + val sum)
)

Io> a := list(list(1, 2, 3), list(1, 2, 3))
==> list(list(1, 2, 3), list(1, 2, 3))
Io> a sum
==> 12

As the title suggests, I think I'm getting used to this now. This may not be exactly how it should be done, but it was ridiculously easy to implement (even with accidental recursion >.> ). Implementing a sum method on two base prototypes of the language leaves me a touch uneasy but these are additions to the prototypes rather than redefinitions. If I were going to try this in production code of some sort I would need to either use a less generic slot name or properly check for an existing sum slot on both prototypes.
... Also it strikes me that the question was to write a program, not a method on the List prototype. Oh well. Nobody is grading this but me.

The averaging problem was pretty straightforward but I had some confusion around the select message. Mostly because I saw a reference in the programming guide to a method ISNUMBER() which doesn't appear to actually exist anywhere? Or at any rate I couldn't find it so I had to do this:

List myAverage := method(
values := call target select(v, v type == "Number");
if(values size == 0, Exception raise("No Number in target List"));
values reduce(+) / values size
)

Unlike the summing problem this solution will not handle multidimensional arrays. I could swap the reduce message for the sum method defined above but I'd have to handle n-dimensionality in the select message at the top of the method as well.

... I was going to finish day 2 today and post this. Actually I was hoping to post this yesterday but it has not been a very good week for side projects. Unfortunately it's going to have to wait. It might have to wait until the weekend. I want to get this posted at least and I'll try to get day 2 finished before Monday.

Tuesday, December 16, 2014

7L7W Week 2: Io Day 2 round 2>Finding my feet

I might be getting the hang of this.
recursiveFibonacci := method(n, 
if(n == 0, 
0,
if(n == 1,
1,
recursiveFibonacci(n - 1) + recursiveFibonacci(n - 2)
)
)
)

loopedFibonacci := method(n,
nSub1 := 0;
currentN := 1;
for(i, 1, n, 
currentN = currentN + nSub1;
nSub1 = if(i == 1, 0, currentN - nSub1))
currentN
)

Number recursiveFibonacci := method( 
if(call target == 0, 
0,
if(call target == 1,
1,
((call target - 1) recursiveFibonacci) + ((call target - 2) recursiveFibonacci)
)
)
)

Number loopedFibonacci := method(
nSub1 := 0;
currentN := 1;
for(i, 1, call target, 
currentN = currentN + nSub1;
nSub1 = if(i == 1, 0, currentN - nSub1))
currentN
)

Do I get double bonus points? Hm, no, probably not. It's not exactly a stretch to move from a parameter to calling the message target is it? These seem pretty self explanatory to me (Fib numbers aren't a new science after all) but I can't help feeling like it could be done better.

Division by zero? Sure, let's break basic math... >.<

Number divide := Number getSlot("/")
Number / = method(n,
if(n == 0,
0,
call target divide(n)
)
)

I did cheat a bit. StackOverflow pointed me in the right direction.

And it's bedtime now. I'll get the rest of the self study done tomorrow (with a grain of salt). So progress has definitely slowed in my 7(3!) week journey. However it's also getting more interesting so assuming there's a correlation between difficulty and interest... yeah.
Then again it may be due to my lack of cohesive sleep schedule (have I mentioned lately that ridiculous software installs suck?) which sadly will only get worse. There's another install this weekend (end of year compliance, yippee) then a family vacation (meaning all my wife's immediate family, which is neither vacation nor particularly conducive to any kind of study) right after Christmas... which is itself a disruption. Then of course there's the end of the year, which is another all-nighter (I've really got to streamline the end of month process)... I probably could have started this at a better time of year. Then again interrupted progress is better than sitting around playing video games or trying to study something that has gotten stale and boring. Maybe I'll take a break from 7L7W after week 2 and get back to some C#. Play the flipflop game with them. Or maybe not. Since I'm playing dablling all over the place maybe I'll crack that LISP book back open. I'm not sure the original  rationale for shelving it still holds. Ah, the possibilities.

Also, the song that's been driving me today like Paul Revere on speed. That's good stuff there. I must recant my uninformed, juvenile opinions of rap. I clearly had an insufficient sample size to base opinion on.

Monday, December 15, 2014

Google ate my organization

Damnit Google. The whole world may be going to flat, no order, bullshit but I personally keep my files organized in folders. I don't want to search every single bloody time I want to open something. I know right the fuck where it is, let me open it.

Or, I would know if you hadn't moved everything to this worthless damned timeline BS. Give me back my folders; I don't want to wait for you to load a Facebook-alike 'productivity' interface just so I can click through it every single time I try to open something. Talk about a waste of lifespan.

7L7W Week 2: Io Day X>Digging in

Feeling almost human again after my weekend. Serious 2 week prep & 4 hour imp software updates suck. Moving right along.

Let me try to break this down.

Io> test := method(stuff, stuff println)
==> method(stuff,
    stuff println
)
Io> test("Hello World")
Hello World
==> Hello World
Io> 

Interesting things are happening here. First I'm creating a slot in the Lobby...
Io> Lobby slotSummary
==>  Object_0x5bc8c0:
  Lobby            = Object_0x5bc8c0
  Protos           = Object_0x5bc860
  _                = "Hello World"
  exit             = method(...)
  forward          = method(...)
  set_             = method(...)
  test             = method(stuff, ...)

Io>

called test. But... I'm already ahead of myself. >.<

The method() block is sent as a message to the := assignment operator which becomes setSlot("test", method ... ) via a macro creating a slot in the Lobby and loads the method message into it. setSlot()sends the method block as a message, I think, and so the Lobby outputs the method with ==>.

In the next line I craft a message test and give it the string "Hello World" as an argument. This message is sent to the Lobby, where everything eventually lands I guess? It's the default evaluation context when there's no other object to catch the message. The Lobby responds to the test message with its test slot.

The Lobby's test slot is a method block that sends the println message to the first message argument (any additional arguments are ignored and generate no errors that I can see, coder beware). So a println message is sent to my "Hello World" object causing it to print to output. The "Hello World" message also gets sent on to the Lobby which outputs it with ==>.

That's a lot to follow in two lines of code. Time to take another hack at day 2.
Point of interest: the Lobby slot _ seems to contain whatever message was last output by Lobby via ==>. I could stand to learn the terminology for that. But I wonder how long it would take to crash the runtime by repeatedly sending Lobby slotSummary >.>

Friday, December 12, 2014

7L7W Week 2(early): Io Day 2>Empty tank

I followed the day's section but I didn't internalize it. Something is missing in my understanding and I don't have enough energy left in me today to chase it down. I'll have to go over it again tomorrow, assuming I get a chance to.

I like Io. It's different in a way that demands that I reshape the way my thoughts flow. In the same way that learning to use Suprtool for ETL processing required a more-than-evolutionary change in thinking from using SQL-like languages. I enjoy twisting my brain into different shapes like this.

Thursday, December 11, 2014

7L7W Week 2(early): Io Day 1>Scrumptious

Now this, this is something that looks exciting on day1. Yes, it's actually even easier to blow your foot off with a single line of code than in Ruby (Object clone := "hosed" indeed!) but for that only slighter greater power you get an incredibly flexible language. The syntax is extremely small and there seems to be only a very limited number of concepts to grok. No doubt the libraries are an even bigger elephant to devour than in most languages, or at any rate an even higher priority, simply because Io doesn't seem to have much in the way of plumbing available in the base language (file handling? don't see it yet) Even so... I think I'll spend some time with this one and see how it fits. Probably after this 7 weeks course is done in... oh at this rate about 3 weeks.

Enough prologue. Io is ridiculously tricky to search for on Google so I'm dropping links to my 'Find' results.

  • Examples: 
  • Community: There's an official mailing list, twitter, and IRC channel. No idea how active they are. Otherwise, Stack Overflow is all I could find.
  • Style guide: This wikibooks entry looks decent. No idea if there's anything more canonical. I'm not terribly perturbed about style right at the moment though. If I stay in Io long enough to have to find more resources I expect I'll find style canon alongside those searches.
Amusingly, many of my searches related to Io have turned up blogs of people, like me, working and blogging their way through this book. I find that quite amusing, though it highlights an apparent lack of external resources.

Anyway. On with the show. 'Answers'
  • 1+1 runs, 1+"one" does not. 1 is a Number type and "one" is a Sequence type. Sequences don't respond to the + operator. On the other hand, an object can be assigned to any other object at will and according to the Io programming guide even inheritance can be changed at runtime. Which, it seems, would make Io very weakly typed.
  • Everything is true. The cake is always honest. Unless cake := false clone or cake := nil clone. For proofs:
    • true and 0
      • ==> true
    • true and ""
      • ==> true
    • true and nil
      • ==> false
    • true and false
      • ==> false
  • <Object> slotNames or perhaps <Object> proto slotNames. You can also send the slotSummary message to an object if you also want to know what's in each slot.
  • = is assignment to a slot. := creates and assigns a slot (no unassigned variables, ever?) ::= creates and assigns a slot and defines an accessor method set<slotname>() in the object where <slotname> is the name of the slot with an upshifted first letter (existing catpitals are unchanged, only the first letter is upshifted).

So. Do:
  • doFile("filename") filesystem context is where the Io binary is executed from, rather than where it resides. This can also be sent like any other message to an object.
  • Execute the code in a slot given its name... I interpret that as 'how do you eval() a string'. Which is as so:
Bond := Object clone
Bond martini ::= nil
Bond orderMartini := "setMartini(\"shaken, not stirred\")"
Bond slotSummary
Bond doString(Bond orderMartini)
Of course he might just have meant Bond setMartini("shaken, not stirred") or in words, send the slot name as a message to the object in order to execute the code in the slot. In fact, that's probably the simple answer that was being looked for. I tend to overcomplicate >.>

So far so good. I'm quite a bit more excited by Io than Ruby on D1.

Wednesday, December 10, 2014

7L7W Week 1: Ruby Day 3>40 ct rubies

Hm. Only 3 days? That's not a week; things were just getting interesting.
module ActsAsCsv
  def self.included(base)
    base.extend ClassMethods
  end
  
  module ClassMethods
    def acts_as_csv
      include InstanceMethods
    end
  end
  
  module InstanceMethods
    attr_accessor :headers, :csv_contents

    def initialize
      read
    end

    def read
      @csv_contents = []
      file = File.new(self.class.to_s.downcase + '.txt')
      @headers = file.gets.chomp.split(', ')
    
      file.each do |row|
        @csv_contents << row.chomp.split(', ')
      end
    end
    
    def each
      @csv_contents.each do |row|
        yield(CsvRow.new(@headers, row))
      end
    end

  end
end

class CsvRow
  def initialize(headers, row)
    @data = Hash[headers.zip(row)]
  end
  
  def method_missing name, *args
    puts @data[name.to_s]
  end
end

class RubyCsv
  include ActsAsCsv
  acts_as_csv
end

m = RubyCsv.new
puts m.headers.inspect
puts m.csv_contents.inspect
puts "============================"

class Day3Csv
  include ActsAsCsv
  acts_as_csv
end

m = Day3Csv.new
puts m.headers.inspect
puts m.csv_contents.inspect
puts "----------------------------"

m.each {|row| puts row.one}

It doesn't look like much (and my additions to the book's template are probably quite poorly written or idiosyncratic) but there's some interesting metaprogramming going on. Including ActsAsCsv causes the class method self.included to execute with the including class as the parameter. In this case the including class is extended with the ClassMethods module which defines a single method, acts_as_csv, on the class.

Later in the CsvRow class we include ActsAsCsv and then call the acts_as_csv method. This, I guess, occurs at instantiation which means the specific instance of the CsvRow class gains the InstanceMethods module included by acts_as_csv rather than at the class level though in this case it applies to all instances. The InstanceMethods module defines methods which create the behavior of a CSV file. At multiple points the cascade of includes and method definitions is open to tinkering, conditional method inclusion or definition &etc. It's just gotten interesting, and now this 'week' is done. Maybe I'll study Ruby more later.

7L7W Week 1: Ruby Day 2>Take 2

Reading through the 3rd day's treatment and I decided to go back over this exercise from day 2.
This is better. I'm still not entirely convinced.
class Hash
  def each_hash
    h = self
    h.each do |element|
      yield({element[0] => element[1]})
    end
  end
end
class Tree
  attr_accessor :children, :node_name

  def initialize(name, children=[])
    if name.is_a?(String)
      @node_name = name
    elsif name.is_a?(Hash)
      @node_name = name.keys[0]
      name[@node_name].each_hash {|trunk|
        children << Tree.new(trunk)
        }
    end
    @children = children
  end
  
  def visit_all(&block)
    visit &block
    children.each {|c| c.visit_all &block}
  end
  
  def visit(&block)
    block.call self
  end
end

familyTree = Tree.new({'grandpa' => {'dad' => {'child 1' => {}, 'child 2' => {}}, 'uncle' => {'child 3' => {}, 'child 4' => {}}}})
puts "Visiting a node"
familyTree.visit {|node| puts node.node_name}
puts

puts "Visiting entire tree"
familyTree.visit_all {|node| puts node.node_name}


The notion of editing the base class at will and indeed the basic predefined classes/types, while apparently being an integral part of Ruby's design, doesn't come easily. And still this solution requires testing the type of the incoming parameter, making Ruby's blasé treatment of types rather dubious. Or, I'm doing it wrong™ which is also quite possible seeing as this is exactly the 3rd day I've done anything in Ruby.

What I've done here is basically the same as a C# extension method. What gives me the 'icks' is the notion of directly altering Hash.each to do what I wanted it to do. It seems that you can't scope the changes so it's a global edit of the existing class. Great power, &etc, plus TDD, but if anyone comes along later to update the script and tries to do anything with a hash while those changes are in effect it's going to bite them in the tail.

I think I'm feeling a tension between reducing failures and productivity at the cost of stability. It's hard to decide where the sweet spot is there. That's interesting since I spent a good bit of time developing in PHP which is pretty loosely typed.

Tuesday, December 9, 2014

7L7W Week 1: Ruby Day 2>A spoonful of sugar

I feel like I must be missing something. Because this:
class Tree
  attr_accessor :children, :node_name
  def initialize(name, children=[])
    if children != []
      @node_name = name
    elsif name.is_a?(Hash)
      @node_name = name.keys[0]
      name[@node_name].each {|trunk|
        children << Tree.new(trunk)
        }
    elsif name.is_a?(Array)
      @node_name = name[0]
      name[1].each {|trunk|
        children << Tree.new(trunk)
        }
    end
    @children = children
  end
  
  def visit_all(&block)
    visit &block
    children.each {|c| c.visit_all &block}
  end
  
  def visit(&block)
    block.call self
  end
end

looks ridiculous. The main problem seems to be that name[@node_name].each is giving me arrays instead of hashes. Which means I have to account for another type that I can't readily predict in advance... which seems to end up being the bane of dynamically typed languages. Yesyesyes ducktyping, &etc. I can't access elements in a hash the same way I access elements in an array so that's not really applicable here.

On the other hand,
i=0
File.open("data.txt", 'r') do |file|
  file.each do |line|
    i += 1
    puts "#{i} #{line}" if /dialog/ =~ line
  end
end
puts "----------------------------"
puts "Searched #{i} lines of file."

was relatively easy. Except for the false start with File.foreach which didn't seem to actually be giving me full lines from the file. Looked like it was giving me strings the size of some internal read buffer. Frankly, I expect enumerating a file to give me each line. Maybe it was user error.

Still. I'm not particularly impressed with Ruby. It feels a lot like working in PHP 8 years ago. Only with anonymous functions. Day3 is subtitled 'Serious Change' so maybe that'll be interesting.

Monday, December 8, 2014

7L7W Week 1: Ruby Day 1> Hellooooo Ruby

Somehow I was expecting more... wow factor? For as popular as Ruby is and for the kudos it gets it really doesn't, yet, feel more natural or seamless to me. Maybe I've spent too much time with 'harder' or 'crustier' or 'more obtuse' languages to get it. /shrug

Maybe day 2 will have more excitement; I will endeavor to be open minded about it until at least day 5.

Seven Languages in Seven Weeks

Go.

Wednesday, December 3, 2014

Chrome autocomplete

I am amused that I can type 'gith' to go to github.com.
Is Chrome making a statement here? >.>

Monday, November 17, 2014

The Value of Repeating Yourself

Brian Douglas posted a great comment on his study practices. Worth a look at Concentric Circles in Learning and, anyway, what follows is a continuation on the theme so you might as well take a peek.

My personal take on the notion is to do the example project alongside the book you're studying. After the first run through create a new project in a different topic. It doesn't have to align precisely with the 'canon' project and in fact if it's subtly different that's actually better. Now you track through the book using it as a scaffold to build out your app.

The goal is for your second run through the material to be more about translating what's in the book to what's in your dev project; you want to be constantly thinking "oh, the book says fooDbEntry but in this app the object that handles the database entry I want to change is barDbEntry". It forces you to better understand what's going on under the code you're writing, how your chosen task differs from the example, and more importantly how you have to adjust the example code to meet your new goal. That directly builds and reinforces your mastery of the underlying concepts and trains your mind to see things through the code instead of through the domain you're writing the code in.

Of course there's the additional benefit of having built something (possibly) useful that you might want to elaborate on instead of yet another example app which is rarely anything that anyone wants to revisit. As a development process it's ridiculously inefficient however the goal isn't to use this as a development process; it's a learning process.

This is, perhaps, less applicable to course material like you might find on a MOOC or similar online location where you're heavily railroaded and it's difficult to flip around the material from place to place. Just an example of how the printed word (paper or screen) is always valuable even alongside an audio or video format.

Monday, November 10, 2014

Visual Studio published my DB passwords

Wasn't that nice of it? *.pubxml is .gitignore-ed innit? Why yes it is. VS ignored that directive and published it anyway. Thanks much. Fortunately it's just a low profile Azure SQL DB and a learning experience in resetting the password on the Azure DB plus fixing the password configured in the relevant Azure website.

More importantly, google found me this:
http://ericnelson.wordpress.com/2014/06/21/is-visual-studio-2013-ignoring-your-gitignore-file/

Which worked like a charm. Cleaning up after the problem took three times as long as actually fixing it. Sounds just about right to me.

Wednesday, October 29, 2014

Creating a custom snippet in Visual Studio 2013

Bleh. Checklist-simple procedure that I'm tired of re-researching.

First, reference material from MSDN

Altering an Existing Snippet

If you want to alter an existing snippet to make it line up better with your workflow:

  1. Ctrl+K, Ctrl+B (or Tools >Code Snippets Manager)
  2. Find the target snippet
  3. Highlight the "Location:" field above and copy to clipboard.
  4. Open >File...
  5. Paste the snippet location
  6. File >Save (filename) as...
  7. Browse to your snippet repo (you do have someplace safe to store these as 'source' documents right? these are productivity enablers after all)
  8. Name it appropriately (Custom usually works well)
  9. Proceed to the next section.

Build Your Own

If you're creating something from (mostly) whole cloth... well, don't reinvent the wheel. Follow the steps above but for the target select an existing snippet that does the same kind of thing you want (scaffolding with fill-in templating like the 'if' snippet, or pure expansion, or whatever). That way you have all the details already written and existing syntax to build from. XML documents can be particular and there's no reason to waste your time learning all the special syntax for code snippets. You've more productive things to do than become a productivity tool expert.

Editing

A few words on editing your custom snippet XML. 
Header is where you'll put metadata like author, description, etc. Make sure these accurately reflect what you're doing, and don't try to blame "Microsoft Corporation" for your hacked-together XML drivel.
Double check sections like and because you don't want your snippet to accidentally import libraries that the final code won't require (the 'testm' snippet for example references some unit test libraries that won't be required if you aren't creating unit test code)
Declarations is where you'll set up user input fields and IDE-ready type references (testm is a good snippet to see how these work)
Indents are quite tricky in my experience. They seem to be literal with the first line beginning at the start or the shortcut text in the editor. You'll probably have to play around with it (see importing below). I can't seem to get it to properly indent based on the indent level the shortcut begins at. However it works properly for the built-in 'if' snippet so clearly it's possible. It must be a personal failing.

Importing

  1. Open the snippet manager again (Ctrl+K, Ctrl+B)
  2. Click Import...
  3. Browse to the XML file and select it.
  4. Pick a folder to drop it in. May I suggest the pre-existing "My Code Snippets" folder?
  5. Hit OK and OK.
  6. Test it. Inevitably it's broken in some way. Identify the problem (google can be your friend but more likely for something this esoteric the MSDN doc above will be more useful).
  7. Make the necessary edits and re-import. When you're asked how to handle the conflict just overwrite.
I thought the last time I did this there was a way to edit the snippet in place but I've forgotten how I did that. Possibly by opening the snippet in something other than VS (it's pure XML so most XML editing programs should handle it just fine) but you might have to re-open VS before the changes take effect. Frankly I'm not going to devote any more time to it right now; I'll update the post if I learn better later.

Tuesday, October 14, 2014

Version dependency sucks

Studying MVC. Working through the book and all is well. Unit tests, Ninject, Moq, &etc &etc. Until it discusses [HiddenInput] in chapter 11. It simply doesn't work. I tried several variations of the attribute with (DisplayValue), without it, set to true, nothing changes. The input still shows up. The scaffolded edit form generates exactly as though the attribute weren't there at all.

So I go back to basics. The projects reference MVC and each other, the model object used by the Razor view is the correct class, all the unit tests are fine. So I start casting around Google. Which just gets me a crapton of tutorials on how to use [HiddenInput] (as though it weren't stark obvious when it's working correctly). At this point I'm tearing my hair out. The closest I can come is a hit on StackOverflow for [HiddenInput] hiding the Display functions in Razor. Not my problem.

At wit's end I use the search function on StackOverflow itself to find "hiddeninput mvc" and ... wait, way down the list here is Q: HiddenInput(DisplayValue = false) Works on one dev machine but not another

This isn't quite my issue but it's more promising than anything else I've looked at. As it happens, the OP had issues with the MVC versions that were being referenced on the two machines. Well. All this is on one machine, sooooo... but there are two different projects involved here and of course projects all have their own references. So I dig MVC up in the reference list and look at properties for it in both projects. Bingo. The domain project references 5.2.2 while the web UI project refernces 5.2.0. Score. Of course, if it's possible to specify a version from within VS I don't know how. I have to open the .csproj files in UltraEdit and find the reference entries for MVC. At least it's XML with a readable schema. Update the web UI with the more current version from the domain project (a simple copy/paste) and we're off!

Except we're not. Ninject spews guts all over my dependency injection because it can't find MVC version 5.2.0. DOH! It all becomse clear now. NuGet-ing Ninject into the web UI project forced MVC to version 5.2.0 however I didn't install Ninject in the domain project so it was left defaulted to the more (most?) current version.

The moral(s) of the story? Version dependency (down to the second point level for crying out loud) sucks. And Google can't always find the most relevant answers.

Monday, October 13, 2014

[Desktop|Mobile] first developement

Caveat lector: I'm probably not qualified to ponder this subject nevermind spew my ponderings across the web. But then again, tats wot teh innernet is for innit?

I prefer desktop first. Not because it's easier (mobile dev is still new and will, all things being equal, improve). Not because I'm an old curmudgeon (though I am). Not because I'm a luddite (I'm not). Not entirely because I think 'mobile' everything is overly hyped (that's a whole 'nother post). The reason I feel this way can be summed in one simple analogy.

I'd rather have a van for my family of 5 than a smartcar with a trailer hitched to the back. A smartcar will get one person, maybe two if they're quite friendly, to work and back. Possibly through a small trip to the grocery store. There can't be any significant cargo space in those things; groceries for my family would take up the entire cabin. The smartcar is essentially equivalent to mobile first development. You get the basics (4 wheels, propulsion, steering, safety equipment) done first and eloquently. Then you start bolting on the extras as they'll fit (stereo, sunroof). Then for the things that won't fit on mobile you build out a desktop version. You bolt on a trailer with some seating to carry passengers (still, no cargo space to speak of if you actually want passengers...). Stop right there. The van will do all that with aplomb and grace... while sucking up gas and spewing out fumes like nobody's business. They both have their faults.

So I have a van to tote my groceries and family around with. The passenger and cargo space is important  to me so I want it done right the first time around. All you people with smartcars are going to understand when you build a family (or you already have a family and multiple vehicles, patience I'm getting to that). In the same way if I care about the functionality of the software (in other words, if I would actually give someone money for it) then I want the broadest functionality built in the most efficient, eloquent fashion. Desktop first. For those pieces of software that I don't really care about mobile first is fine. The key point, just like the analogy, is that I don't need the desktop quality experience or functionality for those packages, and indeed I probably don't want to have all those additional features taking up resources or mental energy. MSPaint works great for the vast majority of the graphics editing tasks I have. On the other hand Notepad is not a sufficient text editor for me (for the vast majority of computer users it is more than sufficient) and so I pay for UltraEdit. Note that although I have MSWord it is not a text editor :P

Now, here's where the analogy breaks down. People that need a van will often have a second vehicle to use when they don't need the full capacity of the van. On the other hand typically you'll only use one software package for any given purpose (for a number of important reasons). If you routinely use Photoshop (or GIMP) then you probably won't bother to open MSPaint. I rarely open Notepad because text formats are associated to UltraEdit in the OS and UE is my instinctive go-to in all other cases. There's the rare moment, equivalent to renting or hailing a cab, when I'll open Notepad from the Run... dialog just to act  as a backup clipboard but those are outlying cases. You'll note that in those cases I'm not paying for the mobile-first software package.

There are, of course, cases where the mobile platform has inherent value that makes up for it's reduced capability, again those are outliers. Yet it seems like most mobile developers bewail the fact that they can't get a user to pay $0.99 for their mobile app while for some reason people still pay for desktop apps (and a lot more than a mere $0.99 in most cases). Is it perhaps because reduced functionality apps are used mostly by people that don't need the functionality enough to pay for it on any platform?

Saturday, October 11, 2014

On privacy

Yeah. I'm listening to Glenn Greenwald on TED in Brazil. I quite thoroughly disagree with him though I suspect it's a different kind of disagreement than he's used to.
I value privacy but I value it not as itself (that is, being private from the rest of the world) but as information. Let's face it. In the 'Information Age,' or whatever the hell they're calling it now, privacy is the gold in Fort Knox. The internet and the computing systems we, as a world of people, have built have effectively leveled the walls and we're desperately trying to patch them while yelling and screaming at the looters to stop.

It won't work. The walls can't be rebuilt (and they shouldn't be) and the looters will never stop because, really, who would? People are making money by the boatload on our information. There isn't a force on Earth that can stop them. Look at any pre-digital major corporation; they're all still making money, pretty much the same as they always have.

I have a different proposition. Let the NSA do all their petty spying. Let Google, Faceplant.... er, book, LinkedIn, et al do their tracking. Let them have our webcam feeds. Let everyone correlate to the big 3 credit bureaus if they like and perform statistical analysis with all our Amazon purchases. I frankly don't give a damn. BUT. Not because I have nothing to hide. But because I have one simple stipulation for all the data whores. It's incredibly simple in word (implementation is another story but we're all of us blue-skying here because it's still very new discussion). Let your data free. Publish it; let the public search it (using the same internal mechanisms you use).  Scary? No.

What people fear isn't that the NSA knows you bought a dildo or whatever. It's that you have nothing on the NSA (other than they're a bunch of lying, spying, sneaky creeps). You're worried that your nosy neighbor can search through your ... search queries? But you could look at theirs too in such a world. Because the real value of information to an individual or entity is inversely dependent on how many other entities know that information. Let's look at this side for a bit longer. If everyone knew what was in the diplomats' emails that the NSA snooped (which everyone does now, sincerest thanks Mr. Snowden) then the value of that information to the NSA is roughly nil. Similarly in the reciprocal world I envision (and reciprocity is the key here) the same memos are worth just about nothing to any government because all their emails are public also. Before anyone mentions the 'chilling effect' allow me to say that the full effects global freedom of information won't be apparent until the second generation. The same way nobody grokked the internet until people grew up with it. Global freedom of information will force everyone to realize and accept that everyone is human, that everyone makes gaffes, has some opinions we disagree with, that everyone gets naked, and nearly everyone has sex sometimes. It's only when there's an imbalance of information that privacy matters.

Any schoolchild can tell you this about secrets.
Value = Information/(how many people know it)

Bringing this monologue back to Mr. Greenwald's talk let me address his very valid point about black and white. There are, indeed, no Good people. There are people that are good, but everyone has 'dirt'. Everyone is, when considered completely, Grey. We are imperfect, flawed, weak, and corrupt in our own individual ways. When everyone is forced to acknowledge that about themselves and everyone else then knowing someones weaknesses ceases to be something of value. Indeed, it becomes a strength because we would no longer need to guess which politician is the most corrupt.

Mr. Greenwald goes on at some length about passwords but I'm afraid he's missed the point there. Passwords are not privacy. Passwords are authentication. No, you may not have my bank password; not because i wouldn't want you to see my purchases (again assuming reciprocity, I will not give you an imbalance of power either) but because I don't want you to make purchases in my name. Ditto email. That whole section of his talk made my head ache and if I'd been in the audience I'm afraid I would have gotten thrown out for screaming at him that he's an idiot.

However he was trying  to make the point that people who claim privacy is dead are hypocrites. He does make that point effectively about Eric Schmidt and Mark Zuckerberg. However I stand by my view. But it is a reciprocal view and cannot be implemented by one individual. To give away my privacy while others refuse to give away theirs (and every entity with the wherewithal is spying on us all and hoarding the data to themselves) is ludicrous. Yes, I make some small measures to maintain my privacy. Not because I don't believe my own rhetoric but because nobody else is willing to reciprocate and freedom doesn't work unilaterally

Meh. I'm tired of properly composing my thoughts, and I've other things I need to do as well. I'm not a journalist either. So I'll just jot down some oneliners during the rest of his talk as I listen to it.

Shame? Judgemental eyes of others? Reference the above about humanity becoming more understanding (even compassionate? O.O ) when everyone can know everything about everyone else.

So there's a correlation between being observed and the actions that one is willing to take. But is the mere observation the cause? If you video yourself (you, observing yourself) do you act differently? I submit that it is the imbalance of being observed while making a choice but not being able to observe the other while the other makes that choice that is the root cause of the behavioral change. But then, I'm not a [psych|soci]ologist.

Panopticon? Holy hell. Can we say imbalance of power and observation? My point still stands.

Oh, yes. The Abrahamic god. Still. Every example he gives posits an imbalance of observation.

I do agree about the destructive lessons in the phrase "only people with something to hide fear surveillance."

Dissidents. Yes, they could be tracked by the government. He follows that immediately with the measure of freedom of a government by how it treats its dissidents. Treatment that, if everyone was watched by everyone else, everyone would know. Catch22.

I will take the 1 or 2 generations of suppressed freedom of choice due to mass observation in order to break through to a more idealized humanity that accepts itself for what it is. Sadly, such informational freedom is unlikely to ever happen for emotional, political, and admittedly practical reasons.

I dislike the ad hominem agains Snowden as well. However the mirror accusation is scathing and probably isn't as universally applicable as it's stated. Of course, it feels as good in my gut as it apparently did to the majority of the audience but one has to vomit those feelings out of the gut and examine them thoroughly or you're going to have a hell of a lot of indigestion when those ideas curdle later.

Closing with a pair of personal definitions:
observation: knowledge of events shared among all entities
surveillance: knowledge of events kept secret by one or a few entities

Tuesday, October 7, 2014

No. You don't understand genetics

Unless you're a geneticist anyway. And even then it seems understanding is a quite limited word.

You're a smart, technically apt, curious person? You don't believe me and want proof? Here's a single statistic.
The wheat genome consists of 17 billion (yes, with a 'b') bases. That is, apparently, 5 times more than the human genome. What, you thought you were more complex than wheat? Not at the genetic level, bub.

Friday, September 26, 2014

Code break

I need a break from the fractal project. So... hm. Looks like I have a project in my ToDo list to see if file sizes on a harddrive (in this case, my personal C:/D:/etc) obey Benford's Law. So here we go.

Analogies

I love a good analogy. I love finding an aesthetic analogy with great depth. I love crafting them and plumbing them to see how far it can be taken before it breaks down.

In that vein, I feel like I've been playing my life so far as Pachinko. I'm moving to the poker table people. GTFO of my way.

Trading and other things

Yuck. Account looks like crap but i haven't been focusing on it like I should.
On the other hand, October is looking net positive which will be the first in a long number of months. I think the problem has been a lack of focus on acceptable risk for my size and lack of mechanical implementation. Both stemming from there just not being any opportunities.

In the rest of life. I've been working to transition from my current systems admin job into something with a future. Not that this position couldn't be a career with a progression but it won't be for me because it simply doesn't interest me. I'll never excel at it because, frankly, I hate the work. So I'm transitioning to development, which was my original intent and where my (lackadaisical and overall pretty abysmal) education is.

To the present and future, I've been studying Pro C# (I could link the book but I'm lazy and at work) and building a WPF app for rendering and manipulating fractals. I've tried MOOCs and a few books, and I always get bored. I bloody well know what a loop is. Variables are dull. I comprehend OOP, inheritance, multiple inheritance (and the lack thereof), interfaces, blah blah blah. Thankfully, C# has been just different enough (with language features I'm not familiar with) throughout the process that I've been able to skim this book in spots without either missing anything or getting fed up and skipping whole chapters then getting frustrated at having to go back and look up some minutia 3 chapters later.

Or maybe it's just that I have some level of external accountability in the relationship I've been cultivating with a prospective employer. That always helps focus.

Anyway. Enough of this. I have a meeting in 5 and one more unrelated topic I need to post on.

Sunday, August 17, 2014

Huh, blog? Wha?

Oh, right. This thing.
Trading proceeds apace. I've suffered setbacks (largely related to having difficulty learning to trade in a no-vol environment) and had to kick in more funds. At this point in time (ironically at the point in time that vol seems to be settling back in more or less) my funds are so low that I can barely participate.

I'm still struggling along with a couple calendars and some iron condors and I seem to be getting better at making a small buck. It really helps that my commission structure has been changed to a flat $1.50 per contract (thanks Dough.com!) so the IC only costs $6 each way instead of nearly $13 >.<

In unrelated news I've started studying C#. And because I'm retentive like that I've Git-ed the example code I've been playing with, available here.

Sunday, June 15, 2014

Why Python disgusts me

The syntax is ugly, inconsistent, and whitespace-aware. Which is survivable by itself but the 'community' makes it untenable with ivory tower defenses related neologisms like 'pythonic' which means, as far as I can tell, 'we like it that way so nyah.'
I, on the other hand, just want a language that can be read without requiring a deep, memorized grokking of how a damned boolean equation will evaluate depending what data type I happen to be working with.

Ridonculous discussions ensuing from this simple question being a perfect case. Explicitness is, apparently, of less value to these people than 'pythonicness'. There's a reason the symbol 'explicit' has existed in human language rather a lot longer than the symbol 'pythonic'.

I can go from debugging C++ to VB.net to (with a lot of brace counting) LISP to Perl to PHP with more or less minimal hiccups. Python I can barely look at without wondering what the fuck a given statement really means, nevermind trying to actually write something efficient and readable that requires more than one conditional.

Fainting

After hearing Neil Gaiman's recounting of strangulation in the Studio 360 interview on Jun 13 I'm reminded of the time I fainted while giving blood (I actually haven't given blood since then which may or may not be related to this experience, I'd like to believe it's not related and that I'm simply more squeamish than I thought... I really need to develop a proper habit of donating).
I mostly remember the process and completing the withdrawal. And then they applied the iodine. Now iodine (concentrated anyway) is a decent antiseptic and has a powerful odour. I remember it from my first blood donation and don't recall it being as strong as this. Perhaps my consciousness was already retreating from the rest of my senses back to the more primitive ones because the next thing I remember is floating up out of pitch black. Noise, and a very distinct, quite 'real' sensation of exerting direct and conscious control over each muscle in my body, one at a time. Before finally grasping the words in the noise I'd been hearing and then opening my eyes upon full living experience. There was no intervening out of body or light or anything of that nature. A Mystic might call this mundane but I felt it, remember it, as profound.

It's interesting to note that at the time it felt like I was directly experiencing each of my individual muscles but with greater experience (I was maybe 15 when that happened) and reflection I realize that I was only 'feeling' major muscle groups. The limbs mostly, and some parts of the trunk.

The root cause is, clearly, that I lost too much blood too fast and my body was unable to maintain enough flow to my brain. But I was in the same mostly-reclined position the entire time and it didn't happen until they'd already removed the needle and were cleaning up. Which makes that explanation a bit awkward. I suspect it's very much related to the subject of the next sentence though.

I've passed out since then due to a mostly-minor heart condition. The above surreal, more-than-real experience has not repeated itself (though like many I can massage my brain into experiencing induce mystical experience). The last time I fainted (it's only happened twice, I'm not some Victorian Lady.. :P ) I only remember coming to as being incredibly cold as though I'd just been dug from an avalanche and no amount of hot soup was ever going to make me warm again. Of course, that too passed. The mind is great at filming over the scary parts of life when given enough time.

Inner Eye

Note: A few weeks after my brain handed me this notion I heard about a presentation at a conference of some Android contact lenses. Funny how things work. Of course, it still took me a few more weeks to put any of this into draft (and then a few more weeks to decide 'fuck it' and hit publish in its present form rather than obsessively cleaning and polishing it...). It's also important to note that this is inspired directly from The Light of Other Days by Arthur C. Clark and Stephen Baxter which uses a more existing science to build the fiction on.
I'm just splashing stuff out here. This is rough first draft and doesn't really amount to much of a story. It's just prose containing some mashed up ideas and some consequences of those ideas.


I woke to the sound of another's breathing. Opening my eyes I did not see my wife, as I expected to, but instead I saw my self. My brain struggled to make understanding out of my senses for a few vertiginous minutes before the faction of rationality finally quashed the faction of 'OMG out of body experience, squee!' and I noticed that my irises were glowing faintly.




The bits behind the 4th wall...
bluetooth cameras at eye corners, auto paired in sleep
sleepers lenses project soothing light onto retina
possible further plot device: cameras detect motion without corresponding signals in sleepers brain, trigger wakefulness
You can't regret what you don't decide - Sick Puppies, "There's No Going Back"
Can't regret my past life because in large part I made no decisions. By my own doing I did not have an active role in where my life went and so I cannot regret where I have arrived at. I can regret being numb and largely sleeping or reacting my way through life but what occurred and where it placed me is simply what it is.

Thursday, April 10, 2014

Brokerage swap

I don't like how I had to do it but I've finally gotten off that old school, outdated brokerage. I've lost a month or so. Two or three weeks because I stopped adding on due to a very exciting job opportunity. Sadly that fell through but it's a mixed sadness since it would have put a major damper on my trading. Lost a week trying to get permissions on the broker I wanted... damn it. It made sense to go ahead with the move since I had nothing open in ETrade due to the aforementioned and it made so much sense (and I hate ETrade so much) that I finally 'forced' the issue (sort of >.> ). Then I lost another week to get the money transferred ffs. Damn slow ACH. IT CAN BE DONE FASTER YOU LITTLE SHITS, ASK THE EUROPEANS.

So I've lost a month or so. But now I'm where I feel I need to be and it's time to start laying on the trades again. Huzzah!


In the interest of complete reporting at the end of Feb I was down about $750. Which is bad, but it can be traced back to 2-3 serious losers where I had more risk on than I should have had in any one trade. If I eliminate those outliers then I'd be net positive. And those are clear outliers losing me $300-$550 each when my other losers (and I had several more besides the outliers) all lost me <$100.

One one of my outliers... oh hell, just call them what they are. One of my mistakes was to put on 3 lots of a $100 spread. I had to put on 3 lots to make profits outweigh my commissions, but unfortunately the position was a loser. So a loser with, obviously, marginal premium taken in on $300 risk was a serious mistake in an account my size. Doh. Another was a $500 spread. What was I thinking? Clearly whatever was in my head it wasn't sufficiently focused on the level of risked capital. The other major loser is similar, just too wide a spread.

But I topped up the account and I've moved to it TDA, where I can operate with a lot less friction, and now I'm in the game again. Let the fun begin.

Today I've put on a 7->15 calendar (that's 7 DTE by 15 DTE, very short term calendat) in GLD, and two 7 day iron condors one in PCLN and one in SPX. Waiting for the morrow.

Thursday, March 20, 2014

Trading liquidation

So the first round I fired at the market has been largely a dud. Several wins with unacceptable losses.

The remaining positions will all finalize over Fri/Sat and I don't expect to have enough left in the account to maintain margin capability after that. So it looks like it's back to saving up my pennies. I call it educational expenses.

Tuesday, March 18, 2014

Note from Flight# WN5627 from AUS -> ATL (2 hours and 15 mins.) Layover of 1 hour and 1 mins. Flight# 5535 from ATL -> TPA (1 hour and 25 mins.)

It always amazes me to look out over the wing and watch as the only thing between me and the ground becomes a bunch of physics and engineering. Oh, and air. That the air seems less substantial than the physics (simply knowledge) and the engineering (put into practice) is somehow deeply mystic.

Post- The title is copied directly from the Evernote entry that I used to record the thought in the moment. I have no idea how Evernote 'knew' that much about my location and itinerary. I guess it's been snooping in my gmail and put a lot of bits and pieces together before I turned off the wifi, GPS, Bluetooth, and cell signal?
Creeping me out here guys. >.>

Thursday, March 13, 2014

On Brokerages

ETrade is crap. I'm sitting with a threatened credit spread that I want to butterfly further OTM. There's no way to do that in ETrade's interface. What a crock. Because I have a small account I don't have the capital available to do it in two trades and there's literally no way to put the trade in as a butterfly because their interface can't understand that I'm selling 2 of the same option to close and open position at the same time.

I hate this brokerage.

Wednesday, March 12, 2014

Live trading strategy

So far my trades have been exclusively iron condors on underlyings with high(ish) IV rank at 65+% probability OTM on both sides. I've done a couple of re-wingings (re-opening a closed vertical on the untested side of an existing IC).

The procedure is roughly as follows:
Look at Dough for interesting products (could be replaced with a stock scan if  my TDA account were funded, but Dough's curated list is faster at the moment).
Load up the option chain in TOS and look at the proper OTM strikes. If the credit is >50% of the width then proceed. Otherwise go back to Dough.
Put the credit and BPE (which is the strike width - credit received on a symmetrical IC) into my spreadsheet and let it calculate my exits. If I like the exits (which are calculated based on a %age of max profit) then I'll put the trade on.

The formulas in the spreadsheet are built around getting a high return on the risked money which I use the BPE for. Since it's all melted together (and assuming my formulas are correct; which I've checked a bajillion times) I just select a target % of max profit from the automatically calculated 25, 30, 50 and 75% and nearly always come out at least 20% return on BPE with all commissions calculated for. So I can just plug in the strikes (or manually copy BPE into the spreadsheet from TOS) and the price I'm contemplating selling the IC for and look at where my exits would be.  Often they're negative which just means there's not enough premium to sell to overcome my commission cost. Sometimes the exit price will be a couple of pennies and I'll usually skip those because I expect I'd have to wait on the trade for too long.

Wednesday, February 12, 2014

The Supertrader, round 3

https://www.tastytrade.com/tt/shows/must-see-tt

Episode 2014-02-12

Great interview. My 3 takeaways:

1. Get a buddy. Trading as a group has a multiplying effect.
2. Trade mechanically. Don't think about the position; analyse the position and treat it accordingly.
3. Keep it simple. Tarting things up with charts and analysis just makes it harder.

Bonus round: Trade what works for you. Duh, but sometimes you have to be reminded.

For some reason I think I had a different takeaway, bringing it to 4. I'll have to watch the video again. Planned to do that anyway.

Thursday, February 6, 2014

Trading update

I still have a ton of proto-posts to get done. Nevertheless, bit of an update.

Half the GOOG iron condor closed. I've split all my exits now (well, most of them; it turns out it didn't make sense to split some of them) so that I can close one or the other spread on a stock swing without worrying about closing them all at once.
I have no idea why I didn't think of that (or remember it? whatever). A good friend of mine had to point it out to me.

So my first TWTR spread closed over a 2 day period as well. One side closed on the 4th and the other on the 6th. For a total profit of $29.04, including all commission costs. Took 10 days to close it. So I risked $115 to make $29 in 10 days. Not too shabby? I've responded by opening a MAR iron condor in the same. IV rank &etc are good for March too.

I have an iron condor on SINA that's half closed too. I need to look at that one again because...

I've learned that re-opening these closed sides makes good sense. My GOOG call spread (that I mentioned above) closed for a tidy 25% profit on risk (it's an untidy calculation, I can discuss it in detail later). That left the put spread still hanging out (untested, if you're curious) and tying up capital. Since I happen to like efficiency, and I caught the idea on Tastytrade at an opportune moment, I hacked up my spreadsheet to run some numbers. And of course it works wonderfully to sell another call spread across from the puts. I've re-opened the call position for less credit than initially (time decay) and at closer in prices (the stock has fallen and I'm now 80% OTM instead of 66% at 1 strike lower!) collecting a nice $80. So now even if The GOOG tests those puts I have more room to maneuver without losing money. To use harder numbers, my initial buying power effect was $190 but with the additional $80 that's effectively $110. Plus it's got the same expiration so one way or another the $80 will settle 15 days. I'm a happy trader.

Coming back to SINA... My puts there are tested. And while I have plenty of time to wait it makes me uncomfortable. However there's a nice call spread at 78% OTM that'll give me $0.42 to mitigate losses with.
You know, the more I do this the better I like it.

TL;DR: Stand back. I'm learning, and I need my elbow room.

Edit: The GOOG puts closed now. >.> I'm just going to let it die, I don't feel like playing that kind of game for too long. The SINA call spread order is in. If it doesn't fill today I'll try again tomorrow.

Monday, February 3, 2014

Random dissociated thoughts on theology

Literalism is the Pharisee's Crime. Or perhaps just their first mistake. Confusing the forms of religion with the soul of it.

Some people feel there are mistakes that can't be redeemed. Various addictions, 'selling your soul,' &etc. I ask in response "Is there some act sin that God cannot cleanse?" Keeping in mind (insert verse reference to thought crimes), are you any better? Is there a repentant sinner that God cannot save even from the very hand of Satan? Can evil spit in God's eye with impunity even in the most extreme of cases? Is God really powerless to save His people when they accept Him?
I have to answer myself in the negative.

Lest we descend into worry over our progeny or our fellows we must remember that God doesn't lead us into temptation that we cannot resist.

Sunday, February 2, 2014

The more I go to church...

The more I attend church the less I seem to be willing to accept the idiocy.
Is this what the phrase 'losing religion' means? It's not the inverse of 'gaining' it so far as I can tell. It's a consistent, progressive chafing at the inherent flaws that others ignore. Gaining, if that's what really occurred to me some 5 or 6 years ago, felt different. Not a steady numbness or increasing indifference to flaws. Though to be fair life wasn't exactly nice at the time and perhaps it's more that I was retreating from life in general and thus not paying attention to what I was doing.
Hm.

Anyway. Since I never manage to remember thing like this later...
How is it that God is supposed to be as expressed (unchanging, love, perfect, never mistaken, etc) yet in the famous passages where Moses receives the commandments and Aaron builds a golden cow (EXO 32) God as much as says "Oh forget it. I'm just going to kill all those people and make you, Moses, a 'great nation.'" Wait, this is our benevolent god? Serious echoes of Noah here (which He said He'd never do again... that's a different argument).

Then over a couple of verses later Moses convinces Him to change His mind? Wait, I though God's opinions were immutable? How does He go from destroying these sinful people (oh yes, those that love their children are willing to slay them at the slightest insult?) to, well, we're not told hoe He felt after Moses reminded Him of His oaths... wait. Why did God, of all beings, need to be reminded of His oaths to Abraham? Hm again.

Tuesday, January 28, 2014

Verizon sucks

I don't know what unfortunate gentleman Verizon thinks is my mother but I've been bothering him constantly today because Verizon is incapable of running a cell network.

Here's hoping the idiots can at least transmit text messages.

Thursday, January 23, 2014

Trading, day 2

Some hiccups getting started, and I'll journal all that when I feel like taking the time, but finally on the 23rd I've opened my first real money positions.

I put in an order to sell a GOOG IC last night, which cleared quite quickly this morning, and an hour or two after open I added a position in SINA. My balance is up 20% which is of course quite misleading but still. I'm satisfied for now. Trading through ETrade, not my first choice, is damned clunky when my research and tracking are done in different places. At the moment I'm doing research using a combination of Dough.com and Thinkorswim and tracking my trades using a Google spreadsheet. It's fugly. I sorely miss being able to look at my activity as a history or transaction log like you can get on TOS. It took me way to long to even find the cash balance on ETrade's site. Damn thing. I'll make it work only as long as I have to.

Anyway, these two were filled today, both to open. :)

.GOOG140222C1200-1
.GOOG140222C12051
.GOOG140222P1120-1
.GOOG140222P11151
filled at $3.10

.SINA140222C80-1
.SINA140222C82.51
.SINA140222P67.5-1
.SINA140222P651
filled at $1.25.

Yeah, that's probably hard to read. Frankly, I don't care. I just copy and paste from my spreadsheet and can't be bothered to pretty it up.

Something I want to do: Find a means of charting the projected market value of an option spread using theta and charm of theta over time to allow me to predict how many days it will take to reach various profit points. Using that I can (in theory) guesstimate what plays will offer me the best return on a per day basis. Hm. Though I may need to upgrade my PC (and my understanding of calculus) to implement it unless there's something that does that already. Anyway, that's a bit of a future consideration. I just want it recorded for now.

Wednesday, January 15, 2014

The Trading Plan

I recently heard SLM's  trader psychology segment from Jan 9, 2013 and was a bit kicked in the tail. I'm failing part of the plan that my wife and I agreed upon. Though it's only part it's a psychological crack that I can't leave un-mended. So to bring myself back in line: Here we go.

(doc link to the most current version, also it's over in the pages list)

Preface

I've had this sitting in Evernote for ages. Well. Alright, since 8/17/13. That's ages in some (a lot of) contexts. Because I've been sitting on it, being lazy, I've broken Guidance #5 from the get go. Drat it all.
Worse, I realize looking at it again that the plan has changed. Which is fine, but I'm not going to post the original version now, that'd feel silly, and so the progression is lost. Ah well. Also some of this is a bit forced because I'm trying to maintain the generic flavor of the plan when I've already pretty well gelled strategy and methods for the time being. Everything is subject to change though so I want the plan to be able to encompass those changes in strategy. It's simply hard for me to pull back from the specifics I've already decided on yet necessary to do so.


The Trading Plan


  1. Assertions
    1. I intend to begin trading stock options. If sufficient income streams can be built to finance my personal budget while continuing to grow account balance(s) I will cease to have a 'day job.'
    2. I will be performing strategic trading based on carefully considered metrics without relying on any accuracy of forecasting individual positions.
    3. Which segments and what sorts of metrics or analysis are something I must continually research, test, and refine; as a trader this must be the skill which defines my trading and will be the algorithm that will be built into future growth.
  2. Guidance
    1. I will actively discuss results and progress with my wife. As my children are ready I will introduce them to these topics.
    2. I will perform stock-picking only as paper trading. CAVEAT: I may need to bootstrap with discretionary trading but will resist the inherent belief that I can pick a winner.
    3. I may take a bath in the event of a housing-collapse-style event. I accept this possibility and will not rely on trading incomes to survive until such time as I have sufficient reserves to re-start  from scratch (this assertion will require continual, ongoing analysis of budget requirements, market conditions, and account disposition).
    4. I must accept a certain amount of losses; I must identify how much loss can be allowed on any given strategy. I must perform Risk/Reward analysis at the strategy level rather than the individual trade, though the two will most likely closely reflect each other. This analysis will probably require a regular weekly review, and therefore comprehensive tracking will need to be set up.
    5. I WILL communicate publicly (probably via blog) as much of my strategies and results as I can as time and energy allow.
    6. I will not utilize a portable trading platform. Trades and direct research will be conducted from a tethered location. Though a multi-purpose laptop may be used, it will only be used for these activities at a single location. Educational pursuits are excepted (grey areas like blog reading must be monitored). A mobile device may be used to check account status for the purpose of personal budget planning. In short, I leave the trading behind at the desk and offer undivided attention, or at least not divided by the markets, to whatever my present situation may be.
    7. I will rely on statistical advantages multiplied over number of occurrences to achieve success. I will not ride black swans but will take the first exit which offers reasonable profit on each and every trade.
  3. Progression
    1. I will test multiple free or demo tools and select an initial, preferably low overhead, tool for beginning trading on the assumption that success will open the financial doors to more powerful tools in the future
      1. MILESTONE: Initial tool selected by 2013-10-31 - complete (ThinkOrSwim {TOS})
      2. ADDITIONAL: Tool licensed or subscribed by 2013-11-30 - complete, the thing is free (with an unfunded account @ TDAmeritrade)
    2. I will educate and paper trade until 2014-01 to familiarize myself with 1 or 2 possible strategies and allow maximal time to deal with tax complexities
      1. MILESTONE: First money trade position opened by 2014-01-31
        1. Threatened: Account funding took longer than expected and then the brokerage stonewalled on trading spreads. Working on preparing another account elsewhere
    3. Identify mechanically repeatable strategy metrics
      1. MILESTONE: At least one safe mechanical trade strategy by June 2014
    4. Begin cobbling ad hoc automation technologies
      1. MILESTONE: An ugly, bootstrapped system able to generate trade orders by Dec 2014.
      2. ADDITIONAL: A way to get the generated trade orders executed by same deadline
  4. Goals
    1. Daily
      1. Perform at least 2 paper trades a day using any strategy or mix of strategies. This goal is intended to be perpetual. Paper trades will be logged in whatever tracking device in use at the moment (currently a Google spreadsheet)
        1. This has slipped a lot but I feel has been sufficient, especially over December 2013, to proceed
    2. Annually
      1. Year 1 (2014/01/01 - 2014/12/31)
        1. Annual average account growth of 20%. This means that ROR must average to 20% to maintain growth.
          1. This may be way too aggressive based on December returns. However markets vary and this may be feasible in the future. Requires monitoring
    3. Quarterly
      1. Review of account performance against an idealized growth chart tied to the annual goal
        1. This should probably be monthly, as the account balance becomes tied to living expenses this will become part of the family budgeting routine
    4. Weekly
      1. Weekly review of positions and aggressive profit-taking. Positions should turn over quickly to maintain income flow. Highly profitable positions may be held longer to increase average ROR if possible.
        1. This is only marginally necessary. I’ll be putting in closing limit orders at my desired exit point the day after each position opens. Position review is necessary but the aggressive profit taking will be built into the trades.
        2. I deliberately left that stupid sentence in there struck-out as a reminder of my own hubris. Positions will close at defined profit points as determined at the time the position is opened. If I feel a play could have been more profitable I am free to try to re-open the position in any way deemed profitable.