Beispiel #1
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'stock': {
                'contract': 'STOCK',
                'side': 'SELL',
                'quantity': -100,
                'strike': 0,
                'price': 55.95,
                'net_price': 0.0
            },
            'option': {
                'contract': 'PUT',
                'side': 'SELL',
                'quantity': -1,
                'strike': 55,
                'price': 1.04,
                'net_price': 56.99
            },
        }

        self.stock_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='COVERED',
            contract=self.orders['stock']['contract'],
            side=self.orders['stock']['side'],
            quantity=self.orders['stock']['quantity'],
            strike=self.orders['stock']['strike'],
            price=self.orders['stock']['price'],
            net_price=self.orders['stock']['net_price'])

        self.option_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='COVERED',
            contract=self.orders['option']['contract'],
            side=self.orders['option']['side'],
            quantity=self.orders['option']['quantity'],
            strike=self.orders['option']['strike'],
            price=self.orders['option']['price'],
            net_price=self.orders['option']['net_price'])

        filled_orders = FilledOrder.objects.filter(underlying=self.underlying)

        self.covered_put = StageCoveredPut(filled_orders=filled_orders)