Introduction:
DDE stands for Dynamic Data Exchange. It is an older messaging format which enables communication between certain applications. In the context of Swordfish, DDE is mostly used to communicate between Swordfish and technical analysis software such as MetaStock and TradeStation or with spreadsheet software such as Microsoft Excel and Apache OpenOffice.
DDE (Dynamic Data Exchange) by default is not enabled in Swordfish. This section explains how to enable DDE.
Method
•On Swordfish menu click on Tools > Environment Options from the pop-up menu. •On the General tab of the Environment Options window tick the box adjacent to Enable DDE. |
Once DDE is enabled in Swordfish it is possible to link certain Swordfish information to other applications.
Method
•DDE formulas consist of 3 parts - the server, the topic and the item. When DDE linking from Swordfish, this formula should be constructed as shown in the table below:
•The following table lists Swordfish DDE item codes:
•Programs that support DDE will always require the three parts of the DDE formula: the DDE server name, the topic and the item. Using the information above you can populate these fields.
•To DDE link from Swordfish to Microsoft Excel, the entire server-topic-item formula is placed into the cell in a special format. For example to have an Excel cell linked to the last price of DEC07 WMAZ the formula would look like this:
=ESOTS|'DEC07 WMAZ'!LASTP
•To DDE link from from Swordfish to Apache OpenOffice the formula example would look like this:
=DDE("ESOTS";"NOV14 WMAZ1500.000P";"BIDQ") |
This section explains how to create a sample DDE-linked Excel spreadsheet from an Swordfish watchlist.
Method
•First, make sure DDE is enabled in Swordfish. Next, right-click the mouse pointer on the desired instrument on a watchlist:
•From the pop-up menu, select Export > CSV > MS Excel DDE Links.
•Open MS Excel.
•From within MS Excel open the file located at My Documents\Estuary\Data\Export\CSV\CSV_DDE.
•There should be a file in this folder called CSV_DDE.CSV. Double-click on the file to open it.
•The spreadsheet will open and the fields will be DDE-linked to Swordfish watchlist they were exported from. This is a simple way to create DDE links and to see the correct format of the links. By highlighting any cell in the sheet it is possible to see the DDE formula.
Note
1.While the CSV_DDE.CSV file is open in Excel, do not attempt to perform an export. To perform exports of multiple windows you should open the CSV_DDE.CSV file and rename it and save it for each window you wish to export. Swordfish DDE export uses only the CSV_DDE.CSV file to perform its exports and it cannot do an export if the file is currently open. |
Multicharts: 1. In Swordfish – Environment Options – General – Enable DDE 2. Swordfish – Watchlist – Export – CSV – DDE Links 3. Optional Step: You may check that Swordfish is exporting correctly, by opening the CSV_DDE.CSV file, located in your documents\Estuary\Data\Export\CSV folder. This will also give you an idea of what the field names are, that can be imported into Multicharts. * Note: Newer versions of Excel may open the CSV file incorrectly. If the DDE formulas are not in separate cells, make sure to import the csv file properly: In Excel - Data - From Text - CSV_DDE.CSV - "Delimited" - Next - Comma Only - Finish. 4. In Multicharts: File – New – QuoteManager Window 5. In QuoteManager – Tools – Data Sources – Select the Dynamic Data Exchange, under settings fill in DDE links as required. (You can also rename the datasource to Swordfish for identification using the edit). 6. Test that the import works <- At this step I had a problem importing their “Trade”, as I’m exporting JSEQU from the Swordfish simulator. In the simulator, the JSEQU shows 0 as all the volumes exported, and multicharts doesn’t like the 0 values. That is why I opted not to import the volumes (by just leaving the field blank). 7. In QuoteManager – Instrument – Add Symbol – Manually 8. Select the data source used in step 5, fill in the instrument under symbol, select category and exchange. 9. In QuoteManager – In the tree view on the left, go to the symbols added in step 8. Select them all, right click and select “Connect Symbol”. 10. Close all Multichart & Quotemanager programs. When starting Multichart again, select the "Online" option. To test that it is working, in Multicharts - File – New - Create Window – Select the appropriate data source and instrument. FCharts: 1. In Swordfish – Environment Options – General – Enable DDE 2. Swordfish – Watchlist – Export – CSV – DDE Links 3. Optional Step: You may check that Swordfish is exporting correctly, by opening the CSV_DDE.CSV file, located in your documents\Estuary\Data\Export\CSV folder. This will also give you an idea of what the field names are, that can be imported into FCharts. * Note: Newer versions of Excel may open the CSV file incorrectly. If the DDE formulas are not in separate cells, make sure to import the csv file properly: In Excel - Data - From Text - CSV_DDE.CSV - "Delimited" - Next - Comma Only - Finish. 4. In FCharts – Import Export – Other – Import Tickers by file, or just paste them into the textbox and click “Add Multiple Tickers”. (FChart Tickers are Swordfish Indicators) 5. FCharts – Settings – Watchlist/index setup. Select watchlist 20, and add the Tickers to the watchlist. (This is needed so that FCharts knows what Instruments should be requested from the DDE Link) 6. Intraday – DDE Link – Source ESOTS, C – LASTP, V – VOL. 7. Select the Source|Command!Ticker option, and make sure Command, Prefix & Suffix boxes are blank. 8. Reselect the Source|Ticker!Command option 9. Start To test that it is working, select “Intra-day charts” in the combobox at the top right of FCharts. AmiBroker: 1. In Swordfish – Environment Options – General – Enable DDE 2. Swordfish – Watchlist – Export – CSV – DDE Links 3. Optional Step: You may check that Swordfish is exporting correctly, by opening the CSV_DDE.CSV file, located in your documents\Estuary\Data\Export\CSV folder. This will also give you an idea of what the field names are, that can be imported into AmiBroker. * Note: Newer versions of Excel may open the CSV file incorrectly. If the DDE formulas are not in separate cells, make sure to import the csv file properly: In Excel - Data - From Text - CSV_DDE.CSV - "Delimited" - Next - Comma Only - Finish. 4. In AmiBroker - There is a text field for the symbols in the top toolbar next to the Quote Editor button. Type the desired indicator into this text field, and press enter. 5. In AmiBroker - File - Database Settings - Data Source - DDE Universal data Plugin - Configure 5.1. DDE Server = ESOTS 5.2. Most formulas can remain as is {ticker}!{field}, but some need to be changed, e.g. last should become {ticker}!LASTP 6. At the bottom of the AmiBroker screen, in the status bar to the right there is a connection status indicator. It can be red or yellow (not working), or green (DDE link has been established). If the indicator is not green, right click on it, and choose "Reconnect". * Note: There may be an incompatibility between Swordfish and AmiBroker, affecting indicators that has spaces in. It was not possible to import indicators that had spaces in the name into AmiBroker through DDE. e.g. 'DEC12 ALSI' in previous versions of AmiBroker. The demo version of AmiBroker updates once every minute, so after one minute the ticker data should be flowing in.
|
©Estuary Solutions (www.estuarysolutions.com), All rights reserved.