Wednesday, January 30, 2008

When to use HashMap

Assume we do have a application scope HashMap. The key is the userId and the value would be some user information object.

This HashMap is a application level shared variable. Also this is a web application.

Users can access the hashMap delete the entries and add the entries.

But it is guranteed that no two users would address the same location(key) of the hashMap. reason is those two users has two keys and they are not the same.

At the same time if we make this object a HashTable then when one user modifies it other users has to wait (Syncronization handled implicitly). Which might lead to purformance issues.

Do u think it is good to use a HashMap in this scenario?

Tips for Trading Strategy

It's almost difficult to trade these days as there is no indication that how the market will behave in next moment, but there is a good chance to make money, How? Welll, it's something like if you want to gain any thing in this volatile market you need to take risk, or I can say a heavy risk.

Who can trade these days?

Not everybody can trade in this market. This type of market is only suitable for intraday trader or derivative. But, I won't recommend any derivative product for a long time(more then 3 days), so I can say market is for intraday trader only, until unless market get some stability.

Now what strategy intraday trader has to follow:

Well, again there is no hard and fast rule which I can fix for interaday trader.But, you can plan strategy :
1. If you are buying any share I assume you look something on that share now wen to sell:
A) Place order for sell around 1% profit from the buying position (.1% will go as a brokerage and 0.9% will be your profit). Now, suppose target didn't reached withnin an hour and if it is now below your buying level then wait for some time till it will again come up and now modify the order at less price (0.6%) for 50% shares. If it executed and gone more then 1% follow stop loss by taking 0.2%.

Stay tuned for new Tips.............. :)