Ozgay / truetrade

Automatically exported from code.google.com/p/truetrade
0 stars 0 forks source link

Orders should allow exits to be attached #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When a strategy wishes to add an exit, it must override the onOrderFilled()
method, use the text property of the order to infer which order was filled
(make sure it was an entry not an exit) and then guess at an appropriate
exit.  All of these are known at the time when the order is placed, and so
this should all be entered when the initial order is made.

Perhaps:

JOrder entry = buyOrder();
JOrder exit = sellStopOrder(exitPrice);
entry.addExit(exit)
sendOrder(entry);

Then OrderManager would be responsible for issuing the exit order whenever
the entry is filled.  It should issue an exit for partial fills as well,
and do some sort of order consolidation.  This is complex and should all be
placed in a single location instead of scattered everywhere.

Original issue reported on code.google.com by tyrotra...@gmail.com on 28 Apr 2007 at 12:14

GoogleCodeExporter commented 9 years ago
Feature deferred until after the beta release.

Original comment by tyrotra...@gmail.com on 29 Apr 2007 at 1:50