Click here to Login




3 Items To Get and Trade the News In QuantShare Platform

Updated on 2014-11-20





Within QuantShare, you can download news, displays them on a chart and even create composites and trading systems based on news data. In this article, I will show you first how to download news data, then how to trade and create charts based on these news.




Here are three trading items you can use in QuantShare to download news data for U.S. stocks.

Google News

Using this downloader, you will get news data for almost every listed U.S. stock. The data is available in RSS format. It is parsed and added automatically to a custom database "google_news".
The database contains the following fields (Date, Title and Description)

Example of RSS Link:
https://www.google.com/finance/company_news?num=1000&output=rss&q=A

106 News items are available here for Agilent.

Example of one News Item:
Date: 04/11/2014 22:35:51
Title: One Reason Agilent Technologies (A) Stock Closed Down Today
Description: One Reason Agilent Technologies (A) Stock Closed Down Today
TheStreet.com - Nov 4, 2014

Well Fargo said it lowered the measurement company's rating...

You can get trading news data from Google by using the following item:
https://www.quantshare.com/item-924-historical-stock-market-news


Yahoo News

This item gets news data for U.S. stocks from the RSS feed provided by Yahoo Finance.
This item creates a custom database (yahoo_news) with the following fields (Date, Title, Category).
Unlike the Google news downloader, this item gets news data only for recent days.

Example of RSS Link:
https://finance.yahoo.com/rss/headline?s=A

20 News items are available here for Agilent.

Example of one News item:
Date: 06/11/2014 16:47:10
Title: Agilent Technologies Advances FTIR Microscopy Imaging
Category: [at noodls] - Hardware, Software Enhancements Bring Power of Synchrotron to Lab Bench SANTA CLARA, Calif., Nov. 6, 2014 Agilent Technologies Inc. (NYSE: A) today introduced significant enhancements to its Cary 610 and ...

You can get trading news data from Yahoo by using the following item:
https://www.quantshare.com/item-88-yahoo-news


Stocktwits

In case you want to download tweets for your favorite stocks, we have a downloader item for that as well.

Using this item, you can get the 30 most recent tweets stored in a custom database "stocktwits" with the following fields:

Title: The tweet message
Account: The name of the user that created that tweet.

Example of one tweet:
Title: $AA Do any of you savvy AA followers have thoughts about a possible share buyback or div increase next year?
Account: ToesInSand


Display Trading News

You can displays news data for every active stock just by selecting "Tools -> Database Data"
Once the new form appears, select the appropriate database then make sure that "Filters" (at the bottom) is set to "Selected Chart".

You can choose which columns to display by click on "Column Settings" at the bottom.




Show News on a Chart

Using the same control, click on "Show data on chart" at the bottom. This will automatically display news data for the active/selected chart. You can of course customize the display by clicking on "Settings -> Edit Settings" at the bottom.

Note that grid rows can have different colors. For example: recent news (less than 5 minutes) is colored differently that a news that is 2 hours older. Again, settings can be updated by clicking on the same button below ("Settings -> Edit Settings").




Trade the News

QuantShare makes it easy to access quantitative and non quantitative data. It also makes it easy to transform non-numeric data into a quantifiable form.

Here are few functions you can use for that:

GetDataCount:

This built-in function allows you to count the number of occurrences of a specific field.
Example: Count the number of news items
a = GetDataCount('yahoo_news', 'title');

Example: Count the number of news items for a specific symbol
a = GetDataCount('yahoo_news', 'title', 'AAPL');

GetDataStringCount:

This is also a built-in function and it calculates the number of occurrences of a specific field that contains a defined word

Example: Count the number of news items that contains the word "buy"
a = GetDataStringCount('yahoo_news', 'title', 'buy');


GetDataCountInside:

This function counts the number of occurrences that occurred between a specific period

Example: Count the number of news items that occurred between 12h and 13h
a = GetDataCountInside('yahoo_news', 'title', 12, 13, P_Hour);


ContainsWords: (You can download this function here: News parser function)

This function allows you to specify several words and it would return 1 or TRUE on bars where a custom field contains one of these words.
a = ContainsWords('yahoo_news', 'title', 'Buy,Jump,Big,Rise,Increase,Good,Excellent,Great');


GetField: (You can download it here: Word Occurrence in News Titles - Quantitative Trading Analysis)

If you want to optimize your strategy based on a list of words then this function will come in handy.
Check the item description for a detailed example on how to use this function

News_sentiment: (You can download it here: News Sentiment Indicator)

By providing a list of positive and a list of negative words, this function can count the number of titles that contains the positive words and subtract it to the number of titles that contains the negative words, thus providing you with a sort of basic sentiment analysis.

Example:
a = news_sentiment('yahoo_news', 'title', 'buy,good,better,bull', 'sell,bad,lower,bear');

For advanced sentiment analysis, you can use the Alchemy API as described in this blog post:
Sentiment Analysis: How to measure the sentiment score of your stock tweets

A very simple trading system that trade news would be to enter long if a stock has 3 times more news that the average of the past 25 trading bars:
a = GetDataCount('yahoo_news', 'title');
buy = a > 3 * sma(a, 25);



Other related blog posts:

Download quotes, news, sentiment, fundamental... data using QuantShare
How to create buy and sell trading rules based on News Data
How to create a trading indicator that uses stock news
How to speed up quotes and news downloads












2 comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1467 days ago

Profile Graphs
Posted 1572 days ago

QuantShare
Previous Posts

More Posts

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.