MOO & MOC Orders

Are MOO & MOC orders working? A script that I was using stopped working after the weekend update. Thanks.

Best Answer

  • ptunneyptunney Posts: 246
    Answer ✓

    Just tested with the following code run from 9:15 to 16:15 to allow the orders to be entered for the MOO and to be executed for the MOC.
    Tried in Elite and Lite(Fast mode). Both working fine.

    # Run 09:15 to 09:30
    from cloudquant.interfaces import Strategy
    class New_Order_Method_MOO_MOC(Strategy):
        def is_symbol_qualified(cls, symbol, md, service, account):
            return symbol in ['EEM','EWZ']
        def on_start(self, md, order, service, account):
            order.send(self.symbol, 'sell', 100, type='MOO') 
            order.send(self.symbol, 'buy', 100, type='MOC') 
        def on_fill(self, event, md, order, service, account): 
            print "{} - Filled MOO {} Price{:8.2f}".format(service.time_to_string(event.timestamp),self.symbol.ljust(6),event.price)
Sign In or Register to comment.