Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
desktop:desktop_dde [2021/12/21 17:57] – [Getting Data Into Excel] rob | desktop:desktop_dde [2023/09/21 19:58] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 59: | Line 59: | ||
< | < | ||
+ | |||
+ | < | ||
+ | ^ Value ^ Meaning ^ | ||
+ | | Description | ||
+ | | Account | ||
+ | | Firm | The firm this account belongs to. | | ||
+ | | Status | ||
+ | | PL | The total P&L of all the positions for this account | ||
+ | | UPL | The total unrealized P&L of all the positions for this account. | ||
+ | | RPL | The total realized P&L of all the positions for this account. | ||
+ | | Overnight_UPL | ||
+ | | Cash | The amount of available cash the account has available to trade with. Takes into consideration the Balance, P&L and Margin. | ||
+ | | Net_Equity | ||
+ | | Margin | ||
+ | | Balance | ||
+ | </ | ||
+ | |||
+ | The DDE link format for position data in Excel is: | ||
+ | |||
+ | =T4Screen|' | ||
+ | |||
+ | Where: | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
< | < | ||
^ Column A ^ Column B ^ | ^ Column A ^ Column B ^ | ||
- | | Row A1 | Row B1 | | + | | Description| The name of the market this position is for. |
- | | Row A2 | Row B2 | | + | | Net |
- | | Row A2 | Row B2 | | + | | PL | The total P&L of this position. |
- | | Row A1 | Row B1 | | + | | UPL | The unrealized P&L from the open position. |
- | | Row A2 | Row B2 | | + | | RPL | The realized P&L from the closed position. |
- | | Row A2 | Row B2 | | + | | Overnight_UPL |
- | | Row A1 | Row B1 | | + | | Margin |
- | | Row A2 | Row B2 | | + | | Buys | The total number of contracts bought. |
- | | Row A2 | Row B2 | | + | | Sells | The total number of contracts sold. |
- | | Row A1 | Row B1 | | + | | Working_Buys |
- | | Row A2 | Row B2 | | + | | Working_Sells |
- | | Row A2 | Row B2 | | + | |
</ | </ | ||
+ | |||
====== DDE Commands ====== | ====== DDE Commands ====== | ||
+ | You can control some aspects of the T4 frontend via DDE commands. These are aimed at people programming applications within Excel that interact with T4. | ||
+ | |||
+ | ====== Opening a Contract Window====== | ||
+ | You can cause T4 to activate or open a Contract window with a specific market displayed. To do this you need to enter the following in a cell: | ||
+ | |||
+ | =T4Screen|' | ||
+ | |||
+ | where < | ||
+ | |||
+ | e.g. =T4Screen|' | ||
+ | |||
+ | Sending this command will cause the frontend to look for the most recently used Contract window for that Contract and bring it on top of any other application, | ||
+ | |||
+ | If you wish to repeatedly display the same market (e.g. user clicks a cell to display the contract window, then closes the contract window and clicks the cell again) then you need to replace the above cell contents with: | ||
+ | |||
+ | =T4Screen|' | ||
+ | |||
+ | where < | ||
+ | |||
+ | This clears out the last command processed and will allow the previous command to be sent again as a new command. | ||
+ | |||
+ | If the command succeeds then the value '< | ||
+ | ====== Changing the DDE Advertise Interval ====== | ||
+ | |||
+ | You can change the timer interval that DDE advertisements are sent on. An advertisement is sent when a piece of data you are interested in has changed, e.g. last trade price. This is set at 10ms by default. If you want to slow down the updates then you can change this to be anything up to 60,000ms. | ||
+ | |||
+ | To change the timer you need to enter the following into a cell: | ||
+ | |||
+ | =T4Screen|' | ||
+ | |||
+ | where < | ||
+ | |||
+ | e.g. =T4Screen|' | ||
+ | |||
+ | If the command succeeds then the value '< | ||
+ | |||
+ | If you close T4 desktop and reopen it then you would need to execute this command again for it to take effect. | ||
+ | |||
+ | |||
====== Breaking DDE Links ====== | ====== Breaking DDE Links ====== | ||
+ | Excel will allow a user to manually edit excel links. This provides the opportunity for end user error in the form of a typo as Excel DDE links are case sensitive. If a typo occurs the user will have no choice but to remove the broken link and create it correctly from scratch. This is a limitation in Excel. | ||
+ | |||
+ | An example would be if the month is changed using lower case charactors. Excel won't allow the correction of the formula and the formula will never again work. | ||
+ | |||
+ | In Excel 2010 go to the Data tab and click Edit Links. | ||
+ | |||
+ | A dialog will be displayed. | ||
+ | |||
+ | Find the broken link and click "Break Link" and close the dialog. | ||
+ | |||
+ | Use T4 to generate the correct link so that there is no chance of a typo. | ||
+ | |||
+ | {{: | ||