{"id":2328,"date":"2011-03-06T15:04:25","date_gmt":"2011-03-06T15:04:25","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/?p=2328"},"modified":"2011-04-08T10:31:38","modified_gmt":"2011-04-08T10:31:38","slug":"draft-introducing-order-markers","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2011\/03\/06\/draft-introducing-order-markers\/","title":{"rendered":"Introducing Order Markers"},"content":{"rendered":"
In the previous post I developed a method to link prices between the TDash window and the Main Chart window. In this post I show how I used this technique to develop “Order Markers” that can be used to modify orders, display order status, and cancel orders. <\/p>\n
In the final TDash Order Markers will be created automatically whenever an order is found Pending. The initial orders will be placed with another tool (the QBar) that will be covered in a subsequent post.<\/p>\n
To test the Order markers you need to create two side-by-side windows in AmiBroker. If you use multiple monitors you can place the Main Chart at the right side of the left monitor, and TDash on left side of the right monitor. This will work fine and gives you a lot of space to work with. However, depending on the monitor sizes and their horizontal positions, the Markers may not appear perfectly at the same height from your desk, however the prices shown and plotted will be accurate.<\/p>\n
To install the programs, first open and copy this TDashInclude.afl<\/a> include file (not listed below due to its size) to the AmiBroker default Include folder. The TDashInclude.afl file is a development version and contains a lot of code that you don’t need at this time – please ignore the unused functions. The include will be cleaned up when the functions all work as they should. Next Apply MainMarkers.afl<\/a> (listed below) to the main chart at the left, and Apply TDashMarkers.afl<\/a> (listed below) to the TDash window at the right. <\/p>\n The demo code presented here creates three Order Markers, each can be moved by dragging it to a new price level. At start-up the Order markers will be parked at the top of the TDash window, just click on them to activate them. Remember that in the final TDash inactive Order Markers will not show, only Order Markers for Pending orders will show.<\/p>\n The price line and value displayed on the main chart will track the Order Marker, and the Order Markers will track a changing Y-axis on the Main chart. To allow setting an exact price Increment (+) and Decrement (-) controls are provided on the Marker. To cancel the order click the Cancel control (X). In this test cancel will only gray-out the marker and park it at the top of the TDash window, in the final program a canceled Marker will disappear after the cancellation has been confirmed.<\/p>\n It should look and work as shown in this video below.<\/p>\n