With the significant growth of social media, individuals and organizations are increasingly using public opinion in these media to make their own decisions. The purpose of sentiment analysis is to automatically extract people's sentiments from those social networks. Social networks related to financial markets, including stock markets, have recently attracted the attention of many individuals and organizations. people in these networks share their opinions and ideas about each share in the form of a post or tweet. In fact, sentiment analysis in this field is the assessment of people's attitude towards each share. There are different approaches in sentiment analysis, in this article, a hybrid approach is proposed for sentiment analysis. In this way the feature vector used in machine learning is obtained from a lexicon that is automatically extracted from user's tweets. This lexicon is made by using stock price information related to user's opinion. Also, by using the next day's price information of each share, amendments were suggested to this lexicon. Therefore, the lexicon generated for the feature vector was constructed in three ways, and all three methods reported about an 8% improvement over the baseline method in terms of Fscore. The baseline method that is considered for this work, is the Persian version of SentiStrength lexicon which is designed for general purpose.