Wednesday, February 24, 2010

Forex Experment: Day 1

Well, I finally did get the robots installed and running last night.  However, in order to do so, I had to completely remove the anti-virus software from my system.  As a computer professional, I would  never advise anyone to do that, and I am extremely uncomfortable with it.

I did finally get responses back from FRWC's support staff, though I was less than thrilled with the response time.  The response to both of my problems was "Disable your anti-virus software."  Which I had already figured out, but it's nice to have confirmation that that is the problem.

However, since this is my main workhorse machine, on which I do a lot of my work, store all my financial records, correspondence, pictures, etc., I am extremely uncomfortable leaving it running with no virus protection.  I have told their support department that, and we'll see what they say.

Meanwhile, I wait for results.  The robot has only been running since 10:00 last night, but overnight it hasn't done any thing yet.  I'll watch it for a while and see.  And meantime, try not to do anything else on that computer that would expose it to threats from the internet.

Stay tuned...

Tuesday, February 23, 2010

Forex Robots: So far..., Well, we'll see

I promised a running commentary on the results of my experiment with Forex Robot World Cup winners. (See Forex Robot World Cup for details.)

I delayed my purchase for a day because I wanted a new trading account open and funded so that I could track my results more easily, and it took through the weekend to get that set up. But I did purchase the package Monday evening. However, things have not gone smoothly. The web page promises that you'll be up and running in 5 minutes. Well, I suppose that might be possible if you know exactly what buttons to click, and have complete faith. As I have said before, I'm a geek, and I want to read and understand exactly what I'm doing or being asked to do, which sometimes makes it harder than it needs to be. It took me all evening, and it's still not running.

When you download the packages, the web site warns you that "Oh, yeah, your anti-virus software might complain about this, but it's really okay. Trust us." Well, I am not quite that trusting, and my anti-virus did complain about it. In fact, I had to turn it off to even download it. So I spent quite a bit of time researching the virus message on the web before, hesitantly, deciding, yeah, it probably is safe and going ahead with the installation. (The jury is still out on whether it really is safe or not. Performance of my system in the days ahead will see.)

But then, the main robot package, the Fusion V that they tout so highly (the one that returned 354% in 19 days), refused to install at all. Windows just said it couldn't access it. I have a support ticket in with them. We'll see how quickly they respond.

I did install and turn on two of the other packages (the first and second place finishers in their competition), but neither of them would run. They both started and just sat there saying "Trying to authenticate...", even though I had entered the correct receipt code. So I have another support ticket in on that problem.

I'm still hopeful, but... We'll see how it goes. Again, stay tuned.

Saturday, February 20, 2010

Forex Robots: Scam or Opportunity?

I have been intrigued with Forex (short for Foreign Exchange, or foreign currency trading) for sometime. I've heard many times from many different sources that a good forex trader can average one-half percent on his invested capital per day. That doesn't sound like much until you realize it works out to about 250% per year.

Whenever I've run into anyone who trades forex, I've asked them about that figure, and each one has confirmed it. But none of them are living like they have the kind of money that return would generate. (Starting with $1,000, that return achieved consistently would yield over half a million dollars in 5 years).

But I wanted to see if I could learn to do it, so I started a few months ago "playing" with demo accounts from several brokers, trying to be disciplined and to learn the process. And I've had varying degrees of success.

As I began reading and studying forex trading, I ran into ads for numerous "Forex Robots". These are automated computer programs that monitor the market and apply their own trading strategy, then automatically place trades when they determine the conditions are right. The nice thing about them is that you can start them up, leave your computer running, go to work or go to sleep and they just make money for you. At least that's what the marketers would have you believe. And they all make outlandish promises. One promised to more than double your money in a month. Another promised not to make any losing trades (it was called the "No Loss Robot"). The promises are outlandish because, again, if you apply the math and the magic of compound returns, you would be a millionaire virtually overnight.

Nevertheless, they were intriguing, the price was relatively low, and they mostly come with a 60-day money back guarantee. I bought one, installed it, and it did nothing, and I emailed and did, in deed, get my money back. I bought another one, and, while it has not lived up to anywhere close to its hype, it has a pretty impressive record - no losing trades in January, and about a 6 1/2 % gain. (Again, if that were achieved consistently, it would double your money in a year. Unfortunately, it had it's first losing trade the other day, and wiped out a big chunk of that gain.)

Several months ago, I started getting spam about the "Forex Robot World Cup" - a supposedly completely open, transparent, real-world competition of forex robots. It initially seemed to be a serious competition among independent robot developers.

The competition had 329 entries of robot programs developed by independent developers. These first had to go through a rigorous qualification round of "back-testing" (running the trading algorithm against historical market data to determine the trades and results that it "would have" made). Only 24 of the 329 made it through that. Then the 24 were each set up with a $1,000 live money trading account, and left to run for 2 months.

Now it starts to get interesting, because these are the circumstances in which you would actually be using these programs. It also became interesting because the promoters started sending out teaser messages about the progress of the competition, and, as it neared the end, indicated that they were going to be making the winners available for sale. The leading program returned 145% over the 2 months.

But then, in the last few weeks, they cranked it up a notch. They (the promoters) claim to have taken the strategies and algorithms embodied in the top five performers, and created a "super-robot" that combines them all. They started this program trading along side the others with 19 days left in the competition, and, in that 19 days, it returned 354%. And they're offering it for sale. (See Forex Robot World Cup for details.)

Now, for the less mathematically adept, achieving that kind of return is absolutely ludicrous. If it were true and consistent, you would be a millionaire in less than 5 months, starting with $1,000.

Nevertheless, it's like a tar baby I just can't get out of my head. What if it were true? Or even remotely close to true? I mean what are the possibilities? Either the claims made by the promoters have at least some basis in fact, or this whole campaign is one massive lie. If the latter were the case, then it's an extremely well-orchestrated lie. This competition had the sponsorship of one of the biggest brokers in the Forex world who has built a massive business - it's unlikely that they would lend their name and support to something that was a complete fabrication. It also has truly been fairly transparent, which was one of their stated goals. They are even offering the passwords to the trading accounts so that you can log in and verify the results for yourself. There is the possibility that the accounts have been manipulated, but if that were true, that would probably make some very prominent people in jeopardy of criminal fraud charges.

So let's say, just for the sake of argument, that the robot really works, but it just got lucky, and it performs, but not quite as well as claimed. Let's say it does half as good. That's still 170% return in less than a month. Hmm. How about a quarter as good? That's still nearly doubling your money in a month. How about a tenth as good? 35% return in a month?

There's only one way to find out. And that's what this blog is about. I've decided to give it a try, and report my results here, day by day. They are selling a package for $999 - a hefty pricetag, but if it does even a 35% return, easily worth it. And, they're offering a 60-day no questions asked money back guarantee. It's obvious that I'll know in a matter of days whether there's any validity to it or not, so I'm really not putting much at actual risk.

So, I'm going to purchase it tomorrow night (Sunday - at the start of the trading week), and report the results day by day. We'll just see.

Stay tuned.



Wednesday, November 25, 2009

Booting from a cloned VHD in Win7

This is my attempt to make a serious "how to" contribution to the Windows 7 software development community, and, hopefully, make something that I learned the hard way simpler for someone else.

I have my Windows system on my work computer set up the way I want it, with all the utilities and programs that I use installed.  But I wanted to run the new Beta of Visual Studio 2010. However, there's a standing (and understandable) rule: no beta software on computers that you're doing production work on.  But my boss did give me permission to use it on the project I'm working on (since it won't be production ready until after the scheduled release of VS2010 in March) PROVIDED that I run it in a segregated environment such as a Virtual PC) so that it can't corrupt anything else.

I had run the beta of Windows 7 in a Virtual PC when it came out, but it was painfully slow. Windows 7 has the capability to boot up from a Virtual Hard Disk (VHD) as though it were actually a hard disk and run with minimal speed degradation (the disk access is somewhat slower, but everything else is running just as fast, because you are actually running on the hardware, not a program simulating the hardware). So I decided I would clone my existing system drive, which is configured the way I want it, and boot from that.  Should be simple, right?  WRONG!  There are a number of hidden gotchas along the way, which this post is intended to walk you through.

However, a couple caveats before you start down this road with me:  I run my systems a little different than it comes out of the box.  I have my disk partitioned in 2, similar to the way I learned to do it under Unix:  I have a system drive (C:), but all my user data is on a separate partition.  I assign the drive letter U: (for Users) to this partition.  There's a number of reasons I do this, but for the purposes of this discussion, it means my working data is available to me whether I'm booted into the real system drive or to the VHD drive.  If you have your drive setup the way Windows does it out of the box, with everything on C:, and your user data in C:\Users\<username>, then it's going to be clumsy, at best,  to access the files you write in one instance from the other instance.

The other caveat is that you need enough free space on your disk to hold the VHD in a fully expanded form.  In practice, this probably means that if your disk is more than half full, this isn't going to work for you.

Okay, that being said, here's the steps I took (on about the 5th iteration of this process). (Also, be warned that a couple of these steps can take quite a bit of time - altogether, this process could take half a workday.) (Also, if you run as a non-privileged user, most of these steps need to be run as administrator.)

1. Clean your system disk. Get rid of all the junk on it, because you're going to be cloning the disk and you want it as clean as  possible.  I use a freeware program called "CCleaner" (http://www.ccleaner.com/) which empties the Recycle bin, clears your browser cache, gets rid of temporary files, etc.  When you finish, look at the properties of the drive to determine how much space is actually being used and how much is free.  This will be important later when we resize the cloned disk.
2. Defragment your disk.  Even though Windows runs defrag periodically, and will probably tell you the disk doesn't need defragging, run it anyway, and specify the /X (consolidate free space) option.  I open an Administrative cmd prompt window (type "cmd" into the Start menu search box, then right click the "cmd.exe" option that shows up, and select Run As Administrator), and type "defrag C: /U /V /X".  The idea is that we want to end up with all, or as much as possible, of the free space at the end of the drive.  (This process will take a fair amount of time - maybe 10-20 minutes if I remember right, depending on drive size and how fragmented it is.)
3. Download and run Disk2Vhd.exe (http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx) from the SysInternals group at Microsoft.  In the list of disk partitions it gives you, select just your system partion (C:).  This will clone your system drive into a virtual hard disk file.  It's okay to put it on the same drive you're cloning.  This process will also take quite a while.
4. Once that is done, use Windows' Disk Manager to Attach the VHD as another hard drive.  Right click My Computer, and select Manage.  Then click Disk Management. When the storage manager comes up , Right click Disk Management, and select "Attach VHD".  Find the VHD file you created in the previous step, and attach it.   It will show it as an additional hard disk, but it will tell you it's offline, and help will say it has a serial number conflict with an existing drive.  Well, since we cloned it from the C: drive, it has the same serial number, so that makes sense. The good news is that it's easy to fix. If you right click the newly added Disk symbol (probably Disk 1), and select "Online", it will cure the problem and put the VHD online.
5.  If your drive had multiple partitions, you will see that the mounted VHD has space corresponding to the space those partitions took up. The space will be shown as "RAW" partions.  We need to delete those. Right click each of them (except the one corresponding to your cloned system partition), and select "Delete Volume".  The space will now be shown as "Unallocated", and adjacent Unallocated partitions, if they exist, will be merged.
6. Now right click the partition corresponding to your cloned system drive, and select "Shrink Volume". It will spend a couple minutes analyzing the partition to see how much it can shrink it,  then will give you a dialog box showing you how much space is now being taken up (the full size of your original partition), and how much is available to shrink.  There will be a textbox/spinner to let you select how much you actually want to shrink it, and then shows the resulting final size after the designated shrink is applied.
There's a trade off here.   The size you shrink it to becomes, in effect, the "physical size" of the new VHD, and you want to give yourself some room for expansion.  On the other hand, when you're booted to the VHD, the system will expand it on disk to the full "physical size" specified, and you have to have room on the disk for that expansion, or the boot will fail. So, for example, if I have a 100G C: drive, with 30G used, and I clone it, the clone file may actually only take up, say, 25G.  But if the "physical size" that I've specified for the VHD is 50G, when I boot from it, the OS will expand that 25G to the full 50G, which still leaves 100-(50+30) = 20G free.  But if I now copy 25G of video onto that physical disk, then the new free space is 20G (100G - (30G+20G+25G)), but when I boot into the VHD,  the OS will try to expand it and run out of room, and the boot will fail.  So, make the size big enough to accommodate reasonable expansion, but balance that against the free space on the disk.
7. Once you've finished the shrink operation, right click the Disk in Disk Management, and select "Detach VHD".
8. We've shrunk the operating system's conception of the file, but the VHD still thinks it is the size of the original physical disk. Download VHD_Resizer (http://vmtoolkit.com/files/folders/converters/entry87.aspx).  (You will need to create an account, but it's free and appears to be innocuous.)  In our example above, the VHD still thinks it's of a 100G drive, even though it may only have 50G of content on it. Run the resizer, select the VHD file that you've created, and specify a Save location for the new, re-sized VHD that it's going to create.  You will end up, temporarily, with two copies of a pretty big file.  If you don't have space available on another partition, you may need to temporarily attach an external drive.  Specify the size that you shrunk the VHD to in the previous step as the size of the target file.  The program is going to do a sector by sector copy of the source VHD to the target VHD, so this operation will also take a while.  When you're done, you can delete the source VHD, and move the target VHD to it's final location. 9.   We probably need to rewrite the boot sector, using a program from the boot subdirectory of the Windows install DVD called bootsect.exe.  Attach the VHD using Disk Manager as before, then use the command "bootsect.exe /NT60 F: /FORCE /MBR" (substitute whatever drive letter the VHD gets attached as for the "F:"). Detach the VHD when you're done.
10. Now we need to modify the System Boot Configuration Data to add the VHD as a boot configuration.  Scott Hanselman has an excellent blog post on this, and I'll refer you there (http://www.hanselman.com/blog/LessVirtualMoreMachineWindows7AndTheMagicOfBootToVHD.aspx) for instructions.
11. Once you have done that, you should be able to restart your system, and have the new VHD entry presented in the boot menu options.  Go ahead and boot to it, then open a cmd shell and type "echo %SystemDrive%".  The response is the drive letter that was assigned to the VHD.  Don't modify anything.  Restart the system and boot back to the native drive.
12. Final step. We need to modify the registry on the VHD so that it will cause the VHD to come up as the C: drive, and move the C: drive someplace else. We need to do this because the Registry on the VHD disk is a clone of the Registry that was on the native drive, and contains lots of paths that are hard-coded to the C: drive.  If you don't modify where your VHD  mounts, a lot of things that you think are pointed to VHD will actually point to the C: drive, and you won't have an isolated environment at all. Here's what we need to do.
  • Mount the VHD in Disk Manager again.
  • Open regedit.
  • Click HKEY_LOCAL_MACHINE
  • Click File -> Load Hive
  • In the browser window, navigate to F: (or whatever drive your VHD is mounted to)\Winows\System32\Config\SYSTEM, and click Open
  • When it asks for a key name, make something up (I used "TempReg")
  • Now Click the TempReg key that you just created, and under that click "MountedDevices"
  • Right-click the key "DosDevices\C:", select Rename from the context menu, and change the C: to some unused drive letter on your system (I used Z:).  This is where your native drive will now show up when you boot from the VHD.
  • Right-click the key "DosDevices\<x>:", where <X> is whatever drive letter you found in the %SystemDrive% environment variable above.  Relect Rename, and rename it to "DosDevices\C:".   Now your VHD will boot as the C: Drive.
  • Click the TempReg key, and then click File -> Unload Hive.
  • Close the Registry Editor
  • Detach the VHD in disk manager
And (if I haven't forgotten any steps and everything has worked right), you're done.  Just to double check, while you're still booted into the native drive, create a text file someplace on that drive (make sure you know where it is).  Now when you boot to the VHD, that file should NOT be in that place on the C: drive, because it's a different C:.  But you should be able to find it on the drive you relocated C: drive (Z: in my example).

Acknowledgements

I want to thank Scott Hanselman from Microsoft (@shanselman) for his attention and assistance during this process, and Garry Martin (@garrymartin) for helping me understand the VHD expansion on boot process, and the boot sector rewrite process.  I would not have succeeded without their help.

Please feel free to leave comments or email me if this doesn't work for you.



Saturday, August 22, 2009

Building a new computer

I'm about to start building myself a new computer.  And I thought I'd document the project for myself and anyone interested.

When I tell people that I'm going to build a computer, they react something along the lines of "Wow, where did you learn how to build a computer?"

It's really not that hard these days.  If you've got the mechanical aptitude and patience to screw a few (sometimes tiny) screws in, you can probaby handle it.  It's just a screwdriver project.

But first, why?

Especially since I have 3 computers now.

I have a server computer that just sits in the corner and (mostly) stores the files that I want to keep around for long term storage.  Then I have a laptop that I got a little over a year ago (when I thought I was going to be doing quite a bit of traveling for a contracting job that didn't materialize).  And finally, a desktop computer that I actually do most of my work on.

Now, the desktop is over 4 years old, which isn't that bad in and of itself. I've extended it with more memory and bigger disks, so it does pretty much what I need. That is, when it's working. And therein lies the rub.  Recently (like the last 6 months or so), it's been getting cantankerous, and refusing to come back up when it's been powered down for a long period of time (usually several hours or more).  Most of the time, it does eventually come back up, if I just leave it alone (powered on), and wait.  Usually 12-24 hours.

But when I got back from my vacation to Costa Rica a few weeks ago,  it took me almost a week to get it up and running reliably again.  It would come up for a while, and then crash and not boot for a day or two.  And that's just too unreliable for me to use. So I decided it needed to be replaced.

The second question, then, is why am I building a new computer instead of just buying one?

In general, the argument that you can save money by building it yourself is spurious.  If you go to a computer store and buy all the equivalent parts that you need to build a computer with the same capabilities as one on the store shelf, you are going to spend very, very close to the same amount of money, perhaps a little more, than if you had just bought one off the shelf.  And you're going to have to put in the time and effort to build it yourself, plus lose out on the vendor support aspect.

But, in this case, I'll be able to re-use several of the components from my existing computer, and also tailor the system to have exactly the capabilities I want.

To build a computer, you basically need to assemble the following components:
Case
Power Supply (may come with the case)
Mother board
Processor (CPU)
Memory
Video card (may be built into motherboard)
Disk drive(s)
CD/DVD/Blu-Ray (your choice) reader/burner
Keyboard
Mouse
Speakers
Display
Software (Operating System)

Now, in this case, I think (remains to be seen) that I can use the case from the old computer, I already have an almost new power supply that will work, I will use the disk drives and DVD burner form the old computer, and, of course, I have the keyboard, mouse, speakers, and display. And I have access to the Operating System (Windows 7) because of my work as a Microsoft developer.

I'm using the lowest end of the very latest series of processors from Intel (a core i7-920), which means that, if I want more performance in the future, I'll be able to swap out the processor for one with as much as 50% more throughput (they're just kinda pricey right now, and I don't really need that much power right now.)

The choice of that processor constrained the choices of mother boards that I could make that would be compatible with it.  And all of them used a newer generation of memory (DDR3) than what was in my old computer, so I'll have to buy new memory. The good news is the price of memory has come down and the capacity has gone up.  Where I might have spent $100 for a Gigabyte of RAM when I last bought a computer, I can now get 6 Gigabytes for $100.  And the processor uses a new memory architecture called Tri-Channel that (apparently) serves up 3 times the memory information at once.  Memory speed is ultimately the biggest performance-limiting bottle-neck in a system, so this system should be blazing.

So, I needed to buy a mother board (ebay for $167 including shipping), processor (ebay for  $247 including shipping), a video card (Fry's $45 including tax after rebate), and memory ($100 after rebate, give or take. I'm on my way to get that in a little while.)  So for less than $500, I've got the machine I want, with the latest generation and a clear upgrade path, and, to have bought a similar machine would have cost in the vicinity of $1000.

All the components except the memory are now in my living room, so I'll document my progress as I go.  Stay tuned.

Why do I Blog?

I was listening to a podcast the other day (side note: I've just discovered podcasts since I got my new iPhone, and they're great for making use of drive time and workout time) with Microsoft guru Scott Hanselman and developer Joel Spolsky. Joel made a couple comments about blogging. One was that 90+% of bloggers start out their blog with big, grandiose mission statement type blog, and that's there first and last blog. They never post again. (I'm almost that bad, but I have been posting irregularly for several months now.)

But the more insightful comment was that most people blog in almost complete oblivion for a year or more, with virtually no followers (that's me!), and then, at some point, they make a blog post that get's picked up and becomes the post that they are known for (still waiting for that to happen.  Of course, it's more likely to happen if I actually post some stuff).

But he also noted that a lot of times bloggers will put stuff in their blog JUST SO THEY CAN FIND IT! Because blogs ARE crawled by Google, and, when you note something in your blog, you'll be able to find it by googling for it.

This blog is a really somewhat schizophrenic, in that I have two widely divergent interests that I tend to blog about - technology, and my spiritual journey.  These have drastically different intended audiences, and half the time I'm not sure who my intended audience is. I initially thought about making two separate blogs, but coming up with a name for one of them was hard enough.  And I looked to other Christian bloggers (notably Greg Beamer, a fairly well-known developer who writes the "Stop Making Sense" blog and signs off his entries  "Grace and Peace"), and noted that they had mixed content, so I thought I'd try it.



Monday, July 13, 2009

This I believe, pt. 3 - Jesus Christ died and rose again

Sorry it's been so long since my part 2 post.  I really meant to do these in more rapid succession.

When I say that I believe Jesus Christ died and rose again, I think that belief is supported aside from any reliance on the Bible.  I think there is more than adequate historical evidence that a man who went by the name Jesus (although I think in his native Hebrew or Aramaic, it was probably something closer to "Yoshua") lived in Israel in the opening decades of the common era, and that he was executed as a criminal by crucifixion by the ruling Roman government.  I really doubt that there are many people who would seriously dispute that.

He had a small group of close followers that we today refer to as the disciples or apostles. And several members of this group proclaimed that he rose from the dead after the crucifixion, and spent many days walking, talking, even eating with them.  Now, I expect that there are many who would dispute that.

But there is one historical fact that convinces me that it is true.  Virtually everyone of those original apostles died a martyr's death before the end of the first century, solely because of their proclamation of that fact.

So, you might say, many people through history have died for what they believed in.  That doesn't prove anything.

Yes.  People die for what they believe in.  But they DON'T die for something they know to be a hoax or a lie.  These apostles had every reason to KNOW with certainty that what they were saying about Jesus having come back to life was true.  They claimed that they had seen him, that he had talked with them and taught them, that they had touched him, that he had asked for something to eat and consumed it in their presence, that he had cooked breakfast for them over an open campfire.

Either those things were true, or else they knew that they had all conspired together to make it up for some unknown reason.  And everyone of them clung to the proclamation of its truth, even to their own death.

No one dies for something they know to be a lie.

So I conclude that Jesus did, indeed, rise from the dead.

And if he did that, then I conclude that validates every claim that he made to being the Son of God.  And it gives untold authority to everything else he said and did through his life. And it means that there are a whole lot of things I can conclude and safely rely on based solely on the things that Jesus taught.

One is the nature of the God that, in part 2, I concluded exists.  Jesus proclaimed several things about God that were revolutionary in his time.  One was addressing him as "Father", in a close, personal relationship.  This was revolutionary in the Jewish thinking. God was holy, majestic, glorious, awesome, and basically unapproachable except through the priests. But Jesus addressed him as "Daddy" (the modern equivalent of the Aramaic word he used). And he said, "You want to know what God's like?  Look at me.  He who has seen me has seen the father."

So I conclude that not only is God a being of unimaginable power and intelligence, as we can see through nature, but that he is personal, with a relationship with his Son.

And according to what Jesus taught, God cares about each one of us just as much.  And I believe his resurrection validates his teaching.