HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Automated Trading ›› My own ATS: which subsystem to generate closing order?  


Post A Reply
    Page 1 of 4:   1  2  3  4  
vincegata
 

Registered: Jan 2011
Posts: 94

 

08-23-12 06:16 PM

Hello,

I am developing my own ATS which is about 80% done, however, in the current setup for each entry order my Strategies Execution System also (immediately) generates closing Stop Limit and take profit orders. If I do not want such scenario then which system should generate closing orders? at the present Strategies Execution System is not aware of open orders and Order Management System does not get the quotes data.

If you have experience with ATS what is the way to implement order closing?

Here is the scheme, each system is in it's own executable, they communicate through messaging.

Broker's Quotes Server -> (quotes) -> [ Quotes Connector -> (quotes) -> Strategies Execution System -> (order signals) -> Order Management System <-> (order signals) <-> Order Routing System (FIX Engine) ] <-> (order in FIX format) <-> Broker's FIX Server

Thank you in advance.

    Edit/Delete Quote Complain
TheGoonior
 

Registered: Oct 2009
Posts: 832

 

08-23-12 06:41 PM

If you are using fixed targets/stops which don't change (or change in a simple fashion such as a percentage trailing stop), then the order management task seems like the most logical alternative.

However if you update your orders by some sort of logic (or even think you might in the future), then I would keep them in the Strategy area.

IMHO, keeping things isolated makes the code cleaner and easier to maintain:
Strategy has anything to do with order generation (even if it's simple like brackets) and Order Management has anything to do with order transmission (including code to work fills, etc).

My $0.02.

    Edit/Delete Quote Complain
southall
 

Registered: Mar 2010
Posts: 388

 

08-23-12 08:01 PM

I think you need to describe the new requirements for the closing order functionality a bit more..

    Edit/Delete Quote Complain
vincegata
 

Registered: Jan 2011
Posts: 94

 

08-23-12 09:07 PM


Quote from southall:

I think you need to describe the new requirements for the closing order functionality a bit more..



What I have now:
Place market order long on BAC + place stop order at market price -$0.50 + place limit order sell at market price+$1. This is all generated by Strategy Execution System now.

What I want is to have a logic in order closing. Hypothetical strategy:
Place market order long on BAC.
Place market sell order when price drops by 5% from 3 hour SMA.
Place market sell order when price rises by 10% and volume drops by 20%.

    Edit/Delete Quote Complain
vincegata
 

Registered: Jan 2011
Posts: 94

 

08-24-12 02:14 AM


Quote from TheGoonior:

However if you update your orders by some sort of logic (or even think you might in the future), then I would keep them in the Strategy area.



That's what I am trying to have - a logic to close my orders. If to combine SES and OMS into a single code (I had that before redesigning my code) it gets very messy because both SES and OMS are multithreaded.

So SES has to be aware of all open orders so when a new quote arrives, say for BAC, it should check if I have any open orders for BAC and what strategy opened that order and then run the strategy to check if I have to generate Close Order signal. -- Something like that I guess, but like I said, combining SES and OMS is very very messy.

Are there any other ideas?

I have to add I am using C++/Linux.

    Edit/Delete Quote Complain
dazzwater
 

Registered: Mar 2012
Posts: 62

 

08-24-12 03:09 AM


Quote from vincegata:

That's what I am trying to have - a logic to close my orders. If to combine SES and OMS into a single code (I had that before redesigning my code) it gets very messy because both SES and OMS are multithreaded.

So SES has to be aware of all open orders so when a new quote arrives, say for BAC, it should check if I have any open orders for BAC and what strategy opened that order and then run the strategy to check if I have to generate Close Order signal. -- Something like that I guess, but like I said, combining SES and OMS is very very messy.

Are there any other ideas?

I have to add I am using C++/Linux.



What you have here sounds like an application design problem more than anything else, which can be solved by using the object-oriented Strategy design pattern which is easily implementable in C++. Perhaps coupled with the State pattern, ie store the relevant State variables (current price, position price, MA, etc) for each quote and pass the State object as a parameter to the Strategy subclass function to see if any order open/close/modify actions should be taken (different Strategy subclasses will make different decisions at this point). With design patterns your system components will be clean and well-encapsulated.

    Edit/Delete Quote Complain
    Page 1 of 4:   1  2  3  4  
Post A Reply


Receive an email whenever a new post is added to this thread by subscribing to it.
 
Rate This Thread:

Forum Jump:
 

 

   Conduct Rules  -  Privacy Policy  -  Day Trader -  Day Trader Forum -  Best Trading Software -  Sitemap Copyright © 2013, Elite Trader. All rights reserved.    
 
WHILE YOU'RE HERE, TAKE A MINUTE TO VISIT SOME OF OUR SPONSORS:
Advantage Futures
Futures Brokerage & Clearing
AMP Global Clearing
Futures and FX Trading
Bright Trading
Professional Equities Trading
CTS
Futures Trading Software
DaytradingBias.com
Professional Trading Analytics
ECHOtrade
Professional Trading Firm
eSignal
Trading Software Provider
FXCM
Forex Trading Services
Global Futures
Futures, Options & FX Trading
Interactive Brokers
Pro Gateway to World Markets
JC Trading Group
Direct Access Trading
MB Trading
Direct Access Trading
MultiCharts
Trading Software Provider
NinjaTrader
Trading Software Provider
OANDA
Currency Trading
optionshouse
Option Trading & Education
Rithmic
Futures Trade Execution Platform
SpeedTrader
Direct Access Trading
SpreadProfessor
Spread Trading Instruction
thinkorswim by TD Ameritrade
Direct Access TradingAdvertisement
TradersStudio
System Building & Backtesting
Trading Technologies
Trading Software Provider
Trend Following
Trading Systems Provider