NinjaTrader DDE

Discussion in 'NinjaTrader' started by wj2000, Aug 2, 2011.


    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 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 the NinjaDDE.dll source:

    这个NinjaTrader DDE 其实已经为国内那些通视数据源打开的连接,好像有个通视toDDE的服务器软件的。
  2. 可以借鉴一下将ctp,通达信等通过dll直接连接到NinjaTrader
  3. 版主好,能给个DDE文件吗?
  4. 这是ninjatrader通过dde往外发数据,并没有通过dde接收数据的