PaperBroker STOP_LIMIT Order support

View: New views
2 Messages — Rating Filter:   Alert me  

PaperBroker STOP_LIMIT Order support

by Dimitri Misev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
I was looking to add a STOP_LIMIT Order support in the org.activequant.broker.PaperBroker class

Looks like I just need to add this one case to the switch statement in
the void checkOrder(Quote quote) method in the same class:

case STOP_LIMIT:
        if(localOrder.getOrderSide() == OrderSide.BUY) {
                        if(price >= localOrder.getStopPrice()&&price <= localOrder.getLimitPrice()) {
                                fireExecution(quantity, price);
                        }
                } else {
                        if(price <= localOrder.getStopPrice()&&price >= localOrder.getLimitPrice()) {
                                fireExecution(quantity, price);
                        }
                }
                break;

Does anyone see a problem with this?

Re: PaperBroker STOP_LIMIT Order support

by Ulrich Staudinger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks alright. Will be added later as well !



On Sun, Nov 1, 2009 at 11:26 PM, Dimitri Misev <mikistip@...> wrote:

Hi
I was looking to add a STOP_LIMIT Order support in the
org.activequant.broker.PaperBroker class

Looks like I just need to add this one case to the switch statement in
the void checkOrder(Quote quote) method in the same class:

case STOP_LIMIT:
       if(localOrder.getOrderSide() == OrderSide.BUY) {
                       if(price >= localOrder.getStopPrice()&&price <=
localOrder.getLimitPrice()) {
                               fireExecution(quantity, price);
                       }
               } else {
                       if(price <= localOrder.getStopPrice()&&price >=
localOrder.getLimitPrice()) {
                               fireExecution(quantity, price);
                       }
               }
               break;

Does anyone see a problem with this?
--
View this message in context: http://old.nabble.com/PaperBroker-STOP_LIMIT-Order-support-tp26154645p26154645.html
Sent from the ActiveQuant mailing list archive at Nabble.com.

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi



--
Ulrich B. Staudinger

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi