Blogs

How backtesting and data download in AQ Jms GUI could work ..

Added by Ulrich Staudinger 305 days ago

In the gui, it is possible to script around. However, as of now, when the script is set, the script is not ran on so far received data. It is ran from the time on when the set button was pressed.

On the other hand, it is already possible to send orders from a script, to chart the pnl in realtime and also the current position. In order to reevaluate past data, any existing (configured) order routing to live accounts has to be turned off. The easiest way to achieve this, is through use of the paper broker. As of the time of this writing, the paper broker is already used as the only implementation available, by using the IBroker interfaces it is trivial to replace the PaperBroker with any other IBroker implementation.

The flow for re-feeding the received data should be like this:
a) A copy of the received data is made, data reception continues into a buffer
b) the data containers are wiped (except backup and buffer)
c) the script is set
d) every received data point from the backup is replayed into the work window
e) once the backup is replayed, the buffer is replayed into the work window

As all received data comes with a data timestamp and the scripts have to work with the data timestamps (and not System.currentMillis or similar), all data will be insync.

By enabling the PNL charts and the Position Charts, it is easily possible to see the PNL curve.

Food for thought.

On a side note, i think i'll add some sort of data mirror that always holds for example the last 5000 data points of the live market feeds in memory, of course in the AQ jms gui csv format. The mirror has to connect to the MessageQueue server and will simply record everything into memory. Upon data reception, it will check if it has, say, more than 5000 lines and will immediately throw the oldest data line away. As the data timestamps between the mirror and the live feed are of course synchronized (the mirror is really just a past data mirror), the workwindow can ignore all data points it receives that are in the data obtained from the data mirror.

Atom RSS