Cross Platform issues

This forum consists of sub-forums dedicated to alternative platforms to Empty4. PM me, if you have your own favourite and I will add a sub-forum for it.
Post Reply
ianj
Trader
Posts: 81
Joined: Sat Feb 09, 2013 2:07 am

Cross Platform issues

Post by ianj »

I am currently writing an Empty4/LMAX API bridge and am running into the same issue as with Empty4 -> MT5 and indeed just about every institutional platform

Empty4 positions are in fact "logical" (at least as far as the REAL institutional market is concerned) - on many platforms they don't actually exists in the real market. Most institutional platform only maintain a single position per pair - and it can only be +ve or -ve. Its also related to the no hedge limitations imposed by US restrictions - you can 1 or more long, or short - but not mixed

To add a new long you add more to that position. to add a short to take some off. It means hedging is actually .. no change at all (well same pair "pure" hedging that is)

It also means a "native" order with an sl & tp may not exist on the platform - to LONG with an sl/tp you just INCREASE the current position and create STANDING LIMIT orders (they stay on the platform and execution when the price is met) to decrease that position

So a single position on an institutional platform with sl+tp is a position on a pair + 2 limit orders ..

Many REAL platform don't maintain the position in an Empty4 sense - in fact the only real need is to create a logical view for the trader showing what makes up the final pair position - handy for supporting multiple concurrent strategies, a couple of sl/tp prices (which also exists as limit orders on the platform), and a VOLUME (+some extra bits of historical stuff like open/close price/time and some handy tracking attributes like magic/comment) - to close an Empty4 like position you need to know how MUCH to modify the position by - and thats it

Which is, i guess, an issue already met by MT5 folk

Looking at LMAX now - and it supports a sorta of hybrid model

You long+long and it shows 2 order executed (you must remember these are not exactly Empty4 positions)
You then short .. and it "closes" one of the longs and modifies the pair position accordingly - In Empty4 you might expect 3 position but instead you have 1 remaining long

What this means in reality is that if you need to BRIDGE Empty4 into other platforms not supporting the individual position model you probably have to model those positions in the BRIDGE. If the target platform does model them you can map 1:1 but you can then at least manage to platforms that do not

Non Empty4 platform have some pretty nice advantages - especially as you transform a position across currency pairs. One good example is triangular arbitrage where you can open 3 PAIR positions and be hedged perfectly - In Empty4 you would have to close the positions - in non Empty4 you can trade out via other routes - it can work out far cheaper with higher volumes as you do not have to open/close the position for each strategy - one strategy can open a position and another can close it
CNS VPS - it just works :-)
ianj
Trader
Posts: 81
Joined: Sat Feb 09, 2013 2:07 am

Re: Cross Platform issues

Post by ianj »

SOme progress on LMAX API ..

When you connect it can send multiple orders and an open position total for each pair - and they look like they could represent the Empty4 like positions - as long as you have not tried to hedge. If you close a long position by shorting - it will close the oldest long positions in order before raising a short position (I guess that is FIFO+NO HEDGING)

From the web interface you can choose which of the positions to close (but not HEDGE), so it is possible to avoid FIFO but so far i have been unable to do it with the API (It has close and cancel, which seems to distinguish between standing limit orders and positions, at least that is what it looks like - the documentation is not clear/existent - interestingly the API reports an UNKNOWN order when partial closing a position on the web interface ??)

Also, the API (Java at least) does not represent "open quantity" as shown on the web interface. Looking at the underlying protocol the information is sent, so it was easy enough to add to the API (which comes with source, thankfully)

Have reported the difficulty in closing a position directly to LMAX, i will report back my progress

If this is possible, it might be possible to complete the bridge Empty4 -> LMAX - I already model Empty4 like position in my connector - i just need the ability to model direct position partial (+ partial). Once you start hedging it gets more difficult as i have no option but to partial or wholly close one or more of the existing opposite positions, and the LMAX orders then start to lose correspondence with Empty4 positions - and you have to consider the "why bother trying to mirror the order" question - closing another position to represent a hedge makes maintaining hard limit orders (for TP) that much more difficult to maintain

The other big issue is SL/TP. I can choose to implement typical Empty4 server style - by monitoring prices and raising market orders when the sl/tp prices have been met - i should implement that as a backup at least. The best solution, however, is to mirror the TP with limit orders - preferably with OCO but i don't think they exist, and as i have suggested above it gets more complex when you start to hedge
CNS VPS - it just works :-)
ianj
Trader
Posts: 81
Joined: Sat Feb 09, 2013 2:07 am

Re: Cross Platform issues

Post by ianj »

ianj wrote:SOme progress on LMAX API ..

From the web interface you can choose which of the positions to close (but not HEDGE), so it is possible to avoid FIFO but so far i have been unable to do it with the API (It has close and cancel, which seems to distinguish between standing limit orders and positions, at least that is what it looks like - the documentation is not clear/existent - interestingly the API reports an UNKNOWN order when partial closing a position on the web interface ??)

...
Have reported the difficulty in closing a position directly to LMAX, i will report back my progress
Hmm ! - not so good reply from LMAX
LMAX wrote: Not all of the functionality on the Web UI is exposed on our API and this is one such function

You are correct in that our API does not allow you to specify the closing of a specific position. All you can do is specify a closing order for the opposite quantity and same instrument. This is designed to allow you to send in an order that is earmarked as a closing order so it does not increase your margin as the sending of a normal new order would.

Unlike the Web UI, where you can specify the closing of a specific order that makes up a position, through the API this will be closed FIFO.
So there you have it :(
CNS VPS - it just works :-)
Post Reply

Return to “Alternative platforms”