NinjaTrader DDE


Microsoft no longer supports DDE. But the same is still widely used, and this is perticularly true when it comes to the market, where DDE is widely used to send and receive data between two applications. Since NinjaTrader is built on .Net, DDE is natively not available. But since NinjaScript is all about C# and lets one to harness the full potential of the same, we can always make something in these lines.

There is already on open source DDE library for .Net, namely NDDE, which can be used to make a DDE connection for any .Net application. I am using the NDDE library to make any DDE link. Here the sample Ninjacript will basically act as a DDE server, and will broadcast the data. What it essentially means is any other application, like say, Excel can receive the data, which we choose to send, from NinjaTrader.

Here in the sample NinjaScript one can send Bid, Ask and Last quotes. The DDE Server and Topic is same and is the symbol/instrument name. While the DDE Item is Ask, Bid or Last as the case may be.  But one can always customized the names and the data one wish to send by editing the NinjaDDE dll and the DDE NinjaScript.

How to install:

1. Download the DDE NinjaScript by clicking the Download Now button.

2. Import the DDE.zip file to NinjaTrader. In NinjaTrader goto Files > Utilities > Import NinjaScript... and follow the procedure.

3. Open any chart, say ES and then apply the indicator "DDE".

4. Open any client application, say Excel to receive the data. The sample NinjaScript allows you to receive Last, Ask and Bid prices. In Excel (our client application) type in
=ES|ES!Last
in cell A1
=ES|ES!Bid
in cell A2
=ES|ES!Ask
in cell A3
You can choose any three cells as per your choise. This will fetch the Last Traded Price, Bid and Ask for ES to Excel. If you are using any other symbol then use that symbol/instrument name in place of ES. The basic DDE formula is =<symbol/instrumnet name>|<symbol/instrument name>!Last/Bid/Ask


Download Now


Download the NinjaDDE.dll source

Plese do keep in mind this is a very experimental type of stuff and therefore do take care.

Do consider a small donation if you find the same useful :)



List of donors

Known errors:
The connection is lost if the periodicity of the chart is changed. To reconnect one has to restart the client application.

Disclaimer:
USE THIS NINJASCRIPT ENTIRELY AT YOUR OWN RISK. YOU (THE USER) ARE SOLELY RESPONSIBLE FOR ANY DAMAGES, WHATSOEVER, WHICH MAY ARISE DUE TO THE USE OF THIS NINJASCRIPT.