My recent process of finding an edge.

Discussion in 'Automated Trading' started by TSGannGalt, Apr 1, 2007.

  1. Recently, I opened another account with a broker as our liquidity provider for FX. So I add the new liquidity provider in my FIX server based on their FIX specifications.

    Well, I have a scalping model utlizing the tick TOS, trading 40-50 trades a day. It's a typical scalping model you see around. So we start running the model with the new broker we just got and comparing the performance.

    On the end of day 1, we find that the order execution speed has been spectacular.

    During day 2, we check the trades realtime and we noticed why this has been happening. The order seems to be ignoring the FIFO to a large extent (not all the time but most of the time) so we run a comparison with the Market Depth data, and we find out that the trades, are filling semi-instant.

    I run a small fund and have a small meeting about the results. Without giving them any ideas about the "problem", I called the brokers if there's been problems with the execution platform or the FIX engines, but they have no idea it and they told me they just updated their FIX engine to support FIX 4.4.

    In our FIX server, we have a front-end monitoring software that lets us put manual trades for contingency reasons. So enter a few trades manually on a 1 lot and check every message log from top to bottom to find mistakes. But there's no mistakes on our side.

    (Still Day 2... we all stayed up late)

    While the other staff studied the manual trades and getting all hyped up, I started programming a code that analyzes the fills relative to the Bid/Ask volume.

    At the start of Day 3, I finish my code, got it debugged... ran it on the demo FIX server the broker provides... and put in on live with a 1 lot. Basically, it places a limit order @ Bid when short, and limit @ Ask when long (or flat).

    The night shift leaves and we explain to him what's going on to the day shift. And told him to wake me up in a few hours while I take nap.


    So I wake up and take a look at the analysis. There's been over 2000 trades in the log so I code up a few more stuff to see what's going on...

    I was still trying to figure out what the bug was but I started getting hypothesis about it. So I get back on the manual platform and start testing ideas.

    After a few hours of more trades, I've started narrowing down the reason, but more-so, the tendency of the order.

    Basically, the FIX order fore-runs the orders at some times, and with a small lot size. The provider is an ECN, matching orders internally with bank participators. On their proprietary trading software, everything works fine, but when it comes to their newly upgraded FIX execution, things get messed up. Within the FIX execution, what seems to be happening is that they first fill the orders internally and once the internal orders are exhausted they use banks to fill the rest. So:

    There's 5 Bids on screen. The top 2 Bids are their internal orders. So at any point, when I place a limit order, I will always fore run, the bottom 3 bidders.

    So what I start doing is once I get filled, meaning I will always be on top of the FIFO, I have the computer bid the size equal to the volume below me and vice-versa on limit. This is so that I can always scratch my trades out with the bank orders below me. Once the bids below me move out, I get out with them with a scratching trade or a loss.

    The simple Algorithm worked manually so I, code up the simple algo to automate it. I got it coded up quite quickly and I tell my night desk about what the code does and to shut it off once the account goes red (waking me up too). In the meantime, I sleep inside my office, again...

    I had a short but a good sleep, and get ready for Day 4. So confirm our edge during my sleep and we have a meeting with my staff. We came to a conclusion that:

    1. We should come up with a Market Making model to utilize the edge we have now.

    2. Alternate our trade execution algorithm while the edge sustains... meaning creating a switch between the current algo vs. the new.

    I had a bunch of short term scalping and arbitrage trading models I kept in archive due to the lack of strong profits to cover costs. So bring them out and start testing them under the new condition. Some of them, were applicable to the edge and some weren't. I ended up with a comfortable number of short term systems to integrate into live mode.

    Converting and testing the systems took me full 2 days. I was coding 2/5 of the time and 3/5 of the time waiting for the test results. Once all the systems were integrated into the live trading server, I double / triple checked the execution quality, confirming the differences between hypothetical and live results.

    Of course, I haven't gone home yet. So finally, I go home at a regular hour and take a shower. Then sleep in my bed. I would have stayed another day in the office but everyone kept complaining about my hygiene.

    For the next few days, I start working on the Algo-trading logic and code. First, I had to quantify and programming a live tracker for the execution quality.

    Another important issue is to understand the edge in hand. What I have mentioned is only a hypothesis of what may be causing it. I can't tell the provider about the flaw or they can fix it up so I have to reverse-engineer and test every possibility. The closer I am to the cause, I can alter the logic based on it. The closer I am, I can place the most appropriate risk measures, too.

    As a result of seeking the answer, I have an arbitrage between currency pairs. As long as the edge is there, it's a holy grail.

    Anyways, this has been an example of what an edge is and what went through for the first few days. No bar charts, technical analysis, or other stuff most people talk about in ET.

    If there was a question to this post, the answer would be Bad Hygiene.
  2. exactly. there will always be ineficiencies of this type in the matching code as it is designed now, imo

    congrats that sounds like a lot of fun to be ballin' on that level.
  3. The characteristics of a edge:

    (1) low incidence of occurence over price vs time

    fleeting momentary opportunity that persists a fraction of the timeframe your looking at.

    (2) lack of arbitrage by the masses

    not recognized by most anyone yet.

    (3) too cost intensive in terms of infrastructure to take advantage of.

    servers, software, programmers.

    (4) low liquidity advantage in terms of the market

    larger participants avoid it from lack of liquidity in the edge for their needs.

    hopefully it will persist for you a little longer.
  4. comments like that are why i read this board, spectre!

    i used to work with fix on a daily basis, so this is interesting to me.
  5. Classic.

  6. I forgot one

    (5) structural need of the market.

    As open outcry is going out, the pit traders are losing their edge, their edge was the ability to be a market maker, being able to buy at the bid and sell at the ask.

    As most of the trading goes electronic, computer order matching determines the edge parameters. FIFO logistics being one.
  7. Spectre, you posted this a few days ago:

    An average charting software package won't do the job I mentioned above. And... I run my own hedge fund...

    As for the sustainability of the edge... I already have the risk determined and have the precautions ready. Once the edge diminishes, the software switches both the system and the edge centered execution algorithm, back to the algorithmic trading model, I used to run it on.

    The execution quality pretty much is the basis of the contingency. But we also are in a lookout right after they daily maintenance and any news of them shutting down the FIX server for sometime, like the weekends...

    Of course, I don't plan and expect the execution flaw to be going on forever. You make money while you can.
  8. i have wondered about this very issue you two are discussing.

    i know someone making gobs of money doing along the lines of what the original poster is doing...

    and i know someone else making very good money doing FA with standard tools...


    but then there are a lot of people losing money too...

    sounds like there are many different ways the cookier crumbles.
  9. there are inefficiencies that persist for hours to days at times, then a sharp revaluation occurs.

    the tools available to the average investor are enough in the current times.

    its how one uses the tools to decipher what is going on, that makes a difference. I made a mistake in generalizing about the timeframes some funds work in.

    its the skill level of the trader/programmer that determines outcome. Just as any tool, only a person skilled can make the best use of it.
  10. cmaxb


    To me this is not trading. I want to make money using my skill, not because of a malfunctioning slot machine. Still exciting, though
    #10     Apr 1, 2007