Serving the Quantitative Finance Community

 
User avatar
BornToBeTrader
Topic Author
Posts: 4
Joined: November 14th, 2004, 12:23 am
Location: New York

Detecting front running using machine learning algorithms

February 9th, 2019, 6:54 pm

Hi Everyone, 

I apologize in advance if this isn't the right forum for this or if this question has been answered before (I tried searching and I couldn't find it). 

I'm actually working with the execution desk where we have tick level data for the past one year and I have their trade blotter for the entire year. The question brought to me was how can they figure out if the trades are being front run. I was looking into some machine learning algorithms.... but I'm not sure where to begin. I started with some exploratory data analysis but I don't necessarily have a benchmark/training set to even start training for a model. 

Can anyone share any ideas on the topic please? 

Saad
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Detecting front running using machine learning algorithms

February 10th, 2019, 5:11 am

I suspect you're getting way ahead of yourself and need some basic background. Two suggestions on that:

1. A little googling shows Nasdaq acquired a vendor that markets "front-running detector" software. Invite them in for a sales pitch and present your questions. Who knows -- maybe you will hire them.

2. There are a number of legal cases in which the SEC has charged various brokers. Do a little detective work: track down the defrauded clients, call them up, and invite somebody to lunch. Ask them what happened and how they detected it. 

Not all front running is illegal. The ability of high frequency traders to sniff out large orders legally was the subject of Michael Lewis's book 'Flash Boys'.

Anyway, you need first to become a 'domain expert' on the subject or have access to some. Whether or not machine learning is helpful in detection seems a secondary question. An assignment from the "pointy-haired boss" (if you know Dilbert)?
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Detecting front running using machine learning algorithms

February 10th, 2019, 9:00 am

Not all front running is illegal. The ability of high frequency traders to sniff out large orders legally was the subject of Michael Lewis's book 'Flash Boys'.
perhaps the original poster could clarify what he means by "front running"
I always took it to mean when a broker (or firm) executed their own order ahead of a client's order

There are lots of things that aren't considered front running, like a newsletter which is released to subscribers first and the general public for free a few days later, so the newsletter author buys the stock first, followed by subscribers followed by the hoi polloi
 
User avatar
Cuchulainn
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Detecting front running using machine learning algorithms

February 10th, 2019, 3:32 pm

Image
 
User avatar
BornToBeTrader
Topic Author
Posts: 4
Joined: November 14th, 2004, 12:23 am
Location: New York

Re: Detecting front running using machine learning algorithms

February 10th, 2019, 10:00 pm

I suspect you're getting way ahead of yourself and need some basic background. Two suggestions on that:
....

Anyway, you need first to become a 'domain expert' on the subject or have access to some. Whether or not machine learning is helpful in detection seems a secondary question. An assignment from the "pointy-haired boss" (if you know Dilbert)?
Thank you so much @Alan. Yes that is helpful. Given your knowledge of the Subject Marrter, I wouldn't consider the advice to be from PHB.  :)
 
User avatar
BornToBeTrader
Topic Author
Posts: 4
Joined: November 14th, 2004, 12:23 am
Location: New York

Re: Detecting front running using machine learning algorithms

February 10th, 2019, 10:15 pm

Not all front running is illegal. The ability of high frequency traders to sniff out large orders legally was the subject of Michael Lewis's book 'Flash Boys'.
perhaps the original poster could clarify what he means by "front running"
I always took it to mean when a broker (or firm) executed their own order ahead of a client's order

I think the head trader is just concerned if he is always getting the best execution price. In some cases, we break the orders to multiple brokers but that increases the transaction costs (especially if the order is divided order is divided over various exchanges). I know the next likely suggestion to come up is to make effective use of TCA  and we are already looking to make use of the BTCA tool since our whole platform has moved to their EMSX. 

Looking at their historical slippage, despite using certain preconfiugred algorithms, for certain contracts there was an implementation shortfall. They wanted to eliminate front running as a possibility. 

Has anyone here used BTCA? If so, please share your thoughts/comments. 

Thanks
 
User avatar
lloydsatchwell
Posts: 22
Joined: April 27th, 2011, 4:00 pm

Re: Detecting front running using machine learning algorithms

February 11th, 2019, 4:01 pm

As mentioned above, defining front running may be a good place to start if there is something specific you are looking for. However, what some commentators have described as "front running" is really just quote fade & adjustment by liquidity providers. If you do not have a clear definition, analysing your trading counter parties/brokers/venues is still a valuable exercise to discover different performance, behaviours & stories which will likely be explained by other factors than front running. 

A lot depends on the nature of your trading and your strategy, but metrics start calculating include: Slippage vs Arrival price at your broker, implementation shortfall, alpha reversion, fill rates. Then there are a host of techniques to use for classification, regression, looking for outliers in this data. Machine Learning can be used here, but doesn't have to be.

Naturally the more data you have, the better your insights.
 
User avatar
lloydsatchwell
Posts: 22
Joined: April 27th, 2011, 4:00 pm

Re: Detecting front running using machine learning algorithms

March 20th, 2019, 11:26 am

Came across a nice summary of how that last bit tends to work:
When fundraising: AI
When recruiting: ML 
When building: Linear Regression  
 
User avatar
Cuchulainn
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Detecting front running using machine learning algorithms

March 24th, 2019, 12:52 pm

Came across a nice summary of how that last bit tends to work:
When fundraising: AI
When recruiting: ML 
When building: Linear Regression  (two C++ developers)
And software maintenance: hordes of Python programmers.
 
User avatar
ISayMoo
Posts: 2332
Joined: September 30th, 2015, 8:30 pm

Re: Detecting front running using machine learning algorithms

March 26th, 2019, 8:38 pm

Came across a nice summary of how that last bit tends to work:
When fundraising: AI
When recruiting: ML 
When building: Linear Regression  
That's a good description of quant trading "maths".