SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sat Feb 22, 2020 3:32 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sat Sep 02, 2006 7:44 am 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Hello

For the OrderBook class, it will be nice to have the SmartQuant.Data.OrderBookEntry as a MarketDepth as OrderBookEntry as less information than MarketDepth

Thanks

Wilhelm


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 9:32 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6816
I thinkMarketDepth and OrderBookEntry are two different things. MarketDepth events provide information that is used to update OrderBook (a collection of OrderBookEntry objects), f.ex. MarketDepth event can tell you to update size of 5th OrderBookEntry, insert new or delete.

What fields are you missing in OrderBookEntry?

Regards,
Anton


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 1:59 pm 
Offline

Joined: Fri May 06, 2005 1:40 am
Posts: 521
While talking about the orderbook, I cannot proceed with QD orderbook support for Opentick. As previously mentioned, QD needs:

- Current Order book sortable list index by both alphanumeric MarketMaker/Book ID and secondary ID (currently called "position"). At the moment there is no support for MarketMarketID (also used for Book ID's).
- Secondary list field alphanumeric "ID" to support what is currently called the "position". Note: that many book exchanges deliver this as an alphanumeric identifier value, not a "position" integer. The QD Orderbook code is using an integer "position" directly mapped to an array list position - it isn't compatible with OTBook* methods (See http://www.opentick.com/docs/OTFeed/ ), which are pretty much what the exchange is delivering, apparently - so these changes would not just be to satisfy Opentick only conventions.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 9:39 am 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Few idea for:

BookOrder:
- add MMID to OrderBookEntry,
- Being able to filter OrderBook for MMID, price/Color Range, Qty...
- Please make it really fast (do not create/destroy too many object this is very costly, may be MarketDepth can possess an OrderBookEntry that will be pass to the OrderBook)
- Also it will be nice to be able to display the OrderBookForm as we can display a Bar chart just by adding Add(...) in the init of the Strategy


OrderBookForm:
Few extra features that you might think about (I put them in the order of importance):
1) Display the MMID in the "order book" window
2) being able to add the order book from a Strategy so we van display it as we can display today the chart (it will be just an extra chart that can appear) ßßßßß this will be really nice.
I try to do a DocumentManager.ShowDocument(new PairKey(Instrument, Strategy.MarketDataProvider),typeof(OrderBookForm),instrument.Symbol + " [Order Book]");
but this didn't work
3) Group price by color
4) put ECN with lower case character (or to demark them from MM)
5) Concatenate qty/price/color per color range in one line


Question:
Q1) If I receive MarketDepth (Nasdaq L2) from one exchange, how can I specify to buy/sell from another exchange?
Q2) Is there an easy way to specify the SecurityAltID, SecurityAltExchange, SecurityAltIDSource dynamically via the code? I can see Instrument.AddSymbol but I can not pass the FIXSecurityAltIDGroup or specify the SecurityAltExchange, only the symbol and source
Q3) Do you guys still plan to implement the Instrument grouping notion?

Idea: may be Q1 can be solve by specifying a SecurityAltGroupID

Thanks

Wilhelm


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 10:56 am 
Offline

Joined: Fri May 06, 2005 1:40 am
Posts: 521
Wilhelm wrote:
Q2) Is there an easy way to specify the SecurityAltID, SecurityAltExchange, SecurityAltIDSource dynamically via the code? I can see Instrument.AddSymbol but I can not pass the FIXSecurityAltIDGroup or specify the SecurityAltExchange, only the symbol and source


For q2 see http://www.smartquant.com/forums/viewtopic.php?p=9034

Features like color coding groups/lines, although very good for visual "human" chart reading use - would not be so useful to an automated strategy/QD. Ideas to make orderbook info available so that it can be used in strategies would be of more practical use in QD strategies than trying to mimic look and feel of the L2 window of normal charting programs?

This is a semi-related task who's common solution could apply to the MarketDepth, in addition to suggested Trade and Quote objects: http://smartquant.net/tracker/index.php ... ils&id=266


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 7:34 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Thanks for Q2 Krn_2k, anybody knows how to do Q1?

This link http://smartquant.net/tracker/index.php ... ils&id=266
doesn't seems to work

The closer the QD charting tools (OrderBook,..) are to the trading tools the easier it is to verify step by step strategies.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 07, 2006 9:43 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Important ISSUE - Please need HELP

For Q1 "If I receive MarketDepth (Nasdaq L2) from one exchange, how can I specify to buy/sell from another exchange?"

When I go live with IB (simulated account), I pay some huge spread everytime for SUPERSOES (market depth with IB require the SUPERSOES exchange)
I try to braket the order by a stop limit and a limit sell but they are canceled. It seems that SUPERSOES only support marketable order....

Any idea how I can solve this issue? should I simply go inside the IB code and force SUPERSOES only for receiving quotes and to use what ever I configure (via SecurityAltID, SecurityAltExchange(SMART, ISLAND,...) , SecurityAltIDSource )for buying selling?

How does people use MarketDepth/IB/orders right now?

Thanks for your help

Wilhelm


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 07, 2006 9:56 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Example: Right now AAPL is around $72.95 and I bought it (IB simulated) via SUPERSOES at $76 and sold it at $67, please help. thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 07, 2006 10:50 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Do you see any issue if I force
contract.Exchange = "SUPERSOES";
instead of
contract.Exchange = instrument.GetSecurityExchange(Name);

in IBTWS.cs (line 310)

that way I should be able to configure what ever I like for buying and selling, will that work?

Also you should do something where I can define different FIXSecurityAltIDGroup (like IB_MARKETDATA, IB_QUICKSELL,...) and add an extra argument FIXSecurityAltIDGroup to the buying and selling functions

Thanks

Wilhelm


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 07, 2006 10:56 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
I made few modifications on OrderBook and force the SUPERSOES and this seems to get the MarketDepth. Let see when a transaction occur if it uses the specific exchange that I define in the FIXSecurityAltGroupID

I think a more generic solution describe upper needs to go in the main stream code

Wilhelm


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 5:46 am 
Offline

Joined: Sun May 15, 2005 11:13 pm
Posts: 367
Location: Bermuda
krn_2k wrote:
While talking about the orderbook, I cannot proceed with QD orderbook support for Opentick. As previously mentioned, QD needs:

- Current Order book sortable list index by both alphanumeric MarketMaker/Book ID and secondary ID (currently called "position"). At the moment there is no support for MarketMarketID (also used for Book ID's).
- Secondary list field alphanumeric "ID" to support what is currently called the "position". Note: that many book exchanges deliver this as an alphanumeric identifier value, not a "position" integer. The QD Orderbook code is using an integer "position" directly mapped to an array list position - it isn't compatible with OTBook* methods (See http://www.opentick.com/docs/OTFeed/ ), which are pretty much what the exchange is delivering, apparently - so these changes would not just be to satisfy Opentick only conventions.


I use IQFeed as a L1/L2 provider. They don't supply the 'position' attribute. I think the 'position' attribute is an addition supplied by some data distributor's specific software. For example, IB supplies their L2 with this position attribute. Anyway, as a result, I'm unable to use the built in order book.

I posted some code at http://www.smartquant.com/forums/viewto ... ght=#10606 for a different form of Order Book.

The code I posted I think is more efficient in computing the various values needed for evaluating the market depth data. In effect, it duplicates the two views supplied with Interactive Brokers software, but doesn't use or provide the 'position' attribute, and bypasses all the Java limitations of 3 simultaneous feeds.

When using Interactive Brokers stream with their updateMktDepthL2 event, the position and operation attributes can be ignored with no loss of useful depth information.

Anyway, having said that, I think the submitted Order Book may satisfy krn_2k's requirement for an Open Book solution.

By changing the LimitBookKey IComparer implementation, the order book can be sorted in any order needed, and could possibly be used with L3 where multiple records per MarketMaker exist.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 5:53 am 
Offline

Joined: Sun May 15, 2005 11:13 pm
Posts: 367
Location: Bermuda
krn_2k wrote:
Features like color coding groups/lines, although very good for visual "human" chart reading use - would not be so useful to an automated strategy/QD. Ideas to make orderbook info available so that it can be used in strategies would be of more practical use in QD strategies than trying to mimic look and feel of the L2 window of normal charting programs?


The forms I'm having problems with in another thread relate to this. Sometimes when one is trying to develop a strategy, seeing the data helps one to design an appropriate programmatic strategy. When I'm running a simulation, I can now see the market depth data at the same time as the regular quote/trade streams. It is helping me to refine the final strategy. Once I've figured out how the depth relates to everything else, I'll be able to remove the forms and run at full speed. In addition, hopefully the Order Book code I uploaded elsewhere will help generate some improvements in the order book code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 11:44 am 
Offline

Joined: Fri May 06, 2005 1:40 am
Posts: 521
stargrazer wrote:
Anyway, having said that, I think the submitted Order Book may satisfy krn_2k's requirement for an Open Book solution.
stargrazer wrote:
...hopefully the Order Book code I uploaded elsewhere will help generate some improvements in the order book code.


Sounds good stargrazer. Also perhaps a note directly to Alex about your solution code in case he missed it on the forums? I discussed the orderbook issue with SQ some time ago, it was on the whiteboard todo list. I was also told by Opentick that their orderbook methods are pretty much exactly what they get from the exchange (and with no position ID's expected by the current QD implementation - perhaps these were invented only by IB).

When a usable orderbook is in QD I imagine it will quickly lead to more interest in indicators and strategy development to take advantage of the functionality. One of the first basic indicators that would be easy to both implement and use with QD strategies would be the useful L2 Histogram,
Examples:
http://www.realtick.com/v2_getpage.asp? ... t83&ID=607
http://www.prophet.net/quotes/nqLevel2Viewer.jsp


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 1:52 pm 
Offline

Joined: Sun May 15, 2005 11:13 pm
Posts: 367
Location: Bermuda
krn_2k wrote:
One of the first basic indicators that would be easy to both implement and use with QD strategies would be the useful L2 Histogram


The slPrice table in the submitted Order Book code provides this histogram information.

For a histogram reflecting quantity actually traded at each price level, that would be fairly easy to implement in an OnTrade event.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 6:28 pm 
Offline

Joined: Fri Dec 09, 2005 10:04 am
Posts: 141
Location: USA - CA
Keith or stargrazer

I use IB which use position, I plan to switch to IQFeed which is known for its quality and it has nice feature like 500 stocks,

For info, can you explain how the QFeed and OT l2 works without the position, I guess you need to rely on the order they arrive (time stamp), price, isn't it?
How do you delete a record, you might have 2 'brut' for instance at the same price, same qty, how do you know which one to remove? I can understand if you get the time stamp, do you?

Thanks

Wilhelm


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group