This news indicator was written by Jason Wright and Rich Tobey and should not be shared outside of Big Mike's Elite Circle.
Some portions of the code that pull data from Forex Factory were adapted/refactored from the EcoNewsIndicator released on the ninjatrader support forum. It was written by TradingStudies.com which can be reached at info@trading (Studies.com.
Indicator Description:
The indicator reads news back from the beginning of 2007 from a database and changes the background color to red, orange, or yellow. The news DB is stored locally and updated from forexfactory.com. I'm using task scheduler to trigger a programmed called UpdateNews once per week.
This indicator makes the news events available to strategies on a current and historical basis.
The indicator has the following configurations.
1) Sound alert or or off, 2) Configure Forex Pairs to include in display, 3) Configure News Impact by High, Medium, and Low.
Note: I've not shared this code because install is a bit difficult. But the forum has been such a help to me, I thought I needed to give back. Others helping with install questions would be much appreciated. Let's get some feedback here, perhaps improve it a bit and then we can post it in elite downloads.
SQL Management Studio:
Download details: Microsoft SQL Server 2008 Management Studio Express (
Microsoft .net which you should already have because you are running NinjaTrader.
A copy of a historical database of news events which is included with this distribution and includes news up through 12/3/2010.
Visual Studio 2008.
The news indicator which is included.
The news updater program called "UpdateNews" which is also included.
Installation:
Step 1: Install SQL Express 2008 R2 (Any version will work from SQL 2005)
Step 2: Install SQL Management Studio
Step 3: Copy System.Data.dll into C:\Users\[Your User Name]\Documents\NinjaTrader 7\bin\Custom from
C:\Windows\Microsoft.NET\Framework\v2.0.50727
Step 4: Login to SQL Management Studio and create a DB called TradeDB.
Step 5: Stop the SQL DB service and copy TradeDB and TradeDB_Log on top of the DB you just created with the same name.
It probably exists at: C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data
Step 6: Restart the SQL Service
Step 7: From SQL Management studio, give the db access rights to the currently logged-in user.
Note: You should be able to test that the DB works by runing a query against one of the tables.
Step 8: Open any customer indicator and add a reference to System.Data.dll (Right click in the code editor)
Step 9: Import the NewsPlot Indicator into NinjaTrader 7.
Step 10: Open the NewsPlot indicator and add a reference to System.Data.dll (Right click in the code editor)
Step 11: Recompile the code.
Step 12: Open the LoadNews VS2008 Solution from the LoadNewsProject directory.
Step 13: Compile the code and run LoadNews.
Step 14: Setup LoadNews.exe to run from the task scheduler once per week (or per day if you want, only once per week is necessary).
If you have a problem it probably has to do with the DB access rights which are configurable from with SQL Management Studio for the database.
LoadNews.exe and NewsPlot.cs each has a configuration with a db connect string which is set to connect to the local computer with the logged in users credentials. It can also be modified.
If you'd like a later copy of the DB news events that I maintain, email me at [email protected] and I'll send you what I have at that time.
Here is some code snippets that I use to wire this into my strategies:
In Variables:
NewsPlot news;
private bool longCondition5_news;
In Initialize:
Add(NewsPlot(false, NewsEvent.High, 15, "EUR,USD,GBP,AUD")); //for visualization only
In OnBarUpdate:
news = NewsPlot(false, NewsEvent.High, 10 ,"USD,EUR,GBP,AUD");
// Condition set 5 - check to see if news is about to happen
SetlongCondition5_News();
protected …