This is a trading object shared by a member. You can use this object as well as hundreds of others with QuantShare - Trading Software.
Click on the Like button or on one of the share buttons to share this object and spread the word about QuantShare.
QuantShare is an advanced trading software for stock, forex, futures, ETF and options markets. It is the best and the most complete EOD trading software software and it is FREE (beta version).
It reads the symbol events and searches for the events that have the same name as the 'eventname' parameter value. It then calculates the difference between the event actual value and the event forecasted value. A time-series of the differences is then displayed. The difference is positive when the actual value is higher than the forecasted value; otherwise, the difference is negative.
Here is an example: (The following downloader - Currency Pairs Calendar Data - was used)
a = eco_surprise('audusd', 'Consumer Confidence');
Plot(a,'Consumer Confidence',colorBlack,ChartBar,StyleSymbolNone);
Plot(0,'Zero line',colorBlack,ChartLine,StyleSymbolNone);
The first line assigns the current function to the variable 'a'. The first function parameter is 'audusd' with is the symbol of the Australian Dollar / U.S. Dollar forex pair. The second function parameter is 'Consumer Confidence', which is the name of an event.
Variable 'a' will contain the surprise values or the difference between the 'Consumer Confidence' event actual and forecasted values for the bars where the event was released. The first 'plot' displays the surprise time-series, and the second one displays the zero line.
If you want to plot a surprise time-series for the current symbol (the one that is used by the chart or the analyzer), you can change the first parameter of the 'eco_surprise' function to the following function: Name()
a = eco_surprise(Name(), 'Consumer Confidence');