Stocks Trading Lesson 3 – Trading Basics How to Buy and Sell

After you have setup a trading account and transferred funds, it is time to get started. Initially trade with very small amounts about a a few hundred dollars. There are various types of orders and it is very important to understand how and which ones to use.

Market Order
e.g. Buy 100
Buy and sell at market price. Never ever use this type of order. Only in cases of when you have to sell in panic or trading long term and dont care what price you pay. If you are starting then it is ok. You can use market for both buying or selling.

Limit Order
e.g. Buy 100 APPL at 110.5
e.g. Sell 100 JPM at 41.5
When buying it means, I will not pay more than the limit price e.g. 110.5. You will be guaranteed that your order is filled at 110.5 or lesser or it does not get filled. For selling it means that i will not sell for a price lesser than my limit e.g. JPM not less that 41.5. Limit order is what one should always use. Be patient and get at the lest price you can get when buying. You can use or bar 1 minute chart if you are a day trader or a 60 minute chart if you are a few weeks trader or longer trader to decide the price to put limit on. Just make sure its not too low that you never get filled.

Stop Market
e.g. Sell 100 APPL at 105.5
This order means if the price touches 105.5 sell at market value. Stops are very important and act as protection against massive losses. When ever you buy stocks put a protective stop loss, so your damage is always limited to a certain amount.

Stop Limit
e.g. Sell 100 APPL at 105.5 with limit 105.5
This order means if the price touches 105.5 sell but till i get atleast 105.5 . Its a stop with the restriction of a limit. The order might not get filled if the price is falling sharply as your limit might not get filled. So either keep the limit lower that the stop or use a Stop Market.

In summary buy with a limit order and always put a stop loss of a certain percentage or a couple of Average True Ranges.

Stocks Trading Lesson 2 – Choosing a Trading Platform Brokerage Account

Before one can trade it is important to sign up with a trading platform. There are many trading platforms and based on trading style one should choose one appropriately. Remember trading cost can quickly add up and burn through your trading profits, so choose one which gives you the optimal cost. Here are some based on my experience
9.99 per trade i.e. when you buy or sell. Quite costly and is suitable for traders who are long term investors and choose value trading as their strategy. Buying frequency of 1ce or twice a month. Though ameritrade provides free features like Strategy Desk which is an excellent tool if you want to do rule based trading or charting and technical analysis. They also have online java version of charting tools. Also provides mobile cell trading interface.
Platform fees of 100 a month and a few dollars for data feeds. Stock buy or sell for a dollar. If you are serious about trading and planning on making at least a few dozen trades a month this is the best option. Also the emphasis of tradestation is on strategy trading i.e. you can program in a language called easy language using automated trading rules. The platform is superb. Also it provides a simple web based trading site beside the windows platform.
3 dollar a trade. If you are going to be trading passively i.e. on and off based on season and allowed time, this is the best option, because it is much cheaper than ameritrade, and you are not commuted to 100 bucks every month like tradestation. There are a few others like and that also provide cheap trading. With these options you may want to look at other sources for technical analysis/charting tools.

So the trading platform should be chosen based on your style and how much you want to loose per month or per trade and the feature trade offs. first version launched!

My first weekend .com startup initiative has launched. It has taken exactly 2 weekends to hack up this site. See logo



Pricethinker is a very useful machine learning application that can predict prices based on numeric features data. For example if one is out shopping, and looking at many similar products, it is hard to figure out the best value product i.e. which gives most features to the price. This tool helps you do complicated price analysis.

A simple example is house price prediction based on 1 feature, say square feet. Which one of the following is the best value? What should be the price of 2000 sq feet be? Pricethinker is exactly the tool to help you. Imagine how complicated it becomes if you also put bathrooms, garage etc into the equation. Its much easier for PriceThinker to do the number crunching for you.

Sq Ft – Price
2200 – 340000
2100 – 310000
1900 – 260000
2500 – 370000

Pricethinker will tell you that the home with 1900 sq ft is the best value. And a home with 2000 sq ft should cost 288459. The power of machine learning is at your service with simplicity and beautifully!

Stocks Trading Lesson1 – An Anaolgy to Betting With a Coin Toss

This is my first post on stocks trading. It is one of my interests, and have spent a great deal of time reading books, and trying various techniques. I will regularly make posts with tips and techniques and trading strategies, and will compose all my posts into a few articles and publish them on my main website http;// There are many aspects to trading stocks, and I will add posts with standard knowledge and my experience and tips with it which include.

Aspects of trading

  • Trading Fundamentals i.e. how to place an order. Place a stop loss, limit order etc.
  • Fundamental Analysis i.e. how to evaluate a company e.g. earnings ratios
  • Technical Analysis i.e. how to read a stock graph and analyze it
  • Trading psychology i.e. how to maintain your head and not panic
  • Sources of knowledge i.e. magazines, books, seminars
  • Trading strategies and how to tune them to your style
  • Trading platform analyzing fee strutures
  • Rule Base trading and back testing strategies
  • Trading time frame, e.g. investing in 401K vs day trading vs week to month trading
  • Risk Management
  • Trading Plan

Is trading like gambling? Analogy to betting with coin tossing
Some of my friends think that trading stocks is like gambling. And to a great extent my friends are right. One never knows what the future beholds. If you flip a coin it could be heads or tails, you win or loose. So whats the point so many people go for stocks. Are all playing for the thrill of it? Why do they not all go to a casino instead.

Lets play a game to better understand what trading is. Lets say you have 100 dollars and I give you a special coin. Also i make the coin slightly skewed such that on average the heads come up 51% vs 49% tails i.e. i slightly skewed the coin in favor of heads. Also suppose you have a millionaire friend who is willing to bet with you as many times as you like. He does not know that the coin is skewed for the heads. And also you get to call heads or tails and the amount of the bet. Do you think you can play such that you can double your 100 dollars? Or even better become a millionaire i.e. win all your friends money?

The answer is yes. Do you know that casinos build their huge empires of wealth just with that much odds in their favor?

How does one play such a game. An obvious answer is always call heads (this is like trading the best stock e.g. AAPL or GOOG of these days). But there is another aspect to it. What should be the bet size. Should you bet all 100 dollars, so you can immediately double your money in the beginning? Should you bet half of it, so you only loose half worst case if the first bet is lost? How do you increase your changes of success. If you were to bet staight with all you money you are taking a risk of 100 percent. You could go clean on your very first bet, so that doesn’t seem to be good idea. If you were to make a 50 dollar bet, you could loose all your money in 2 bad bets, but it is still better than 100 dollar bet, because you at least have 2 chances. How about bet with a dollar. That makes a lot more sense. Because you know how unlikely it is that you will get 100 tails in a row. If you could, you should bet with the lowest possible risk lets say a penny, and bet a gazillion times with your friend. One day you will have all his money. I.e. bet with a coin which is slightly in your favor, and bet many times with small amounts (e.g. a penny). Out of every 100 win you will win 51 times and loose 49 times i.e. on average on every 100 bets your bank balance will increase by 1 penny and your friends balance will decrease by the same amount. Once you earn upto a 1000, you can increase your betting size from a penny to a dime. Now after a 100 bets your bank balance will increase by 10 cents. And then when you become more richer you can bet with a dollar and so on. The power of compounding will exponentially accelerate your path to richness.

The above game is simply what trading is all about. In real stock trading replace coin flip with stock going up or down. Going up means you got a head. Stock going down means you got a tail. Trading with a small amount means that you have placed a stop loss i.e. a fixed amount that you would loose on a trade, and invested a small percentage of your trading capital. The part that the coin is skewed, is a valid tested trading strategy. And yes you can develop a trading strategy that is “skewed” in your favor!

Putty ssh seession timeouts to qucikly on windows fix

Update the Windows Registry to create or change the TcpMaxDataRetransmissions

The problem of PuTTY or other SSH connections timing out too quickly when network connectivity is briefly lost is Windows problem and not an internal PuTTY problem. You can tweak the Windows Registry settings to try and change or address this issue.

For Windows NT, 2000, XP – the registry key to create or change is:


It must be of type DWORD. See Microsoft Knowledge Base articles 120642 and 314053 for more information. Set the key’s value to something like 10. This will cause Windows to try harder to keep connections alive instead of abandoning them. domain registerd.

Will be moving over my test app from google apps host to here. Cannot live without mysql db. This is my weekend .com startup initiative. This is a AI application which will allow users to compare prices based on quantitative features. The application will be able to predict prices given training data. Also it will identify the best value item from a group. Hopefully plan to release the first fully functional version by end of this year!

Google Web App or Other Low Cost Hosting Service?

I am evaluating if one were to deploy a “weekend” .com project which would be a better choice between google app infrastructure vs regular isp e.g.

Pros of Google Web App
1) Free for certain bandwidth/ disk usage.
2) Integrated dev enviornment with gwt and google apps framework. Integration with eclipse development platform.
3) Scalable/reliable architecture that google uses.
4) Can use gmail based autentication in applications.

1) No normalized database. JDO based custom database. The query interface is webbased.
2) No support for PHP. Many tools are built on php/mysql platform, that i can get access to on regular hosting service.
3) JVM has restrictions e.g. no multithreaded code, beside the servlet threading itself.
4) Very rigid work flow for application development/deployment. Its both good and bad. Lesser choices are sometime good.

Created my first GWT and Google App

Developing web application and deploying it on google apps was a breeze, (no fighting with javascript). Very developer friendly infrastructure. I started going through the google gwt tutorial at 1 pm today. At this time i have already tested an deployed my very first google apple called stock watcher.

GWT allows developer to code the widgets in plain java. Then the code is compiled into javascript for various browsers. GWT is a cool and easy way of developing ajax enabled applications.