April 20, 2011
The TDash code can now be used in Bar-Replay, IBc/TWS interfacing will be the next phase.
To be worked on:
- In Bar-Replay you can only place one trade/bar. I don’t think it is possible to changes this.
- The Backtester doesn’t scale in/out as the TWS would. This may be solved later.
- The code has not been optimized for speed, this may be a problem for some of you. I am using TDash with a 60-day 5-Sec Local DB — so far no major problems.
- Buttons for functions yet to be implemented are grayed-out.
This is an advanced afl project. While this code can be used as is, it is intended for the experienced programmer who may just borrow some ideas, functions, or snippets of the code, to create their own trading GUI.
Sorry, I have no time to provide detailed help in using this program.
- Modify Pending orders by dragging their Markers
- Increment/Decrement price, and Cancel pending orders from the markers
- Place multiple orders to scale in/out (But Backtester code is not ready for scaling yet)
- A floating order bar (QBar) to place MKT, LMT, and STP orders
- When placing a LMT order at the wrong side of the price the order changes to a MKT. This allows you to place MKT and LMT orders without having to change type each time.
- The use of composites to log multiple trading sessions for long term Backtesting
- 3D buttons for Trigger, Toggle, and Rotate functions
- Flexibility in custom sizing all objects
- Auto-sizing of button layout
- Ability to dynamically hide/show buttons and button groups
- Use button to control indicators on the main chart
- Optional Auto-Backtests when an order is filled to create real-time tradelists and statistics
For the arrows to display properly you need to set Preferences -> Intraday -> “Time of first tick inside bar” or “START time of interval”. Be sure to select REPLAY data by setting the DATA selector in the SETUP button group to REPLAY.
The look of buttons and their layout can be changed in the Parameter window. These parameters are for experimenting, they can be hard-coded when you have decided what you want. To prevent very large buttons when you are re-sizing the TDash pane you can set their maximum height and width in the Parameter window. Button functions have arguments to place buttons groups anywhere in the window/pane.
You can change many other features, like button shape and shadow width, group header height, colors etc. You can make similar adjustments for the QBar and markers. In addition to the settings in the Parameter window the Button3D() function has size, offset, and color arguments you can change from afl. Using these functions you can create dynamically configured button panels, i.e., show/hide buttons or groups, change dimensions and color, to meet virtually any requirement.
At this time there are only three button functions: Trigger, Toggle, and Rotate. The Rotate button is used to select items from a short list. Buttons states are persistent. Grayed-out buttons are not functional yet, or are deactivated from afl because they are not required in the current button layout.
To learn more about buttons, toggle TIPS in the SETUP group to ON, and hover your cursor over the buttons. Except for MKT orders the QBar tracks your vertical cursor position. When MKT type is selected (in the ORDERS button group) the QBar position is fixed at the vertical center of the TDash window and orders will be placed at the last price. LMT@LastPrice or a STP order. For the moment the number of shares traded is set in the parameter window.
STP and LMT prices are monitored during Bar-Replay and fill when the price crosses the threshold. MKT orders will fill immediately. Bracket orders and Pattern orders haven’t been implemented yet. Pattern orders you probably haven’t heard of yet: a pattern order can contain a complex order pattern and are very handy when trading fast, it allows you to place any number of orders with a single click.
Markers for pending orders have a point to the left, a Position Marker is pointed at both ends. Order markers can be dragged; incremented, decremented, and canceled from pop-up controls that appear when you hover your cursor to the right of the marker.
Position Markers have a colored line extending onto the main chart that ends at the entry arrow. Inside the TDash window there is a small profit histogram that shows you current trade profit. If this histogram doesn’t show adjust the X-Offset for Markers to make space.
To run this code you need to apply the TDashMain104.afl to the left top window, the TDash104.afl to the right top window, and TDashInclude104 to the indicator pane below the TDash window (the include is only shown for easy access). The left bottom window can be used for other indicators. To run Auto/Manual Backtests you need to copy TDashBacktest.js to the \TDash\JS folder in your AmiBroker folder
Eventually the TDash window will be extended to the right (perhaps place or extend it on another monitor) to make room for a collection of custom gfx trading indicators.