DATA Step, Macro, Functions and more

SAS_Order classification

Reply
Contributor
Posts: 53

SAS_Order classification

[ Edited ]
 
Super User
Posts: 19,850

Re: SAS_Order classification

Posted in reply to Khaladdin

Khaladdin wrote:

Hi all,

I have a tricky question about the SAS programming. I need to classify limit order book according to its aggressiveness. I will be happy if someone can help me. I need to use the method that developed by Hagstromer (2014). Method says that:
We categorize buy orders by aggressiveness on a scale from (1) to (10). The least aggressive action on the buy side is to cancel an existing buy order, and such messages are assigned type (1). Limit orders that do not lead to immediate execution are classified as follows: (2) is a buy order quoted at a price lower than 0.5% below the best bid price; (3) is a buy order quoted below the current best bid price, but less than 0.5% below the current best bid price; and (4) is a buy order posted at the best bid price. Among buy orders that are priced between the best bid and ask prices, we distinguish those that are cancelled if they are not executed immediately (5) from those that are allowed to rest in the order book (6). The remaining buy order categories are marketable limit orders that result in immediate execution: (7) is a marketable limit buy order without price impact; (8) is a large marketable limit buy order that consumes all the available shares quoted at the best ask and withdraws the residual volume, that is, the volume that is not executed at the best ask; (9) is a price changing marketable limit buy order that posts the residual volume as a limit order in the book; and (10) is a price-changing marketable limit order that is “walking the book,” that is, is executed at several different price levels.
Many thanks in advance for your help.


1. Post some sample data and anything you've tried so far

2. Narrow your question - dumpimg your entire assignment on here and expecting someone to do all the work isn't helpful. Narrow your question ro a single more detailed idea and you can build on that. If you need multiple questions in the process that's fine. 

3. Sample data and expected output. 

SAS Super FREQ
Posts: 3,755

Re: SAS_Order classification

Posted in reply to Khaladdin

I assume the data includes variables for the type of order (cancel existing, limit, buy below,...) and also variables on the price, bid, etc. when the order was created. Then just use a series of IF-THEN/ELSE statements or a SELECT-WHEN statement in the DATA step to assign the agressiveness level.  It that is not something you know how to do, then post the format of your data.

PROC Star
Posts: 7,487

Re: SAS_Order classification

Posted in reply to Khaladdin

I think the following paper should help: https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0ahUKEwitrdHZre_SA...

 

Additionally, that paper's authors site the following link for providing some of the SAS code they used: http://people.stern.nyu.edu/jhasbrou/

 

Art, CEO, AnalystFinder.com

 

Super User
Posts: 11,343

Re: SAS_Order classification

Posted in reply to Khaladdin

Looks like $200 hour work to me.  Smiley Happy

Ask a Question
Discussion stats
  • 4 replies
  • 199 views
  • 4 likes
  • 5 in conversation