mercredi 27 août 2014

TableManager updates delayed

I am currently rebuilding my App using TableManagers (I use the latest build in Java on OS X). When opening positions I regularly experience a very long delay until the tables are refreshed and added the newly opened trade(s).

I created a strategy that just buys a position on a new tick and that is only allowed to open one position at a time. I use a simple boolean flag for checking this. I build the onAdded method of my TableListener such that it notifies the strategy when a new trade row is added so that the boolean is set. Additionally a timer is started that checks for an open position of the strategy every 10 seconds. I also implemented similar mechanisms for a closing trade.

Now the thing is that it takes up to 2 minutes or more for the trade tables to refresh sometimes. In this time the strategy happily opens one trade after the other. And then all in a sudden all trades are added to the TableManager. Closing trades on the other hand are somehow added instantaneously. This fact together with my observation inside the FXCM Trading Station Web (where all trades are added and delete as it should be) make it obvious that this is not an issue with my internet connection. It doesn't matter if I use the onAdded method of my TableListener or if I'm manually checking my TradesTable. The TableManager says TABLES_LOADED and the TradesTable REFRESHED.



Any suggestions on how to get it working properly?




Aucun commentaire:

Enregistrer un commentaire