MOO & MOC Orders
bl116904
Posts: 2
in Report a Bug
Are MOO & MOC orders working? A script that I was using stopped working after the weekend update. Thanks.
Best Answer
-
ptunney Posts: 246
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): @classmethod 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)