This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
This is a function that could be used with a database that contains text data (for example a news database). The function accepts as arguments, the database name, the field name, a positive list of words and a negative list of words.
These lists of words are simply words separated by comma. (word1, word2, word3...). The idea is to calculate an indicator that tries to measure the news sentiment. If a positive word is found in a news title, then the indicator will add a value of one in this news bar and if a negative word is found, then a value of one will be subtracted.
Here is an example:
news_sentiment('yahoo_news', 'title', 'buy,good,better,bull', 'sell,bad,lower,bear');
For each bar, each time the indicator finds one of the following words: buy, good, better, bull, it adds one to the current bar result, and each time it finds one of the following words: sell, bad, lower, bear, it subtracts one to the current bar result. It finally returns the indicator time-series.