Sunday, June 17, 2007

Back Testing software

Observations:
1) since this c-tool kit is C++ ( trading system ) , we are most likely to do our trading system in C++ rather java .
2) once we have trading system in C++ , it does not make sense to have GUI screens in java (java, c++ 2 systems compile etc.. headache ) , besides we have nice Charts and forms ( free code in C++/.NET )

- COMPANION CD: UNIX/LINUX/WINDOWS XP VERSION: This CD is an updated (2004) version of the original Companion CD (released in 2000). It contains all the basic software, data, etc. as the original Companion CD. The difference between the two versions is that the update was developed specifically to be compatible with UNIX, LINUX, and Windows XP. For example, if you try to compile the old version with GNU C++, or another modern C++ compiler, you will get lots of errors regarding typecasting and a few regarding the use of functions that are not strictly supported by C++ (such as strlwr). In the updated UNIX/XP version, a vast number of typecasts have been added so that the stricter checking done by modern compilers will be satisfied and calls to functions that some C++ compilers do not support have been removed.

- COMPANION CD: UNIX/XP ORDERING INFORMATION. The CD is the same one as the "C-Trader Toolkit" (see that listing for further information). The cost is $79. We send it via snail mail so s&h is $3.50 in U.S., $7.50 outside U.S.



- Iteractive Brokers System Automation Package
If you use Interactive Brokers to execute your trades, and you want to automate your trading system so that it works with the Interactive Brokers TWS API, or if you need some help working with this API, this is the package for you. It includes C++ software that demonstrates how Interactive Brokers clients can write and test trading systems, as well as interface them to the TWS API. The software has been used to write programs that access live data from the Interactive Brokers TWS, as well as to monitor positions and place orders. The software is much faster than TradeStation, and can handle limit orders, as well as market orders, correctly responding to fill information. This software provides a framework for you to write trading rules for automatic and/or semi-automatic trading. The package also includes two hours of consulting (via phone and/or net) by the developer, Jeffrey Owen Katz, Ph.D (asr: so IB pkg must be good broker since Katz wrote and supporting itm, same guy who wrote c-toll KIT above). The consulting can be used to help you get up-and-running and/or for help with backtesting trading ideas using the simulator, which quite accurately mimics the real-time version; we find this invaluable in our own system development efforts. The consulting time can also be applied toward adaptation of the software to your specific trading and development needs.

IB PACKAGE ORDERING INFORMATION. This highly useful package is now being offered for only $249. There are no shipping costs since we send the software by email in a zip format file.



Interactive Brokers TWS API
- Application Program Interface Software: Program traders may build their own add-on applications in Excel, C++, Java, and Visual Basic with our proprietary Application Program Interface (API), which requires TWS to be running in the background.
- Link to TWS using the TwsSocketClient dll
- click on left menu application programming interface ( API)->C++

- Connecting to Interactive Brokers TWS Using C# .Net -- download source code from this page

Interactive Brokers TWS API Wiki
- see here you have C++ and java Clients
- C language API for TWS http://sourceforge.net/projects/tws-c-api (need to checkout via CVS)
- C++ language API for TWS http://www.trading-shim.org/ with SQL database integration
- Interactive Broker's Discussion Board: http://www.interactivebrokers.com/cgi-bin/discus/discus.pl?pg=topics

Back Testing system with Vantage Point

we have 2 parts in this Back testing sytesm
a) UI to display all comparisioins - should we use Jfreechart or .NET (zwdgraph)
b) the back testing calculation -- this has to be in java as I am comfortable , it has algoritham/calculations and writes to mysql


VP BackTEST UI
-------------
- with this windows we may able to get good looking UI and easy options right mouse click etc. than java
- do backtest program and write results to mysql in java, then charting in .Net zedGraph
- all the money management and drawdown needs to be nice drillable graphs so .Net may be nice with out Java pale looking graph ..
- source code of this graphs looks simple and clean
- since we do not depend much on daily watching graphs since we go by mechanical trading signals we do not need jfreechart finalcial chart capability

VP BackTEST UI modules
-----------------------
0. have raw Vantage7 data in one mysql DATASET DB, the backtesting results will be in BACKTEST Db to make it modular ..
1. money management shown for back testing period 1 , 2, 3, 5 years for each stock
2. strategry module shows how each one RSI/Stoch back testing results with different parms ..
3. grahs of regular data ( triple EMA, black/blue line cross etc..)
4. intergrate with code ( can get from web) for calcuateing stock/MACD trigger lines, this we have to calculate vantage point provides Pridicted MACD and PStoch ..

Menu Navigation HTML JS good UI , CSS

----
wow what a great feedback FORM on the 'right bottom cornor' of this site , it was http://www.kampyle.com
http://www.oldschoolvalue.com/about/

----
Making page to expand for wide screens. this keeps lots of content on a single page as nowadays lots of people are using big screens. If screen is small it wraps the content. good html model to take for our (asr) trading blog.
http://www.zerohedge.com/article/four-scenarios-2010
- lots of blogs (Mr. K etc) do take small screen format coz they do not have content to fill wide screen format.

-http://www.tradingtheodds.com/ - another wide screen format .

---------
blog archieve smart way to keep all : you can do expand all and do a search on page to search a word in title.
http://tradingsuccess.com/blog/the-pivot-point-formula-1242.html
- good compact way of showing things , seems used dtree same one as 'fusion charts doc' but small fonts.
- keep this Tree menu in a left frame and display the results on 'right frame' in a 3 pane frame set example , so less flicker
- we can use this kind of menu for OIL notes on the web ( to discuss with other traders) , categorized by events like ' panic News ( dubai world 11/27 ), EIA report etc..
----------
this site shows no flickering when clicked on left hand side menu items. This style suits well for 'on line tutorial/manuals' in a company
http://www.w3schools.com/css/css_align.asp

---
this has great dropdown category list based on DIV , good one it seems this is the best since it has categories.
- it states some of the founders are from google ..., seems quality site , Mr. K ref..
http://ycharts.com/companies/search?q=AAPL%20vs%20MSFT&c=gross_profit_margin


----------
http://forums.stockfetcher.com/ui2/index.php site has good tabbed dividers to hold lots of data

-----
great filter : no page refresh , just mouse over and select 'doc type' , 'language'
- and selected 'engigh' , 'pdf' etc are attached to filter UI box so user is clear.
- this filtering gives only one selection in each category which is the case most of the time. if you see DICE.com 'area code' filter there you can select many like 408 , 510 etc..
- seems here in this docstoc above filter they are doing AJAX to get results of filter that is why no flicker of screen

http://www.docstoc.com/documents/business

asr: Have this kind of Menu to filter our posts on trading OIL etc ... like '4 day reversal ' etc..

---------------------
This is div show/hide based technique , easy to add more menus(than flash solution)and no big JS mess , simple one JS function . Here goes code
( copy of code saved in google DOCS under same title: Menu Navigation HTML JS )

 -- asr: keep all code in pre box
frame.htm code
----------------------


nav.htm code
---------------------------










td tr table //asr make it <> , i removed so that i can save in this blogger
BODY
-->



DROP DOWN JS MENU
http://www.codeproject.com/script/HVMenu/menu10_com.js -- at this url see right hand side 'mesage board' menu it is NICE , it all controlled these 2 .js fils and the inline js call function OpenMenuItem(subCat,section)
http://www.codeproject.com/script/HVMenu/cpmenu_var.js
http://www.codeproject.com/script/HVMenu/menu10_com.js

Friday, June 15, 2007

Technical Indicators

Technical Indicators and Overlays
Moving Averages

Moving Average Convergence/Divergence (MACD)


Stochastic Oscillator (Fast, Slow, and Full)
Relative Strength Index (RSI)

Charting software

FusionCharts - India based flash chart company
FusionCharts Free is a flash charting component that can be used to render data-driven & animated charts for your web applications and presentations.

It is a cross-browser and cross-platform solution that can be used with ASP.NET, ASP, PHP, JSP, ColdFusion, Ruby on Rails, simple HTML pages or even PowerPoint Presentations to deliver interactive and powerful flash charts. You do NOT need to know anything about Flash to use FusionCharts. All you need to know is the language you're programming in.

free version documentation -- great documentation, this whole doc is for free version
free good candle stick charts -- Adobe Flash Player 6 is fine
good JS interactive chart -- built with Free version came to this url from here http://www.fusioncharts.com/free/LiveDemos.asp

paid version chats -- for v3 it needs flash payer 8
Licensing:
pricing -- on this link clik on "License comparison" button to see detailed descrition
- FusionCharts Trial is a no-restriction evaluation of the actual component i.e., there are no days and feature limitations in this trial. The only difference is that in the trial version charts, "FusionCharts" and "InfoSoft Global" imprints would be present on the charts. Once you purchase a license, these imprints would be automatically removed.
- You can use the Evaluation version only for testing purposes. It cannot be deployed to any production website.
Why are we giving it out for free?
FusionCharts Free vs. FusionCharts v3


.NET Charting

1.ZedGraph - free open source c#
2.dotnetcharting - pay $400 c#
3. flash based ( indian company )

1. ZedGraph
ZedGraph Developer Guide
- on top of the page it has links for C# sample project download
API
ZedGraph -- comapre this with Jfree chart
- Development Status : 5 - Production/Stable
- Download History Statistics
- 500 downloads/day so it must be very popular , see forum later . look at this stats dropdown they have sample 'Forms' and other sample apps.


2. Netcharting
.Netcharting over view
very good charting on Web.. this competes with other flash based charts indian company for our 'Amazon customer Feedback system' CFS ( to Manufactures )
Review
review2
.
load from xml , night time data can be read from DB, generated chart can be saved as XML and when user requests load from xml instantly ( or cache xml in memory ) to instanly serve customer
what a great way to learn how many ways you can present data to users/management

Wow what a great representation of data
DifferenceSeries
VersionHistoryGantt

VersionHistory


PieSumRing

LegendBoxElement2
GDPBubblePie

Good part , simile 30 lines code for all this auto graphs grouping WoW

Trading Plan

Here are the top six reasons why traders fail:

1. Lack of a Trading Plan
2. Lack of Discipline to Follow the Plan
3. Failure to Control Emotions
4. Failure to Accept and Limit Losses
5. Lack of Commitment or stop trading using your system after the first loss
6. Over-Trading

Trading a system helps you overcome the top six mistakes

I was reading a transcript of an interview performed yesterday between FXSTREET and Markus Heitkoetter, President of Rockwell Trading. The subject was "Trading Systems: Do They Really Work?"

Markus' most important comments follow:

* - Like all other ventures, "having a plan" will give you an edge
* - A trading system consists of a set of rules; in it's simpliest form a trading plan (or system) has entry and exit rules. More sophisticated trading plans include position sizing and money management
* - You MUST have a trading plan to succeed
* - At a minimum your trading plan should consist of entry and exit rules
* - The 2 types of exit rules are stops (to protect your capital) and profit targets to realize profits
* - The "lack of the trading plan" is the No. 1 reason why traders fail
* - The easiest way to follow a trading plan is to automate it
* - Trading with a system removes emotions from trading
* - If you're looking for trading action, don't choose a trend-following system.


10 Principles of Successful Trading Systems” to help you finding a trading system that works

http://transcripts.fxstreet.com/2006/03/trading_systems.html#more

http://lloydsinvestment.blogspot.com/2005/02/comment-on-trading-systems.html




EclipseTrader

Stock exchange analysis system, featuring shares pricing watch, intraday and history charts with technical analysis indicators, level II/market depth view, news watching, automated trading systems, integrated trading. Based on Eclipse RCP framework.
- check source code/forum how far this automated trading systems are good ... can we use instaed of start from scratch

.NET projects

.NET vs. Java
1. .NET code/article source - www.codeproject.com
- The Code Project is a community of Visual Studio .NET developers joined together with a common goal: To learn, to teach, to have fun programming. Developers from all over the world come together to share source code, tutorials and knowledge for free to help their fellow programmers
- Digg reviews
- Visual Studio Express and SharpDevelop Compared
-http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourVisuallyDesigningForms.aspx

2. MS visualcsharp - free , it seems it has nice sample projects already built ..

good video - http://msdn.microsoft.com/vstudio/express/visualcsharp/features/
http://msdn.microsoft.com/vstudio/express/visualcsharp/features/
http://msdn.microsoft.com/vstudio/express/visualcsharp/
http://msdn.microsoft.com/vstudio/express/support/faq/#pricing -- free
- Effective April 19th, 2006, all Visual Studio 2005 Express Editions are free permanently
- The Express Editions can only be used to create applications that run on the .NET Framework 2.0.
http://www.pcpro.co.uk/shopper/reviews/86761/microsoft-visual-studio-2005-express.html#
- Microsoft Visual Studio 2005 Express
- It isn't even included in Windows XP Home Edition. To allow for this, Visual Web Developer ships with its own built-in development web server,


3. C# Open Source - http://csharp-source.net/
- has IDEs, Charts, Reporting etc.. tools

- check if you can compile/build this zedcharts in .NET open source IDEs .. and they run on windows home baisc..

Open Source Charting & Reporting Tools in C#

Open Source IDEs in C#
-- check the other .NET/c#sharp IDE you stored in google docs , that may be better ...
paid charts
-- what a great way to present 6 categories for period of 12 or 24 ( months ) etc..

RSI

This is same as Stochastic except stoc is is replaced by RSI .

Long win/loss = 370/184 => 4/2 => 2/1
profitLong:0.0370
profitShort: 0.0370
lossLong: -0.0184
lossShort: -0.0267


ran as java STOCK stopLoss_Padding crossover_padding
ran as java EURO-CHF 10 3


if (( pmtd < 0 ) && ( pmtdDAYBEFORE > 0 ) && ( (pRSI >= 40) && (pRSI <= 70) ) )
prediction = goshort ;
else if (( pmtd > 0 ) && ( pmtdDAYBEFORE < 0 ) && ( (pRSI >= 30) && (pRSI <= 60) ) )
prediction = golong ;
else if ( ( (runningTrade == golong ) && (pRSI > 70)) || ( pHigh < pHigh_Arr.get(i-1)) )
prediction = closeAtNextOpen ;
else if ( ((runningTrade == goshort ) && (pRSI < 30)) || ( pLow > pLow_Arr.get(i-1)) )
prediction = closeAtNextOpen ;
----
what Murthy is asking is below, it needs 2 pass program to note RSI crossCross below ( 40) and then again crossed above 40 then any day later medium trend crossed above 0 then take LONG position ..

<<<<
Go long when RSI falls below the 40 level and rises back above it
or on a bullish divergence where the first trough is below 40.

exit: when medium term diff crosses below 0

>>>>

<<
MACD DIVERGENCE STRATERGY:
Go long when the MACD line crosses the signal line from below.

Go short when the MACD line crosses the signal line from above.
Unless there is a divergence, do'nt go for long if the signal is above the zero line, nor go short if the signal is below zero.

Place stop loss orders below the last minor Low when long, or the last minor High when short.

>>

Money Management


No trading system will be successful without adhering to strict money management guidelines. Discipline in trading comes from establishing rules that have proven successful and sticking to them religiously. While most of our work with sound money management stems from our experience with options, stock trading is no less immune to the pitfalls resulting from not following these rules. For the most part, rules that govern options trading apply equally well to stock trading.

The most important guiding principle is to let winners run and to implement strict loss control on all positions. Cutting losses (more on that below) takes on added importance when dealing with shorter trading periods. In addition, you should establish a minimum account size for your stock trading that will provide a satisfactory overall profit given the average size of wins and losses and the overall winning trade percentage that you expect from your trading.

Here are a few other money management principles to keep in mind.

You can be successful with a win rate of less than 50 percent - The principles of money management in stock trading cannot be mastered without a firm grasp of the statistical probabilities involved. In his esteemed book, Trading for a Living, Dr. Alexander Elder sums up the importance of this concept in a word - innumeracy. According to Dr. Elder, "Innumeracy - not knowing the basic notions of probability, chance, and randomness - is a fatal intellectual weakness in traders."

Renowned investing and trading coach Dr. Van K. Tharp addressed the issue of winning percentages in the November 1997 issue of Technically Speaking, the newsletter of the Market Technicians Association. In his article, "Why It's So Difficult for Most People to Make Money in the Market," Dr. Tharp states, "Most of us grew up exposed to an educational system that brainwashes us with the idea that you have to get 94 95% correct to be excellent. And if you can't get at least 70% correct you're a failure. Mistakes are severely punished in the school system by ridicule and poor grades, yet it is only through mistakes that human beings learn.

Contrast that with the real world in which a .300 hitter in baseball gets paid millions. In fact, in the everyday world few people are close to perfect and most of us who do well are probably right less than half the time. Indeed, people have made millions on trading systems with reliabilities around 40%."

The concept of limiting losses and letting the winners run cannot be overstated. In his classic work, The Battle for Investment Survival, Gerald Loeb states, "Accepting losses is the most important single investment device to insure safety of capital. It is also the action that most people know the least about and that they are least liable to execute ... The most important single thing I learned is that accepting losses promptly is the first key to success." In addition, Loeb says, "The difference between the investor who year in and year out procures for himself a final net profit and the one who is usually in the red is not entirely a question of superior selection of stocks or superior timing. Rather, it is also a case of knowing how to capitalize successes and curtail failures."

Losing Streaks Will Occur - An offshoot of this concept that often comes as a surprise to many traders is the experience of coping with an extended losing streak. The ultimate goal of achieving profitability will remain out of reach unless great care is taken to control the amount of capital allocated to each position, as even wildly successful traders are not immune to a string of losing positions.

To shed some mathematical light on the importance of proper money management, our Quantitative Analysis group created the following table that displays the likelihood of experiencing losing streaks of various lengths based on a range of win rates.

The figures in this table are based on a 50-trade period. The "Win Percentage" column encompasses a wide range of potential win rates, from five to 95 percent. The table shows the probabilities of seeing anywhere from two to 11 consecutive losing trades during the 50-trade cycle, based on the corresponding percentage win rate.

For example, with a winning percentage of 55 percent, you stand a better-than-50/50 chance (57.5 percent to be precise) of seeing a losing streak of five consecutive trades. This likelihood increases to nearly 77 percent if you win about half of your trades. The point of this illustration is that you will experience losing streaks. That's the bad news. The good news is that if you stick with your strict money management guidelines, you should be able to weather the storm and eventually enjoy profitable returns.

The moral of the story is that even though losing streaks are part of the game, profitability is achievable if you let winners run and cut losses short, while staying in the game by using proper money management principles.

Positive expectancy - Dr. Tharp has said that a critical factor to winning is "positive expectancy" - over a large number of trades, you should expect to achieve a positive return for each dollar you risk. For example, in the long run an even bet on "heads" in the flip of a true coin yields a "zero" expectancy. This is based on two key facts - the probability of profit is 50 percent and the payoff for "heads" is equal to the loss when "tails" occurs. The formula for this zero expectancy is:

0.50*1 + 0.50*(-1) = 0

A positive expectancy for this bet can occur if the coin was not "true," but instead the probability of "heads" was, say, 60 percent. In this case, the positive expectancy would be 20 cents for each dollar bet, as set forth below:

0.60*1 + 0.40*(-1) = 0.20

Another way to achieve a positive expectancy is for the payoff for a win to exceed the penalty for a loss. If you were paid $1.20 for each head that occurs when a true coin is flipped but you lost only $1.00 when it comes up "tails," your positive expectancy would be 10 cents for each dollar bet as follows:

0.50*1.20 + 0.50*(-1) = 0.10

Let's look at a real-world example. Over a one-year period, one of our stock recommendation services had a winning percentage of 52.9 percent (nine wins and eight losses). The payoff on winning trades averaged 20.2 percent, while the loss on losing trades averaged just 11.3 percent. This yields a positive expectancy of 5.4 cents for each dollar invested as calculated below:

0.529*0.202 + 0.471*(-0.113) = 0.054

In other words, investing in all of the stock trades over this period would have had a slightly more favorable outcome than getting paid $1.10 for each "heads" in a true coin flip while losing just $1.00 for each "tails."

It should now be obvious that a positive expectancy does not require a winning percentage much greater than 50 percent. Rather, it's the interrelationship of the win rate, average win, and average loss that determines overall profitability, or positive expectancy as Tharp defined it.

Allocate an equal percentage of your portfolio to every trade - It is in that same spirit of "staying in the game" that we turn our focus to allocations per trade. In an excellent chapter on money management in New Thinking in Technical Analysis: Trading Models from the Masters (Bloomberg Press, available on www.SchaeffersResearch.com), Courtney Smith discusses how to "play the game long enough to master the skills and information needed to become a profitable trader" using a system he calls the fixed fractional bet. Simply stated, every trade should represent a set percentage of your total account.

One of the primary advantages of the fixed fractional bet system is the principle of convexity - playing more dollars on the way up, while fewer dollars are at risk after each losing trade. On the downside, this system keeps you in the game longer by allowing you to weather the losing streaks that will inevitably occur. On the plus side, your portfolio will increase at a faster rate because you allocate more dollars per trade during winning streaks.

For example, let's say you have $100,000 available for stock trading and you wish to allocate 10 percent of your total account to each trade. You would therefore trade $10,000 for your first trade. Assume the trade gains 20 percent, or a $2,000 profit. Because your account size is now $102,000, your next trade would be for $10,200 (0.1*102,000). Now let's say your first trade lost 10 percent (remember you need to let your winners run and cut your losses short), or $1,000. Your account would now stand at $99,000, meaning that you would allocate only $9,900 to your next trade. Notice how this differs from a fixed-dollar strategy in which you would invest $10,000 in each trade.

Consistency is the key - One other thing we should mention. Don't vary the percentage you allocate trade by trade. Don't double up on a trade after a loss hoping to win your money back right away. There's a technique some blackjack players use in which they double their bet after each loss, the idea being that eventually the cards will turn in their favor and they will be ahead. That's fine (we suppose) if you're betting $10 chips since you likely will have a sufficient bankroll to stay in the game long enough for that to happen. But trading is not so forgiving. Losing streaks will occur, the market may be turbulent and volatile, your system may be flawed, and you might run into a series of trades that will wipe you out. Sure, you may get out of the hole with that one winner, but what if doesn't come in time? If you're sitting on the sidelines with no cash, there's positively no way to benefit from the winners. And as the saying goes, you miss 100 percent of the shots you never take.

The bottom line is that proper money management is the best way to play longer. As Smith states, "…risk management rules are really ways of dealing with the psychology of trading…[which] is the most important aspect of trading…discipline is the key psychological trait that the trader needs to make money. Risk management rules are an effort at trying to enforce the necessary discipline." Maintaining this discipline is the key to ultimate profitability.

Money Management in Trading

I believe money management is the key. This needs to be a marathon not a sprint. One thing I've realized is that you can't use the same lot sizes for all of your trades. For example on one trade you might be risking 30 pips and another 20 pips. So if you trade 4 lots on both of them (standard account) you'd be risking $1,200 on one trade and $800 on the other. That's not good money management and it can get you a person in trouble.Here's what I do.....

When I position trade (4hr and daily charts), I won't trade unless I have a 2:1 risk reward ratio. I figure out the proper stop loss for my trade, based on TA. So for this example say that's 40 pips. I then make sure based on TA that I'm comfortable getting at least 80 - 120 pips profit. Once i'm comfortable I put my information into the following formula.

S = (E*R) / (P-X)
($ amount willing to Lose on this ONE trade ) / (entry price - predetermined stop loss price)

S = Size of Trade
E = Account size (Cash)
R = Maximum Risk percentage per trade
P = entry price on the trade
X = pre-determined stop loss or exit price

So let's put in some numbers.....

My account size $10, 000
Entry price on EUR/USD 1.2600
Currently I'll risk 3% of my account on a trade
My pre-determined SL is 1.2560

So how many shares of EUR can we buy with our money management rules??

S=($10,000 * 3%) / (1.2600 - 1.2560)
S = $300 / 0.004
S= $75,000
( each lot is $100,000 you can buy only 75% or 3/4 of a lot to lose ONLY $300 on determined STOP Loss of 40 pips )


S = $300 / 0.004 ( 40 pips) => 40 pips are worth $400 =>
S = $300/$400
S = ( 300/400 ) * 100% as % => 75% of a LOT or 3/4 of a ONE LOT ..

Anyway this is the way I do it. I hope it helps...

Back Testing 1 hour interval data EUR/USD with Metastock


Forex Back testing
: A couple of months ago I was really interested in back testing trading strategies but lost interest after several attempts proved to be very unprofitable. I have since started using Metastock with esignal to backtest moving averages. Metastock has an optimizer function that will go through all combinations of moving averages and return the most profitable combinations. My goal will be to first to find the most profitable moving averages for the EUR/USD. I will try to correlate the moving average pairs to produce the most profitable 3 moving averages.

I've already started performing #3 and I currently have Metastock performing backtesting on over a years worth of 1 hour interval data. It's very CPU intensive and will take about 4 hours. It's currently half way done and so far the best EMA pair is the 7/75. The 7/75 EMA's actually have some impressive results over the last year on the 1 hour EUR/USD chart.

Here is an exact description of the backtest:

Buys/sells when a moving average of 7 periods goes above/below a moving average of 75 periods.

I also have it factoring in the broker fee and have set the results to buy/sell 1 lot.

Here are the results:

70 profitable trades with average profit of $355.86 per trade.
Highest profit was $1020 and the most consecutive profitable trades was 12

15 unprofitable trades with average loss of $972.67 per trade.
Highest loss was $2180 and the most consecutive losing trades was only 2

Over 1 year, if you followed this trading plan by buying or selling 1 lot each trade, you would have profited $10320.00.


asr observations:
0. win/loss ratio = 25,000/15000 = 1.65 , intersting with this small 1.65 win/loss ratio able to make 10320/year because there is lots of wins 70 vs. 15 losses ..

1. you need 2000 for 1 lot and margin anothe 2000 => total 4000 to begin with
1. need to find what is exit strategy ( hope Metastock will have it )
2. if you hit loss as first trade you lose 2000 then should bring in 2000 so it makes total 6000
3. 85 trades total , 6 pips/trade commision => 500 as commision , so your net profit is 9700
4. total trading days in a year is 250 , in that 85 trade days that is 1/3 of the time in trading days , you need kind of automated trade station human can not do it
5. the test was run on 1 hour chart, in real time with 5 min charts you may trigger some noise signal ( 7/75 EMA siganl ) and due to it you may lose some more and your actual net may be 7000 instead of 10320

6. If this is so well tested why we all pay 10% commision to mutuval funds just to see 15% annual returns vs. 400% shown above ..

Thursday, June 14, 2007

25 Ways to Distinguish Yourself

25 Ways to Distinguish Yourself

Making the Mostof Your Time:Going Beyond To-DoLists



When you can't earn an MBA

The Ten-Day MBA 3rd Ed.: A Step-By-Step Guide To Mastering The Skills Taught In America's Top Business Schools

Inspiration

finding Inspiration
Re-framing your questions

Distinguishing yourself is your answer to rapid commoditization that is haunting almost all professionals in this global economy. Not distinguishing yourself is to subject yourself to the risk of eroding your market value almost on a daily basis.

Distinguishing yourself is hard work. This list is not meant to be complete and is only an attempt to provide a starter checklist

Tripple EMA crossover

The following results are using Predicted Tripple EMA crossover:

- stopLoss_Padding=15 gave better win/loss=3 than with value 20 win/loss= 1.5 this is for COPPER.
- crossover_padding 5 vs. 8 no difference in win/loss ratio
a) Need to imporve win/loss to atleast 4/1
b) may be we need to run program in 2 phases, phase 1 gives points for different criteria ( main criteria like EMA crossover, nural index, MACD etc.. ) then in 2nd pass picking entry and exit point that way we can try different entry/exit by keeping base criteria as it is ( we try this later )

profitLong:319
profitShort: 0
lossLong: -128
lossShort: -4.5
ran as java STOCK stopLoss_Padding crossover_padding
ran as java COPPER 15.0 5.0
--
profitLong:319
profitShort: 0
lossLong: -128
lossShort: 0
ran as java STOCK stopLoss_Padding crossover_padding
ran as java COPPER 15.0 8.0
--------


profitLong:300
profitShort: 0
lossLong: -155
lossShort: -4
ran as java STOCK stopLoss_Padding crossover_padding
ran as java COPPER 20.0 5.0
------

GOLD results *********************** Long Win/Loss ratio : 3/1
profitLong:299
profitShort: 13
lossLong: -107
lossShort: -60
ran as java STOCK stopLoss_Padding crossover_padding
ran as java Gold2 10.0 3.0

Wednesday, June 13, 2007

Software Development

The Joel Test: 12 Steps to Better Code - software development / testing

10. Do you have testers?
If your team doesn't have dedicated testers, at least one for every two or three programmers,you are either shipping buggy products, or you're wasting money by having $100/hour programmers do work that can be done by $30/hour testers.

Is this the world's most generous internship?

06/2006 : written by Joel Spolsky is the co-founder and CEO of Fog Creek Software in New York City and the host of the Joel on Software blog at joelonsoftware.com

There's a better way to find and hire the very best employees.

I keep hearing people say that they only hire the top 1 percent of job seekers. At my company, Fog Creek Software, I want to hire the top 1 percent, too. We're doubling in size each year, and we're always in the market for great software developers.

In our field, the top 1 percent of the work force can easily be 10 times as productive as the average developer. The best developers invent new products, figure out shortcuts that save months of work, and, when there are no shortcuts, plow through coding tasks like a monster truck at a tea party.


From a recruiting perspective, the problem is that the people I consider to be in the top 1 percent in my field barely ever apply for jobs at all. That's because they already have jobs. Stimulating jobs. Jobs where their employers pay them lots of money and do whatever it takes to keep them happy.

If these pros switch jobs, chances are the offer came through networking, not because they submitted a resum� somewhere or trolled a job site like Monster. Many of the best developers I know took a summer internship on a whim and then stayed on. They have applied for only one or two jobs in their lives.

A lot of companies think they're hiring the top 1 percent because they get 100 resum�s for every open position. They're kidding themselves. When you fill an opening, think about what happens to the 99 people you turn away. They don't give up and go into plumbing. They apply for another job.

There's a floating population of applicants in your industry that apply for nearly every opening posted online, even though many of them are qualified for virtually none of these positions. So if the top 1 percent never apply for jobs, how can you recruit them? My theory is that the best way is to find them before they realize there is a job market--back when they're still in college.

Ah, college. Most kids wait until their last year to worry about finding their first job. And they are not that inventive. At more prestigious schools, the kids tend to feel that they are in such demand that they don't bother reaching out to employers. They simply go to on-campus recruiting events to see what's there. At Fog Creek, I've had a lot of success recruiting college students. In fact, I hired more than half of my developers as college interns, then recruited them for full-time work.

Before I go any further, I need to clarify that these are paid internships. Although unpaid internships for school credit are common in other fields from fashion to music, we pay $750 a week, plus free housing, free lunch, free subway passes, relocation expenses, and various other benefits.

Every time I talk about internships, somebody inevitably gets confused and thinks I'm taking advantage of slave labor. You there, young whippersnapper: Get me a frosty cold orange juice, hand-squeezed, and make it snappy!

That's not how it goes. The annual routine starts in September, when I begin tracking down the best future software developers in the country. I send a personalized letter to every promising computer science major that I can find.

Last year I sent 300 letters to fill six intern positions. Not e-mail. My letters are printed on a real piece of Fog Creek letterhead, which I sign myself in actual ink. Apparently this is rare enough that it gets kids' attention. I also call professors and former interns at schools such as Stanford, Duke, Dartmouth, and the University of Illinois to ask them for recommendations.

Finally, I write an article for my blog, which gets about a million unique visitors per month, that's especially relevant to students. At the end of the article, I solicit internship applications.

Eventually, we get hundreds of applications for these internships, and they're good candidates because they represent the whole population, not just the job-seeking population. We call the most promising candidates for a phone interview. It's a three-part conversation.

First, I ask the candidates to tell me about themselves and their classes. Then I pose a software development challenge. For example, how would you implement a Web-based clone of PowerPoint?

This gives me a feel for how smart they are, and if they know the basics of software development. Finally, I ask the candidates to interview me for the last 15 minutes of the call. They can ask about the company or living in New York City--whatever they want. If they pass the phone interview, Fog Creek flies them out to New York City to be interviewed in person.

By that time, there's a pretty good probability that we're going to want to hire them, so it's time to launch into full-court-press recruitment. Even though Fog Creek is a bootstrapped company where money is not spent lightly, we roll out the red carpet for our prospective interns.

A limousine meets them at the airport. A uniformed driver grabs their luggage and whisks them to their hotel, probably the coolest hotel they've ever seen--ideally it's right near the fashion district with models walking through the lobby at all hours and complicated bathroom fixtures that may be a part of the permanent collection of the Museum of Modern Art but good luck trying to figure out how to brush your teeth.

Waiting in the hotel room is a hospitality package with a T-shirt, a suggested walking tour of New York City written by Fog Creek staffers, and the DVD of Aardvark'd, a documentary about our 2005 interns made by Lerone Wilson, a filmmaker whose work has appeared on PBS. After a long day of interviews, we invite candidates to stay in the hotel for two more nights at our expense, so that they can explore the city before the limo takes them back to the airport for their flight home.

Only one in three applicants who make it to this stage will be hired, but still we don't skimp on them. We want the kids who don't make the grade to go back to campus thinking we're a classy employer. Our hope is that they tell all their friends how much fun they had and encourage them to apply for an internship the next summer, if only for the free trip.

During the summer of the internship itself, the students generally start out thinking, "Okay, it's a nice summer job and some good experience." We're a little bit ahead of them.

We use the summer to decide if we want them full-time. So we give them real work. Hard work. Our interns always work on production code. Sometimes they work on the coolest new stuff in the company, which can make the permanent employees a little jealous, but that's life. One summer we had a team of four interns build a whole new tech support product, Fog Creek Copilot, from the ground up. That particular intern class paid for itself by the end of the year.

Even when they're not building a new product, our interns work on real shipping code, with the helpful advice of experienced mentors, of course. Our interns are totally, personally responsible for some major area of our software's functionality.

And then we make sure these kids have a great time. We host parties and open houses. We get them free housing in a rather nice local dorm where they can make friends from other companies and schools.

We have some kind of extracurricular activity or field trip every week: Broadway shows, movie openings, museum tours, a boat ride around Manhattan, a Yankees game. Believe it or not, one of last year's favorite excursions was a trip to Top of the Rock at Rockefeller Center. It's just a tall building with a nice view of the Manhattan skyline. You wouldn't think it would be such an awe-inspiring experience. But it was.

At the end of the summer, a few interns will have convinced us that they are truly great programmers and that we just have to hire them. Not all of them, mind you--some are merely great programmers who for some reason we are willing to pass on, and others would be great somewhere else but not at Fog Creek.

For the ones we really want, there's no sense in waiting. We make an early offer for a full-time job, conditional on their graduation. And dollarwise, it's a great offer: $75,000. We want them to be able to go back to school, compare notes with their friends, and realize that they're getting a higher starting salary than their peers.

Does this mean we're overpaying? I don't think so. You see, the typical first-year salary has to take into account a certain amount of risk that the person won't work out. But we've already auditioned these kids, so there's almost no risk that they won't be great. When we hire them, we have more information about them than any other employer who has only interviewed them. Because there's less inherent risk, we can pay them more money.

At this point, if we've done our job right, the intern gives up and accepts our offer. Sometimes it takes a little persuading. Sometimes they want to leave their options open. That's fine with us.

An outstanding offer from Fog Creek ensures that the first time they have to wake up at 8 a.m. and put on a suit for a high-pressure interview with Oracle --well, when the alarm goes off, there's a good chance they'll say to themselves, why the heck am I getting up when I already have an excellent job waiting for me at Fog Creek? My hope is they won't even bother going to that interview.

An internship program creates a pipeline for great employees. It's a pretty long pipeline, so you need to have a long-term perspective, but it pays off in spades.

Trading with confirmation from stochastics

Stretegy: Trading with confirmation from stochastics
Here is my data :
data range: 6/2005 - 6/2007
pair: EUR/CHF

profit Long: 415 ( all in PIPs) -- over all win/loss = 750/400 => 2/1
loss Long: -123 -- by just trading only LONG we can have win/loss: 4/1 by avoiding SHORT

profit Short: 332
loss Short: -268


2005-06-14 2005-06-16 1.5382 1.5396 trade:2 TRENDChange 0.0014 StopLoss-
1.4634
2005-07-29 2005-08-02 1.5597 1.5577 trade:3 TRENDChange 0.0020 StopLoss4
.5637
2005-08-24 2005-08-26 1.5537 1.5452 trade:2 TRENDChange -0.0085 StopLoss
-1.4478
2005-09-14 2005-09-16 1.5469 1.5489 trade:2 TRENDChange 0.0020 StopLoss-
1.4548
2005-10-04 2005-10-07 1.5513 1.5475 trade:3 TRENDChange 0.0038 StopLoss4
.5544
2005-10-18 2005-10-20 1.5536 1.553 trade:2 TRENDChange -0.0006 StopLoss-
1.4487
2005-12-16 2005-12-20 1.5438 1.5513 trade:2 TRENDChange 0.0075 StopLoss-
1.4599
2006-01-04 2006-01-06 1.5503 1.5446 trade:3 TRENDChange 0.0057 StopLoss4
.5538
2006-01-17 2006-01-20 1.5505 1.5532 trade:2 TRENDChange 0.0027 StopLoss-
1.4527
2006-01-26 2006-01-30 1.5482 1.5548 trade:3 TRENDChange -0.0066 StopLoss
4.5512
2006-03-08 2006-03-13 1.561 1.5685 trade:3 TRENDChange -0.0075 StopLoss4
.5631
2006-04-25 2006-04-27 1.5711 1.5818 trade:2 TRENDChange 0.0107 StopLoss-
1.4305
2006-05-25 2006-05-30 1.5532 1.5614 trade:2 TRENDChange 0.0082 StopLoss-
1.45
2006-06-09 2006-06-13 1.5582 1.553 trade:3 TRENDChange 0.0052 StopLoss4.
5624
2006-06-21 2006-06-23 1.5584 1.5631 trade:2 TRENDChange 0.0047 StopLoss-
1.4438
2006-07-13 2006-07-17 1.5668 1.5607 trade:3 TRENDChange 0.0061 StopLoss4
.5705
2006-08-02 2006-08-04 1.5722 1.5757 trade:3 TRENDChange -0.0035 StopLoss
4.5752
2006-10-03 2006-10-09 1.5836 1.5879 trade:2 TRENDChange 0.0043 StopLoss-
1.4159
2006-10-20 2006-10-25 1.5875 1.5903 trade:3 TRENDChange -0.0028 StopLoss
4.5916999999999994
2006-11-22 2006-11-27 1.5935 1.583 trade:3 TRENDChange 0.0105 StopLoss4.
5954999999999995
2006-12-04 2006-12-07 1.592 1.5888 trade:2 TRENDChange -0.0032 StopLoss-
1.4119
2007-03-20 2007-03-22 1.6125 1.6189 trade:3 TRENDChange -0.0064 StopLoss
4.6159

profitLong:0.0415
profitShort: 0.0333
lossLong: -0.0123
lossShort: -0.0268

Tuesday, June 12, 2007

Vantage Point

Trading with confirmation from stochastics
- click on the graph on this page at the bottom which shows good 70/30 graph
- WOW see win/loss ratio it is great even thought it happend only 8 trades in a year. try with other currencies , commodities , stocks.

Finding agreement to take a trade -- let us try to use this for position trade instead of day trade

Trading Rate Of Change ROC

Short-term ETF trading -- this text can be used to write a new strategy

Saharaindiapariwar

Sahara group has today exponentially grown to become a conglomerate of USD 10.87 billion. The group has been expanding its ventures at a rapid pace.

The group's Financial Services Division serves more than 61 million depositors, one out of every 17 Indians, with its financial services making the group one of the most influential financial companies in India. The Infrastructure and Housing Division is on its way to creating the world’s largest chain of luxury townships in 217 Indian cities. One of its residential projects, Aamby Valley City has magnificence written all over its 10000 acre serene township and has already become a dream destination. Sahara India’s Media and Entertainment Network that includes multi-lingual dailies, weeklies, 24-hour satellite news channels, two entertainment channels and a film production company is one of the largest in India.


"Saharasri" Subrata Roy Sahara
-- friend of Mulayam, Amitabh trio...
AAMBY VALLEY CITY
http://www.saharahousing.com/projects.html
http://www.saharahousing.com/default.html

Monday, June 11, 2007

Java

java2s.com great site , it has all programming lang. ready to use example code..
excellent example code to learn Java concepts

Java Articles

- It has javascript here
- it has SQL, oracle you name it it has every thing easy example ...

Project Delivary

China behind India in software, says Murthy

http://www.rediff.com/money/2007/jun/11murthy.htm
China was far behind India in the software sector and India should focus its efforts towards leveraging this lead in forging ahead in the global market, Chairman and Chief Mentor of Infosys [Get Quote] Narayana Murthy said.

Addressing a group of 125 interns at the the Infosys global internship programme in Bangalore on Monday, he said China had done the best job in the world in manufacturing.

However, it was far behind India in the area of IT softwares. "India has had a lead of 20 years over China," he said, explaining the reasons.

Moreover, India attracted the middle class professionals, who worked hard, understood customers and operations better and are fairly smart. India also developed a fairly advanced system, processing and methodology for distribution development model, he said, adding Indian companies also took to quality in a big way.

However, Indian companies, he said, should not underestimate China which was an "extraordinary nation and if it decided to put its soul into something it did it well."

China also had an excellent education system which it has been successfully focusing on, an example that could be emulated by other nations as well, he said.

Replying to a question posed by an intern on Infosys serving the Chinese market, he said Infosys currently was working with multinationals in China in phase one. In phase two, it would work with local Chinese company.

Every major player had 'serious' operations in China, which was a very important market and is growing. It had a two trillion plus dollar economy ( asr: read stock Market capitalization vs. India 1 trillion) with $950 billion exports. ( asr: wow half of chiana's stock Market cap is exports ).

Amazing story of how Munjal built Hero Honda

http://www.rediff.com/money/2007/jun/11bspec.htm
The forties were turbulent times, but in the midst of all the uncertainty, four young restless brothers in undivided Punjab were marking time for an opportunity to explode upon the Indian corporate scenario. They were the Munjal brothers: Dayanand, Satyanand, Brij and Om.

This is the story of Brijmohan Lal Munjal, chairman and managing director of Hero Honda Motors [Get Quote].
Born in a rather nondescript tehsil called Kamalia in Lalpur district of undivided Punjab, the Munjal brothers always looked at life beyond their traditional business of vegetable trading. Brijmohan Lal had barely stepped out of his teens when his older brothers decided to set up their new business -- trading in bicycle components.

In 1943, unconsciously preempting the inevitable partition of India and its frightening consequences, they decided to shift base from Lahore to Amritsar.

Brijmohan Lal Munjal told CNBC-TV18, "There was nothing available but bicycles on the road. But there was nothing to repair them with. Some artisans in Sialkot, Amritsar and Lahore, started making some components in a very crude way. People like us, our family and another family in Amritsar, started getting those parts from the market, wherever we could get some imported parts and bring it to those artisans. We gave them some money to start making these parts."

Four years after the business shifted to Amritsar, a sudden turn of events hit the Munjals very hard. India was now a free country and the turbulent political climate in Amritsar frightened them into putting the brakes on the fledgling bicycle components business. The Munjals had little choice but to shift base yet again -- this time to Ludhiana.

Munjal recalls, "In Ludhiana, there is this community called Ramgarhias. They are born artisans. There they had already started manufacturing certain parts and when some people like us, who had the capability of bringing them the samples and the possibility of selling them -- it became a very beautiful combination -- their technology and our commercial strength."

India's independence brought with it a new determination: one of self-reliance. The entire nation was on the move and the Munjals would provide the wheels for it.

Managing Editor, The Smart Manager, Gita Piramal explains, "Picture for yourself, India at that moment in time, a country racked by famines and droughts, its industrial machinery devastated by the demands made on it by World War II, no friends in the world, no foreign exchange, no reserves. So, naturally, Nehru and the administration of the time invited entrepreneurs to build the new temples, which would create wealth for the country."

"Many entrepreneurs took the opportunity, amongst them were bicycle makers, bicycles were in big demand at that time. . . groups like the Birlas with Hind Cycles, TI in the south, they all jumped on to this bandwagon. The Munjals were one of them, in fact, they knew the business better than most and their centre of operation would be Ludhiana."

Ludhiana in the early 1950s was the melting pot of pathbreaking business ideas, a place steaming with entrepreneurs. This one sleepy little town evolved into a buzzing business hub and captured the spirit of an emerging new India.

This was just the right place for young entrepreneurs like Munjals to pump their bicycle components manufacturing business to greater heights, but as always, wheels turned within wheels.

Those were difficult times and it didn't turn out as easy for the brothers to take off as they had anticipated. There were plenty of challenges, the foremost among which was to procure a manufacturing licence.

Munjal recalls: "Manubhai Shah was the industry and commence minister between 1950 and 1954. He somehow got convinced that if you have to get these people settled and provide them with employment, then you have to allow people to manufacture something, allow people to import something. He created the National Small Industries Corporation, NSIC. "

"A Ford Foundation team had come from the United States to advise and guide because at that time, everything was so fluid, nobody knew where to go. I had to travel along with them to Madras (now Chennai), Bangalore and several places. They made a blueprint for the NSIC."

What set the Munjal brothers apart from their contemporaries was their gumption and the ability to swing tides in their favour. While, government regulations may have stifled their growth, Brijmohan Lal started travelling across the length and breadth of India, scouting for new possibilities.

It was during one such trip that he got the idea to manufacture bicycles. Fortuitously, this time, the government would give him the much-needed encouragement and the thrust that he needed to scale up.

Immediately after the launch of Hero Cycles, the youngest of the four brothers Omprakash was given the crucial task of putting a dealer network in place. This was a very significant step that gave Hero Cycles an edge over existing competition like Raleigh and Atlas Cycles.

While the brothers worked hard to sell their stuff, Brijmohan Lal straddled the globe to source world-class components and machines. In 1959, he made his first trip beyond Indian shores to Germany -- again a move that would leave this competition miles behind.

Munjal recalls, "I went first to Germany for some years and then to Japan and I started bringing in the modern equipment for manufacturing bicycle components. I think I can claim that I took bicycle making to a different level than it was being done then. Germany, at that time, was really bagging business. I bought a complete chain-making plant for Rs 3 lakh (Rs 300,000)."

While Brijmohan Lal travelled across the world to explore new opportunities, his brothers concentrated on consolidating the business and just when it seemed that the good times had finally arrived; tragedy struck.

While Hero Cycles was trying to find a foothold in the industry and had almost got even with its competition - a tragedy hit the Munjals. In 1968, the eldest of the Munjals brothers, Dayanand, died. He was the omnipresent father figure who had guided and protected his brothers from all the evils of the big bad world of business. This loss left a vacuum that would be very difficult to fill.

Dayanand's sudden demise came as a huge blow for the Munjals, but the brothers were determined not to let his dreams die. The Munjals bounced back from the tragedy with a more focussed look at their long-term expansion strategy.

By 1971, the Munjals had set up a rim-making division for Hero Cycles and launched another company called Highway Cycles that would make freewheels -- it was then that Brijmohan Lal restructured and streamlined Heros rapidly expanding business.

Within a span of 6-7 years, production at the Hero Cycles plant doubled and in 1975 it became the largest manufacturer of bicycles in India. In the late 70s, the Indian government was slowly stirred into doling out licenses for Indian companies to venture into mopeds and Brijmohan Lal, who had seen mopeds on the roads in Western countries, quickly snapped up the opportunity. Hero Cycles' two-wheeler business would now reach its next level.

But to start manufacturing mopeds, Hero Cycles would need a partner. Munjals approached a French two-wheeler giant Peugeot for a tie-up, but in spite of drawing initial interest, the dream ticket eluded the Munjals. The talks broke down and Hero went on to make its own mopeds modeled on the Peugeot machine but designed in India and it was called Majestic Auto [Get Quote].

By 1983, Majestic Auto had captured almost 35% of the Indian moped market.

The ambitious drive of the 70s culminated on a high note in 1979. The company had just reached the production mark of 1 million bicycles. In that same year, Hero ventured into unknown business territories.

Piramal explains, "In the 1950s, there were just four Munjal brothers in the business. At the turn of the 21st century, there were 21 active members. BM Munjal's handling of the situation is perhaps a classic illustration of how to manage growth and a growing family."

"He worked on two premises; first that all four brothers, the original four brothers, had an equal stake in all the Munjal companies. The second premise was that any Munjal who wanted to work, had to have a business to run. Now what did that mean? That meant that between the 1980s, 1990s and 2000, the business began to expand and to diversify -- they went into textile spinning, they went into financial services. . . although not all of these succeeded."

She adds, "They had also integrated vertically right up to a cold-rolling steel mill. But the biggest and the most important factor in all this was their continuous growth in the auto components' segment, and this would become perhaps the Munjal's key competitive strength."

After the curtain raiser of the 70s and the successful launch of Munjal Casting in 1981, the stage had been set for a quantum leap that would take India's corporate world by surprise -- in fact, they might never know what hit them, until it was too late.

With an enviable slew of successes behind them, the Hero Group emerged a bigger, bolder player in the world of two-wheelers in the early 80s. The first mega milestone of the decade was the decision to join hands with the Japanese automobile giant, Honda. And thus Hero Honda was born. Overnight, it redefined the rules of the game in the two-wheeler industry.

Two-wheelers in India were then synonymous with scooters and the scooter market was the monopoly of a lone player -- Bajaj Auto [Get Quote] Limited. At a time, when scooters had a waiting period of 12 years or even longer, Hero's tie-up with Honda changed it all. Although, it was Munjal's long cherished desire to produce scooters, destiny had other plans. It was a blessing in disguise.

India's preferred vehicle, scooters, would amazingly be relegated into oblivion. India had wanted to break free and choked by the malaise of the Licence Raj, it craved for more choices and the sleek motorcycles that rolled out of the Hero Honda assembly line, were just such a welcome sight.

But just when things were looking promising for the new joint venture, the clouds of misfortune had gathered over Punjab and cast an ominous shadow over Hero Honda. This time an unexpected political event would rattle it: Operation Blue Star [Get Quote].

Armoured tanks rolled into the Golden Temple in Amritsar, and in their wake, the country was plunged into a state of unprecedented confusion and cruelty. Sikhism was the target of xenophobia. The Munjals' business based out of Punjab bore the brunt of irrational hatred. For the Munjals, these were difficult times. But Brijmohan Lal Mumnjal was determined not to leave Punjab, not ever, not even after Indira Gandhi's assassination.

Piramal recalls, "The summer of 1984 was a tumultuous period for India and it was a watershed moment for the Munjals in their corporate saga. That month, Indian troops were storming the Golden Temple at Amritsar and on the other hand, the Munjals were inking their pact with Honda to begin motorcycle production in India. A few months later, Hero Honda made its first public offering."

Hero Honda had set up its first assembly line in Dharuhera, Haryana. The Munjals had for the first time, set foot outside Ludhiana to build a manufacturing facility. Thus, the first 100 cc Hero Honda motorcycle came off the assembly line in April 1985 and with it Hero Honda kick started its journey to unimaginable success.

Fill it, shut it, forget it. Slick and unforgettable slogans for a never before kind of launch and a new icon in the two-wheeler industry was born.

The same year that Hero Honda launched its first bike, Hero struck pay dirt with another Japanese collaboration, with Showa to make shock absorbers. The new company was called Munjal Showa [Get Quote]. But at the very same time, returns from Hero Honda had the Munjals disturbed. A falling yen-rupee exchange rate suddenly left the Munjals on the losing end. Ironically, fortunes had reversed and with the sale of each bike, the Munjals now actually lost money.

Piramal explains, "The yen was rising and they were actually losing money on every bike. Honda on the other hand, wanted the components sourced from Japan. They were not sure of the quality and they insisted on it." Behind this, also lay the fact that who is going to make how much money -- will it be Honda or will it be the Munjal Group companies, which made the components. It was a delicate balancing act, a transfer of pricing gain.

But good times were right around the corner and soon enough the Munjals got a pleasant surprise. After three decades of non-stop rigour, Hero Cycles emerged right on top of the pile, not just in India, but also in the world, as the largest bicycle manufacturer. The seal of approval came from none other than the Guinness Book of World Records.

Piramal says, "When the Guinness Book of World Recordssent out a press release that Hero Cycles was the world's biggest single bicycle maker, it really came as a bolt from the blue and it became a source of pride. There were very few world class companies in India at the time, and this became like a beacon of hope - that it was possible for Indian companies to be world class."

Despite the hassles that came with it, the 80s were eventful for the Munjals -- with new partnerships, new milestones and new horizons.

In the 90s, Hero Honda had already emerged as the number one manufacturer in India and compelled competitors like Bajaj Auto to reinvent their strategy from scooters to motorcycles. The rupee yen exchange had taken a healthy turn. In 1990, Hero Honda Motors made Rs 1,000 for every bike it sold and that lead to an annual profit of $10 million. But silver clouds are often followed by dark ones.

Raman Kant Munjal, Brijmohan's elder son, who had shouldered the responsibility of setting up Hero Honda and had been instrumental in translating his father Brijmohan Lal's dream into reality, died quite suddenly in June 1991.

Piramal says, "When he died suddenly it was a massive shock for the family. BM Munjal had actually retired by then and the sad man got back into business and set about grooming his younger son, Pawan. Under Pawan's leadership, Hero Honda actually managed to overtake Bajaj Auto."

One personal loss after the another hit Brijmohan Lal Munjal. First his mentor -- elder brother Dayanand -- and then his son Raman Kant passed away, but neither political unrest nor personal losses shook his determination; he was made of sterner stuff.

Putting these tragedies behind him, Brijmohan moved on with Hero's expansion plans. In the first lap of the 90s, the group diversified its portfolio. In 1991, it set-up Hero Honda Finlease to finance its customers. Two years later, in 1993, the Group launched Hero Exports, which emerged as India's largest exporter of two-wheelers.

And a year later, the Japanese firm reaffirmed its partnership with Hero for the next ten years, and Hero Honda drove all the way, laughing into a brand-new sunrise.

This time, Honda finally allowed Hero to move into a domain that was until then, the absolute monopoly of another two-wheeler manufacturer, Kinetic [Get Quote]. Hero now got the nod from Honda to manufacture scooters with Honda's technology, but for the Munjals the offer came just a wee bit too late.

Hero Honda Motors CEO Pawan Munjal says, "We were very focussed on motorcycles, so they decided to set up a separate company -- a subsidiary of theirs and we decided they would make scooters and we would make motorcycles for the first couple of years. Thereafter, both of us would be free to make all kinds of two-wheelers."

Piramal says, "Though outwardly, the partners presented an amicable front. . . that everything is hunky-dory. . . below the surface there were many tensions. Some of these tensions were, for instance, which model should be introduced in the second round, actually delayed the building of the Gurgaon plant. It's a beautiful plant, spanking new, well laid out and spotless but because of these underlying tensions, growth got stymied so much so that, Bajaj Auto once again took the leadership. It brought out its four-stoke engine and had a very cheeky ad -- 'Kyon Hero?"

The ambition for growth and to break new ground took the Hero Group from one milestone to the next. Hero tehn tied up with the German automobile giant, BMW. It announced its plans to produce the three-series in India. But neither the partnership not the plan worked. The BMW aspiration remained a pie in the sky and left the Munjals poorer but wiser.

Not all dreams come true, not all decisions lead to profit nor all opportunities to success, but in business, what matters is the ability to have the courage to think big. Those who can't, lead nondescript lives but those who dare, become legends. That, in a way, is also the essence of Hero Group's corporate success and by the end of the 90s, they were ready to reap the harvest of the seeds, they had sown on unexplored soil.

Young Turks of the Munjal family had taken over the mantel from the patriarch Brijmohan Munjal. Under them, the Hero Group diversified into IT and IT-enabled services and Hero Honda emerged as the market leader with sales of over a million motorcycles. In 2002, Hero Cycles tied up with National Bicycle Industries, a part of the Matsushita Group to manufacture high-end bicycles.

The same year, they launched Easy Bills to offer utility bill collection and retail services and then in 2004, they went ahead with a tie-up that would make all the difference to the Hero Group's portfolio. But with this Hero had a little lesson to learn.

In 2004, Hero Motors tied up with Aprilia Scooters of Italy. They also worked out an export channel to European market for its two-wheelers and two-wheeler engine through Aprilia. But the demand for two-wheelers in India was only a functional one and they were trying too hard to position high-end motorcycles in the consumer mindspace that couldn't comprehend the need for them.

The Aprilia bubble burst but there was still reason to sell it. The Munjals had, with their ambition of making scooters, finally entered the market with the launch of its 100 cc Pleasure in 2006.

Piramal explains, "The Munjals knew, by this time, that they could not forever hang on to Honda Scooters. Right in the beginning, they had been disappointed that they wanted to make scooters but had not been allowed to. Of course, the motorcycle business today is much larger than scooters. Then when Honda thought that it would bring cars to India, they did not come to the Munjals, they went to the Shrirams. All this, gave the Munjals food for thought."

Despite a long drawn track record of multiple tie-ups and expansion, the Hero Group has always relied on technologies developed by international companies. A strategy that has held the Munjals in good stead for 50 years in this business.

So, from the bylanes of Ludhiana to the highways of international renown, 83-year-old Brijmohan Munjal is steady in his dedication towards his work. He built it all with his hard work, nurtured his dreams and fulfilled tehm.

With the widespread network of 5,000 dealers across the country, the Hero Group today is a conglomerate with an annual turnover of Rs 10,000 crore. Highs and lows, rewards and backlashes have all been a part of the Hero Group's corporate story, but downfalls didn't discourage them, nor did losses kill their spirit of entrepreneurship.

Wednesday, June 6, 2007

Rural India

My belief is
0. don't give some money and leave them on their own. Hand hold them work with them crate confidence they can solve their own problems all the need is expertise help and some finance .
1. create/mobilie community ( let them work for 8 works, 365 days)
2. financing
- get help ( urbans who are hailed from these rural ) will help financially if community motivation is demonstrated .
- government aid (existing ) can be used with community as one voice.
3. experts (retired) will help in hand holding the projects.

- they need 8 hour work for 365 days
- it doesn't have to be paid work, they can work on community home building project.
- when there is no work days, they pool resources in building/upgrading their homes.
- labor/construction cost may be 20% of the total house cost. If trained they can do as community group for them selves. It is not just construction, they can do making wooden doors, welding gates etc..
- create efficiencies: couple of villages for making/specializing wooden doors, iron windows . You should get it at 50% of commercial price ( shop price in town)
- they need engineering researched plans/models suited for rural india. for sure retired top tier engineering architects will help with this by hand holding. Need to research existing low cost house models first.

schooling:
------------
- Create schools , get fund for it, required is small . Have parents support it.
- improve existing schools ( send paid teachers for art, math , play ) , let the existing school be there.

Programming

74 Quality Ruby on Rails Resources and Tutorials

Monday, June 4, 2007

Startup Library

Startup Library
Pitching Ideas Roundup
What We Looked for in an Angel

Life lessons from Narayana Murthy

Life lessons from Narayana Murthy - May 28, 2007
N R Narayana Murthy, chief mentor and chairman of the board, Infosys Technologies, delivered a pre-commencement lecture at the New York University (Stern School of Business) on May 9. It is a scintillating speech, Murthy speaks about the lessons he learnt from his life and career. We present it for our readers:

Dean Cooley, faculty, staff, distinguished guests, and, most importantly, the graduating class of 2007, it is a great privilege to speak at your commencement ceremonies.

I thank Dean Cooley and Prof Marti Subrahmanyam for their kind invitation. I am exhilarated to be part of such a joyous occasion. Congratulations to you, the class of 2007, on completing an important milestone in your life journey.

After some thought, I have decided to share with you some of my life lessons. I learned these lessons in the context of my early career struggles, a life lived under the influence of sometimes unplanned events which were the crucibles that tempered my character and reshaped my future.

I would like first to share some of these key life events with you, in the hope that these may help you understand my struggles and how chance events and unplanned encounters with influential persons shaped my life and career.

Later, I will share the deeper life lessons that I have learned. My sincere hope is that this sharing will help you see your own trials and tribulations for the hidden blessings they can be.

The first event occurred when I was a graduate student in Control Theory at IIT, Kanpur, in India. At breakfast on a bright Sunday morning in 1968, I had a chance encounter with a famous computer scientist on sabbatical from a well-known US university.

He was discussing exciting new developments in the field of computer science with a large group of students and how such developments would alter our future. He was articulate, passionate and quite convincing. I was hooked. I went straight from breakfast to the library, read four or five papers he had suggested, and left the library determined to study computer science.

Friends, when I look back today at that pivotal meeting, I marvel at how one role model can alter for the better the future of a young student. This experience taught me that valuable advice can sometimes come from an unexpected source, and chance events can sometimes open new doors.

The next event that left an indelible mark on me occurred in 1974. The location: Nis, a border town between former Yugoslavia, now Serbia, and Bulgaria. I was hitchhiking from Paris back to Mysore, India, my home town.

By the time a kind driver dropped me at Nis railway station at 9 p.m. on a Saturday night, the restaurant was closed. So was the bank the next morning, and I could not eat because I had no local money. I slept on the railway platform until 8.30 pm in the night when the Sofia Express pulled in.

The only passengers in my compartment were a girl and a boy. I struck a conversation in French with the young girl. She talked about the travails of living in an iron curtain country, until we were roughly interrupted by some policemen who, I later gathered, were summoned by the young man who thought we were criticising the communist government of Bulgaria.

The girl was led away; my backpack and sleeping bag were confiscated. I was dragged along the platform into a small 8x8 foot room with a cold stone floor and a hole in one corner by way of toilet facilities. I was held in that bitterly cold room without food or water for over 72 hours.

I had lost all hope of ever seeing the outside world again, when the door opened. I was again dragged out unceremoniously, locked up in the guard's compartment on a departing freight train and told that I would be released 20 hours later upon reaching Istanbul. The guard's final words still ring in my ears -- "You are from a friendly country called India and that is why we are letting you go!"

The journey to Istanbul was lonely, and I was starving. This long, lonely, cold journey forced me to deeply rethink my convictions about Communism. Early on a dark Thursday morning, after being hungry for 108 hours, I was purged of any last vestiges of affinity for the Left.

I concluded that entrepreneurship, resulting in large-scale job creation, was the only viable mechanism for eradicating poverty in societies.

Deep in my heart, I always thank the Bulgarian guards for transforming me from a confused Leftist into a determined, compassionate capitalist! Inevitably, this sequence of events led to the eventual founding of Infosys in 1981.

While these first two events were rather fortuitous, the next two, both concerning the Infosys journey, were more planned and profoundly influenced my career trajectory.

On a chilly Saturday morning in winter 1990, five of the seven founders of Infosys met in our small office in a leafy Bangalore suburb. The decision at hand was the possible sale of Infosys for the enticing sum of $1 million. After nine years of toil in the then business-unfriendly India, we were quite happy at the prospect of seeing at least some money.

* ALSO READ: The amazing success story of Infosys

I let my younger colleagues talk about their future plans. Discussions about the travails of our journey thus far and our future challenges went on for about four hours. I had not yet spoken a word.

Finally, it was my turn. I spoke about our journey from a small Mumbai apartment in 1981 that had been beset with many challenges, but also of how I believed we were at the darkest hour before the dawn. I then took an audacious step. If they were all bent upon selling the company, I said, I would buy out all my colleagues, though I did not have a cent in my pocket.

There was a stunned silence in the room. My colleagues wondered aloud about my foolhardiness. But I remained silent. However, after an hour of my arguments, my colleagues changed their minds to my way of thinking. I urged them that if we wanted to create a great company, we should be optimistic and confident. They have more than lived up to their promise of that day.

In the seventeen years since that day, Infosys has grown to revenues in excess of $3.0 billion, a net income of more than $800 million and a market capitalisation of more than $28 billion, 28,000 times richer than the offer of $1 million on that day.

In the process, Infosys has created more than 70,000 well-paying jobs, 2,000-plus dollar-millionaires and 20,000-plus rupee millionaires.

A final story: On a hot summer morning in 1995, a Fortune-10 corporation had sequestered all their Indian software vendors, including Infosys, in different rooms at the Taj Residency hotel in Bangalore so that the vendors could not communicate with one another. This customer's propensity for tough negotiations was well-known. Our team was very nervous.

First of all, with revenues of only around $5 million, we were minnows compared to the customer.

Second, this customer contributed fully 25% of our revenues. The loss of this business would potentially devastate our recently-listed company.

Third, the customer's negotiation style was very aggressive. The customer team would go from room to room, get the best terms out of each vendor and then pit one vendor against the other. This went on for several rounds. Our various arguments why a fair price -- one that allowed us to invest in good people, R&D, infrastructure, technology and training -- was actually in their interest failed to cut any ice with the customer.

By 5 p.m. on the last day, we had to make a decision right on the spot whether to accept the customer's terms or to walk out.

All eyes were on me as I mulled over the decision. I closed my eyes, and reflected upon our journey until then. Through many a tough call, we had always thought about the long-term interests of Infosys. I communicated clearly to the customer team that we could not accept their terms, since it could well lead us to letting them down later. But I promised a smooth, professional transition to a vendor of customer's choice.

This was a turning point for Infosys.

Subsequently, we created a Risk Mitigation Council which ensured that we would never again depend too much on any one client, technology, country, application area or key employee. The crisis was a blessing in disguise. Today, Infosys has a sound de-risking strategy that has stabilised its revenues and profits.

I want to share with you, next, the life lessons these events have taught me.

1. I will begin with the importance of learning from experience
. It is less important, I believe, where you start. It is more important how and what you learn. If the quality of the learning is high, the development gradient is steep, and, given time, you can find yourself in a previously unattainable place. I believe the Infosys story is living proof of this.

Learning from experience, however, can be complicated. It can be much more difficult to learn from success than from failure. If we fail, we think carefully about the precise cause. Success can indiscriminately reinforce all our prior actions.

2. A second theme concerns the power of chance events.
As I think across a wide variety of settings in my life, I am struck by the incredible role played by the interplay of chance events with intentional choices. While the turning points themselves are indeed often fortuitous, how we respond to them is anything but so. It is this very quality of how we respond systematically to chance events that is crucial.

3. Of course, the mindset one works with is also quite critical.
As recent work by the psychologist, Carol Dweck, has shown, it matters greatly whether one believes in ability as inherent or that it can be developed. Put simply, the former view, a fixed mindset, creates a tendency to avoid challenges, to ignore useful negative feedback and leads such people to plateau early and not achieve their full potential.

The latter view, a growth mindset, leads to a tendency to embrace challenges, to learn from criticism and such people reach ever higher levels of achievement (Krakovsky, 2007: page 48).

4. The fourth theme is a cornerstone of the Indian spiritual tradition: self-knowledge. Indeed, the highest form of knowledge, it is said, is self-knowledge. I believe this greater awareness and knowledge of oneself is what ultimately helps develop a more grounded belief in oneself, courage, determination, and, above all, humility, all qualities which enable one to wear one's success with dignity and grace.

Based on my life experiences, I can assert that it is this belief in learning from experience, a growth mindset, the power of chance events, and self-reflection that have helped me grow to the present.

Back in the 1960s, the odds of my being in front of you today would have been zero. Yet here I stand before you! With every successive step, the odds kept changing in my favour, and it is these life lessons that made all the difference.

My young friends, I would like to end with some words of advice. Do you believe that your future is pre-ordained, and is already set? Or, do you believe that your future is yet to be written and that it will depend upon the sometimes fortuitous events?

Do you believe that these events can provide turning points to which you will respond with your energy and enthusiasm? Do you believe that you will learn from these events and that you will reflect on your setbacks? Do you believe that you will examine your successes with even greater care?

I hope you believe that the future will be shaped by several turning points with great learning opportunities. In fact, this is the path I have walked to much advantage.

A final word: When, one day, you have made your mark on the world, remember that, in the ultimate analysis, we are all mere temporary custodians of the wealth we generate, whether it be financial, intellectual, or emotional. The best use of all your wealth is to share it with those less fortunate.

I believe that we have all at some time eaten the fruit from trees that we did not plant. In the fullness of time, when it is our turn to give, it behooves us in turn to plant gardens that we may never eat the fruit of, which will largely benefit generations to come. I believe this is our sacred responsibility, one that I hope you will shoulder in time.

Thank you for your patience. Go forth and embrace your future with open arms, and pursue enthusiastically your own life journey of discovery!