XML Reader for JArbitrager

17 views
Skip to first unread message

Alexana

unread,
Oct 4, 2010, 12:28:31 PM10/4/10
to JArbitrager
I have uploaded several files:
***********************************************
ReadTradeList.java file is a class, which reads and parses external
XML file which contains information about instruments to be traded,
trading schedule (including exclusions), and trading parameters. The
class uses a very fast and memory efficient StOX methods.
************************************************
Arbitrage.java is a strategy class, which takes the data read from the
XML file by the ReadTradeList class and launches the trading strategy.
It allows externally passed entry parameter. If such parameter is not
in the XML file, then JArbitrafger's default methodology is used.
*************************************************
TradeList.xml is a sample XML file, which contains the trading
information.
*************************************************
StrategyInformationDialog.java contains a minor correction, which
permits display of the exclusion time period, if one is set in the XML
file.

**************************************************
Since XML file is just a text file, which can be edited and saved from
Notepad, Word, Excel, etc, I hope that these additions can make
JArbitrager useful to the non-progammers as well as programmers. Also,
it is nice to be able to change the strategy without having to re-
compile each time. XML style sheets can be added to the XML file to
make it more appealing for viewing.
XML can be generated by a variety of external packages, so it can be a
convenient way to pass information from the external analysis
software, such as MATLAB or EXCEL or from external database.
Also, since XML can be HTTP'd, I am hoping eventually to be able to
put JArbitrager somewhere on co-located server and HTTP trading
instructions to it.

nonlinear5

unread,
Oct 5, 2010, 9:15:55 AM10/5/10
to JArbitrager
Thanks, Alexana, that's a nice enhancement. I would note, however,
that it doesn't make JArbitrager usable by non-programmers. Your XML
data file defines the strategy configuration (i.e. instruments and
parameters), but not the strategy itself.

Astor

unread,
Oct 5, 2010, 9:33:48 AM10/5/10
to jarbi...@googlegroups.com
To the extent that the non-programmers are willing to use single existing strategy, it does. Going forward, I hope different strategies and indicators can be added as classes and XML file can include parameter, which will define the strategies and indicators to be used.
 
An example of that would be a unified platform, which combined JArbitrager and JBookTrader strategies. An XML file can contain <strategy> element node, based on which either strategy can be chosen. Adding such node(s) and parsing logic would be trivial.
 
What do you think about combining the two in such way?

From: nonlinear5 <eugene....@gmail.com>
To: JArbitrager <jarbi...@googlegroups.com>
Sent: Tue, October 5, 2010 8:15:55 AM
Subject: Re: XML Reader for JArbitrager

nonlinear5

unread,
Oct 5, 2010, 11:08:41 AM10/5/10
to JArbitrager
> An example of that would be a unified platform, which combined JArbitrager and
> JBookTrader strategies. An XML file can contain <strategy> element node, based
> on which either strategy can be chosen. Adding such node(s) and parsing logic
> would be trivial.
>
> What do you think about combining the two in such way?
>

If I were to commercialize JBT/JST/JA, it would probably make sense to
merge them all and provide a non-programmatic way to use them, as it
would widen the possibilities and target more inclusive user base. I
have no such plans, however. My intent is to make money by running JST/
JBT/JA, not by selling them. The separation between the three
platforms is clearly defined, and allows for all three to evolve
independently. I bet that most users would only use one of these, and
as such, it would be a burden to load it with all the infrastructure
necessary to use it interchangeably as the other two platforms.

Astor

unread,
Oct 5, 2010, 12:04:24 PM10/5/10
to jarbi...@googlegroups.com
It looks like the platforms have a lot of shared classes. If the platforms are merged, development and maintenance of these shared classes would be much easier.
 
Even for personal trading, there may be other advantages to combining platforms:
 
One advantage is strategy diversification. Book trading traditionally is market-timing trend anticipation strategy. Arbitrage, as it is commonly used, is a market-neutral trend reversal strategy. These two strategies are uncorrelated and complimentary. Having a portfolio, which allocates some assets to each helps smooth out the volatility of the portfolio value.
 
Another possible advantage of creating a single package may be the ability to blend the strategies. Since signals from each strategy are uncorrelated, each signal can be used to confirm the other. For example, arbitrage positions can be established only after the change in the book confirms that the mean reversion is imminent. 
 
 

From: nonlinear5 <eugene....@gmail.com>
To: JArbitrager <jarbi...@googlegroups.com>
Sent: Tue, October 5, 2010 10:08:41 AM

Subject: Re: XML Reader for JArbitrager

John-Crichton McCutcheon

unread,
Oct 5, 2010, 1:07:45 PM10/5/10
to jarbi...@googlegroups.com
Alex, I just have not been to excited with what I've seen with the arbitrage strategies compared to
the book Strategies.   With 1 ES contract using JBookTrader you can see some exciting returns in the
optimizer.  Where do you see exciting possibilities with arbitrage trading and JArbitrager? 

Note. As far as directions for future development.   A few thoughts of mine are :

1) Applying Kalman Filter  -as you've suggested- to JBookTrader is a intriguing. 
    a)  Finding a way to remove  "time"  as an optimizable parameter for an Indicator. 
    b)  Make Strategies Volatility aware. 
2) Adding more analytical capability to JBookTrader /JArbitrager ( if I can be convinced of its value)    
    a)   Comparing strategies
        i)   Would like to see what the top strategy in my portfolio of strategies is for the last  week , 2 weeks , month , quarter.   
        ii)   Capability to compare strategies side by side after an optimization run on both.   For example, looking at the top 100
              results of an optimization for Strategy1 vs same for Strategy2,    How do I know which is better. 
        iii)   Add charts for both i) and ii) 
   b) Automation/Batching up of commands needed to make a) possible.   
   c)  Ability to navigate, zoom, slice and dice  historical backtesting results.  ( JBookTrader is kind of going in that direction) 
3)  Make JBookTrader into  .jar and refactor it to make it more modular,  extensible, and overridable. 
        a) Ability to add new UI by overriding java classes. 
        b) Ability to extend the file format.  
        c)  Add charts.   

If 3) could be done, then other open source initiatives could be created around the core JXXXTrader .jar file.    But its easier said than done. 

nonlinear5

unread,
Oct 5, 2010, 1:19:54 PM10/5/10
to JArbitrager
>1) Applying Kalman Filter -as you've suggested- to JBookTrader is a
>intriguing.

I will look into it.

>      a)  Finding a way to remove  "time"  as an optimizable parameter
> for an Indicator.

I don't understand this. My guess is that what you mean is a
parametrized trading schedule?


>      a)   Comparing strategies
>          i)   Would like to see what the top strategy in my portfolio of
> strategies is for the last  week , 2 weeks , month , quarter.
>          ii)   Capability to compare strategies side by side after an
> optimization run on both.   For example, looking at the top 100
>                results of an optimization for Strategy1 vs same for
> Strategy2,    How do I know which is better.
>          iii)   Add charts for both i) and ii)

I'd note on this point that optimization results saved by JBA/JA into
an html file can be easily imported to Excel for analysis.


John-Crichton McCutcheon

unread,
Oct 5, 2010, 1:56:28 PM10/5/10
to jarbi...@googlegroups.com
On 10/5/2010 1:19 PM, nonlinear5 wrote:
>> 1) Applying Kalman Filter -as you've suggested- to JBookTrader is a
>> intriguing.
> I will look into it.
>
>> a) Finding a way to remove "time" as an optimizable parameter
>> for an Indicator.
> I don't understand this. My guess is that what you mean is a
> parametrized trading schedule?
Time parameters are inputs to various indicators such as EMA based
indicators.
This was discussed in previous threads. To summarize: by integrating a
Kalman Filter into a particular
strategy or indicator in the appropriate way, the need to include time
periods as "optimizable" parameters to indicators
and thus as parameters that are input into optimizer can be replaced by
an implementation of a Kalman filter which
adapts the time parameter dynamically at runtime. Eliminating time as
an "optimizable" parameter from a given Strategy
reduces the tendency of the Optimizer to "fit the curve" to the extent
that time parameters do this.
This is merely one way to use the Kalman Filter here.


Astor

unread,
Oct 5, 2010, 2:53:46 PM10/5/10
to jarbi...@googlegroups.com

John, strategies currently built into jArbitrager are what is known as "cash and carry" arbitrage. This approach is so well known and exploited by so many institutional investors that the only way to make money in it is by having a lower latency trading platform, which we do not.
 
A far more profitable way to make money from jArbitrager is through statistical arbitrage or relative valuation approach. This is how I intend to use it, possibly utilizing JBookTrader strategy as one of the trade signals, 
 
 
 
 

 


From: John-Crichton McCutcheon <john.crichto...@gmail.com>
To: jarbi...@googlegroups.com
Sent: Tue, October 5, 2010 12:07:45 PM

nonlinear5

unread,
Oct 5, 2010, 3:10:16 PM10/5/10
to JArbitrager
> This approach is so well known and exploited by so many
> institutional investors that the only way to make money in it is by having a
> lower latency trading platform, which we do not.
>

I agree with that observation, and there is an experimental
confirmation of that by someone running JArbitrager live. The results
were reported in this group.

John-Crichton McCutcheon

unread,
Oct 5, 2010, 3:28:12 PM10/5/10
to jarbi...@googlegroups.com
A far more profitable way to make money from jArbitrager is through statistical arbitrage or relative valuation approach. This is how I intend to use it, possibly utilizing JBookTrader strategy as one of the trade signals,

Ok I'd love to see some sample strategies or suggested pairs to test with.   Like I mentioned before, I tried it with
two stocks:  ADBE and INTU  and the results running through the optimizer were not too exciting given that there
is going to be slippage and to make significant money on that you need allot of capital. 

Astor

unread,
Oct 5, 2010, 3:28:42 PM10/5/10
to jarbi...@googlegroups.com
There are other forms of arbitrage, more profitable, which can be used with jArbitrager platform without requiring extreme low latency. Dividend arbitrage is one . Merger arbitrage is another. And my favorite, - relative value or stat arb. As I had pointed out earlier, it can incorporate very nicely sentiment based signal of the type used by jBooktrader.
 

From: nonlinear5 <eugene....@gmail.com>
To: JArbitrager <jarbi...@googlegroups.com>
Sent: Tue, October 5, 2010itrag 2:10:16 PM

Subject: Re: XML Reader for JArbitrager

Astor

unread,
Oct 5, 2010, 3:42:23 PM10/5/10
to jarbi...@googlegroups.com
I would not trade individual stocks. The slippage will eat most of the profit and shorting availability will vary. Due to liquidity ETFs or currencies are a much better bet.  Take a look at australian dollar vs. canadian dollar. IVW sometimes works well agains QQQQ. There are time periods when these work well. Identifying those periods is the difficult part. 

From: John-Crichton McCutcheon <john.crichto...@gmail.com>
To: jarbi...@googlegroups.com
Sent: Tue, October 5, 2010 2:28:12 PM
Reply all
Reply to author
Forward
0 new messages