#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

## Word Occurrence in News Titles - Quantitative Trading Analysis

by The trader, 2056 days ago

"GetField" is a function that gets a word among a list of words given an index provided as parameter to the function.
The function is mainly used in quantitative trading to optimize News driven trading systems and it works as follows:

// Basic Quantitative System Example

Optimize("i", 0, 7, 1);

This example uses a custom function "ContainsWords" (News parser function).
When optimizing a trading system, the variable "i" will vary from 0 to 7 (There are eight words to analyze). Each time, the "GetField" function returns a different value to variable "a".
If i=0 then "a" will be equal to "buy"
If i=1 then "a" will be equal to "sell"
This function gets a list of words separated by semicolons and then uses the index parameter to return the appropriate word.

The last buy rule consists of analyzing each stock news data and then returning a signal if the word assigned to the variable "a" is found.
In summary, the above strategy buys a stock each time a news title contains a specific word (buy,sell,up,down...)

This is it for the basic example. More advanced quantitative research and analysis can be performed using the "GetField" and "ContainsWords" functions. For example, you can instruct your trading system to generate signals when a combination of words is found.

A quick code sample:

Optimize("i1", 0, 7, 1);
Optimize("i2", 0, 7, 1);
buy = ContainsWords("yahoo_news", "title", a1) and ContainsWords("yahoo_news", "title", a2);

Both examples I presented here use news data from Yahoo. This data can be downloaded using the following trading item: Yahoo News.

What is this?

 Type: Trading Indicator Object ID: 981 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

 Random Blog Posts Select the best ETFs combination to maximize your return and reduce your investment risk How to turn any ordinary trading strategy into a very profitable one Charting & Scripts - Manage stock charts using the global script Trading System: Buy Stocks based on their Sharpe Ratio Rank Creating and managing notes for your stocks Create a Trading Strategy using Portfolio123 Ranking Systems How to Quickly Create Fundamental Scans Download Trading Data using the Post-Script Show All

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object