First of all ,
before purchasing a share one should analyse either fundamentals
or technicals or both of that particular share.We should be satisfied that it would go up ( whether it goes up or not is a different issue ).We should analyse and purchase and again analyse it at its every stage.Unless one does his homework he will lose his capital.
selling a share is at one's discretion.Most of us want to exit at profits or atleast at costs.so purchasing price+brokerege+tax=cost.
For fixing targets there are many methods available in Fundamental and technical.
Better go through Beginner section
Happy trading.