BookmarkSubscribeRSS Feed
4 REPLIES 4
Reeza
Super User

@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. 

Rick_SAS
SAS Super FREQ

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.

art297
Opal | Level 21

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

 

ballardw
Super User

Looks like $200 hour work to me.  🙂

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 809 views
  • 4 likes
  • 5 in conversation