Author: navacron

  • 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;//www.navacron.com. 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!

  • How to put adsense code like i have in the post b2evolution

    I placed the Google Adsense code in blogs/skins/evopress/posts.main.php.

  • 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:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parmeters\TcpMaxDataRetransmissions

    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.

  • pricethinker.com 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. http://www.ultrawebhosting.com.

    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.

    Cons
    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.

  • ANTLR Java Based Compiler

    Read through the beginning few chapters of ANTLR. Being able to write a language or parse an existing language is hallmark of a higher order programmer!

  • Programming Collective Intelligence Review

    I have been reading Programming Collective Intelligence on my daily travel to NY. This is a gem of a book. It covers many topics in machine learning, that can be applied to projects. All with practical examples and code in python. i had no idea that current machine learning algorithm were any useful. But this book puts so much of AI jargon in to practical use. A typical AI book will confuse the heck with the maths proofs and statistics. But this book is pure practical with jucy examples one can easily understand and put to use! Many hip words in AI made some sense to me after reading this book. e.g. Genetic Programming, Genetic Algorithm (yes they are different), baysian classifiers, hiearchical clustering, k-means clustering, optimization, anealing, hill climbing, decision trees, support vector machines.

    Some practical algorithms with code and examples covered.
    a) Making Recommendations for movies (e.g. similar to Netflix movie recommendation, or matchmaking ).
    b) Writing a search engine, and search results.
    c) Optimization algorithms. (optimization is finding a good enough solution when the optimal solution is expensive to find).
    d) Document Filtring, e.g. Spam Filter
    e) Discovering Groups in a large set of data / Clustering
    f) Building Price Models e.g. determining the price of a home given a large data with features.
    g) Evloving Intelligence. Genertic Programming.

  • Saw District 9 on Friday

    Very good alien movie. Bit different from regular alien movies because for a change the aliens are not the bad guys. Instead humans treat them like slaves, forcing them to live in a slum.

  • On Intelligence Review

    So I have finally finished reading On Intelligence/ Mostly read it on my commute to NY on bus.

    i think the book could have been written in less than 100 or maybe 50 pages. Filled with the authors personal views about intelligence. Also is full of analogies, pages and pages of analogies. The gist of the book is that knowledge in our brain is stored in hiearchies, and the brain is always making predictions e.g. when you are listening to a song the next note is already predicted by your brain, and the brain does that for everything we do.

    I thought the book revealed nothing new. Tree is a universal data structure (hiearchical), and CS people already know about that, but have not discovered true AI. Nor the prediction is a new thing, programming language compilers are impplicitly doing the same thing, i.e. looking for the next expected token, i.e. if not found throw a compiler error.

    So it was interesting to know that the neo cortex behaves in a certain fashion (at place the author was filling the knowledge gaps of the brain by his own assumptions e.g. this part of the brain may possibly work like this), but the book is not any breakthrough. I.e. you cannot write an intelligent program after reading this book. It will only give you inspiration to dig in deeper.

  • Podometer walkertracker.com

    I recently purchased a podometer from Walmart. A podometer is a device that measures the number of steps walked. On average i walk about 4000 steps i.e. when i am not making an effort. For example a walk from port authjority to my office on 7th, 42nd street avenue is about 500 steps. I started keeping track of my steps on this free website http://www.walkertracker.com. The site keeps track of your average, totals, had nice charting abilities. Too loose weight one needs to average 10000 steps. The tops i have done walking is about 8000 steps!

  • Jason Mraz

    I like this song. Discovered it yesterday.

  • Alice Story Telling

    A few years ago i came accross this wonderful cartoon/animation building software called Alice. This is a very innovative software to learn concepts of object programming. I wanted to teach my daughter Sabah, but she was only 4 at that time. Now she is 6 and is able to read. So installed the Alice Story telling application. She was amazingly quick to go through the 3 built in tutorials. I am working with her to learn it more and be able to make simple stories in it. This software was developed by the late CMU professor Randy Paush. See this inspirational video called “The Last Lecture”.

  • Dil Dil Pakistan. Happy Independence Day Pakistan

    Nostalgic Pakistani patriotic song by Vital Signs. This used to be played on PTV (Pakistan Television) the only Pakistani TV channel at that time, when i was in class 6. Vitial signs and Junoon were the only pop/rock groups at that time, and it was refreshing to see this song played on TV among many classical (read old fashioned) songs played on TV.

    14 August was day when Pakistan got independence from Britain.

    Wikipedia Pakistan
    http://en.wikipedia.org/wiki/Pakistan

    Jinnah Movie
    Jinnah Movie

  • Picture of My Great Grandfather

    His name was Abdul Hakim, father of Mohammad Sharif, father of Tufail Ahmad, father of Naveed Ahmad (me). Picture has a date on of 1906. He sort of looks like me.greatgrandfather