Correlate Active Orders with Portfolio entries

Posted by Funfinite 
Correlate Active Orders with Portfolio entries
September 04, 2009 03:27AM
For trading on market ups and downs, I like to have a bunch of active orders in place ready for when the market shifts. I have quite a few stocks I'm following at the moment so I have a lot of active orders. For me, there are two major problems with the current UI:

- I can't easily see which stocks in my portfolio have corresponding active orders. The 'Owned' / 'Shorted' lists don't show which stocks have matching orders, and the 'Active orders list' does not show which orders are for stocks I already own and which are 'new'.

- The 'Active Orders' list is split over multiple pages, so I can't even easily compare the two lists on one page.

I would like:

- Please please could you get rid of the multiple page split? Just show them all. If I couldn't cope with seeing that many orders, I wouldn't have placed them all.

- Please add something to make it easier to see which orders correspond to stocks already held in the portfolio.

My preference would be for each line in the 'Owned' / 'Shorted' lists to show a small icon with four variants to distinguish the possibilities: 'has buy order', 'has sell order', 'has both buy and sell orders', and 'has no orders'. If you can fit quantities in there as well, that would be useful, but the icon would be enough.

A similar icon should be shown in each line of 'Active orders' distinguishing 'portfolio has long position', 'portfolio has short position', 'portfolio has no position'.

Assuming the page is being generated as one unit, then this shouldn't even need any extra data to be retrieved - the info is already loaded for the two lists, it just needs correlating.

I think this feature might even improve market liquidity - by making it easier for people to track many orders, it would encourage more people to place limit orders.



Edited 1 time(s). Last edit at 09/04/2009 03:28AM by Funfinite.
Re: Correlate Active Orders with Portfolio entries
September 04, 2009 06:14AM
Great feedback Funfinite, let me run this past the dev guys and come back to you.
Re: Correlate Active Orders with Portfolio entries
September 04, 2009 06:38PM
OK, I got inspired by this and had a go at creating a script using Greasemonkey to do roughly what I describe in my earlier post.

(For anyone unfamiliar with it, Greasemonkey is a Firefox plugin which lets you define bits of javascript to customize pages, based on the URL.)

Instructions and more details are here. Use at your own risk, and it may break when the site changes, but the worst it should be able to do is cause a javascript error. Feel free to modify it.

Admin: hopefully this sort of thing is OK under the terms and conditions? It doesn't make any requests to the server, it just uses the text information already in the HTML page and manipulates the HTML with javascript, so it's not really doing anything the browser isn't already doing. Let me know if it's a problem.
Re: Correlate Active Orders with Portfolio entries
December 01, 2009 04:29AM
@Funfinite

Your script has a small bug, if there are no entries in the watchlist it fails. Below is a minimal patch.

Edit: The smilies seem to be being replaced in the code block, but you can see what needs to be done there anyway.


--- memorius-ipredict-portfolio-greasemonkey-b65ad4b/ipredict-portfolio.js	2009-11-11 04:52:48.000000000 +1300
+++ patched-ipredict-portfolio.js	2009-12-01 17:26:02.000000000 +1300
@@ -308,11 +308,11 @@
     var watchListTable     = findTable("watch-list"winking smiley;
 
     var activeOrdersBodyRows = getBodyRows(activeOrdersTable);
     var stockIOwnBodyRows    = getBodyRows(stockIOwnTable);
     var shortedStockBodyRows = getBodyRows(shortedStockTable);
-    var watchListBodyRows    = getBodyRows(watchListTable);
+    var watchListBodyRows    = watchListTable ? getBodyRows(watchListTable) : [ ];
 
     var holdings    = [];
     var activeSellOrders = [];
     var activeBuyOrders = [];
 
@@ -416,11 +416,12 @@
             addHoldingsColumn(tr, 2, stockName, holdings, "Short"winking smiley;
             addHoldingsAverageCostColumn(tr, 3, stockName, holdings);
             addNotesColumn(tr, 11, noteKey);
         }
     }
-
+    if(watchListTable)
+    {
     // Add columns to the Watch List table showing holdings and orders
     addHeaderColumn(watchListTable, 1, "Long",      "align-right"winking smiley;
     addHeaderColumn(watchListTable, 2, "Short",     "align-right"winking smiley;
     addHeaderColumn(watchListTable, 3, "Avg. Cost", "align-center"winking smiley;
     addHeaderColumn(watchListTable, 4, "Buy",       "align-right"winking smiley;
@@ -438,10 +439,11 @@
             addOrdersColumn(tr, 4, stockName, activeBuyOrders, holdings);
             addOrdersColumn(tr, 5, stockName, activeSellOrders, holdings);
             addNotesColumn(tr, 10, noteKey);
         }
     }
+    }
 
     // Ensures that old notes (for cleared positions / deleted orders or watches)
     // don't reappear with misleading values if a new position / order or watch
     // is recreated
     removeUnusedNotes(noteKeysPresentOnScreen);



Edited 2 time(s). Last edit at 12/01/2009 04:30AM by sleemanj.
Re: Correlate Active Orders with Portfolio entries
December 01, 2009 04:38AM
Smileys in a code block - at least it makes the code hilariously more interesting to read! cool smiley
Sorry, only registered users may post in this forum.

Click here to login