Ejemplo n.º 1
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='CALL',
            side='SELL',
            quantity=-1,
            strike=43,
            price=1.42,
            net_price=-0.58
        )

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='CALL',
            side='BUY',
            quantity=2,
            strike=46,
            price=.42,
            net_price=0.0
        )

        self.contract_right = 100

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

        self.long_call_backratio = StageLongCallBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 2
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="COMBO",
            contract="CALL",
            side="BUY",
            quantity=1,
            strike=211,
            price=2.26,
            net_price=-0.46,
        )

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="COMBO",
            contract="PUT",
            side="SELL",
            quantity=-1,
            strike=204,
            price=2.72,
            net_price=0.0,
        )

        self.contract_right = 100

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

        self.long_combo = StageLongCombo(filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 3
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.call_order = create_filled_order(trade_summary=self.trade_summary,
                                              underlying=self.underlying,
                                              spread='COMBO',
                                              contract='CALL',
                                              side='BUY',
                                              quantity=1,
                                              strike=211,
                                              price=2.26,
                                              net_price=-0.46)

        self.put_order = create_filled_order(trade_summary=self.trade_summary,
                                             underlying=self.underlying,
                                             spread='COMBO',
                                             contract='PUT',
                                             side='SELL',
                                             quantity=-1,
                                             strike=204,
                                             price=2.72,
                                             net_price=0.0)

        self.contract_right = 100

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

        self.long_combo = StageLongCombo(filled_orders=filled_orders,
                                         contract_right=self.contract_right)
Ejemplo n.º 4
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='SELL',
            quantity=-1,
            strike=125,
            price=6.15,
            net_price=1.75
        )

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='BUY',
            quantity=2,
            strike=120,
            price=3.95,
            net_price=0.0
        )

        self.contract_right = 100

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

        self.long_put_backratio = StageLongPutBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 5
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.sell_order = create_filled_order(trade_summary=self.trade_summary,
                                              underlying=self.underlying,
                                              spread='BACKRATIO',
                                              contract='CALL',
                                              side='SELL',
                                              quantity=-1,
                                              strike=43,
                                              price=1.42,
                                              net_price=-0.58)

        self.buy_order = create_filled_order(trade_summary=self.trade_summary,
                                             underlying=self.underlying,
                                             spread='BACKRATIO',
                                             contract='CALL',
                                             side='BUY',
                                             quantity=2,
                                             strike=46,
                                             price=.42,
                                             net_price=0.0)

        self.contract_right = 100

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

        self.long_call_backratio = StageLongCallBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 6
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='BUY',
            quantity=1,
            strike=380,
            price=23.2,
            net_price=0.0
        )

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='SELL',
            quantity=-2,
            strike=355,
            price=11.6,
            net_price=0.0
        )

        self.contract_right = 100

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

        self.short_put_backratio = StageShortPutBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 7
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='BUY',
            quantity=1,
            strike=125,
            price=6.15,
            net_price=-1.75
        )

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='BACKRATIO',
            contract='PUT',
            side='SELL',
            quantity=-2,
            strike=120,
            price=3.95,
            net_price=0.0
        )

        self.contract_right = 100

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

        self.short_put_backratio = StageShortPutBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 8
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.sell_order = create_filled_order(trade_summary=self.trade_summary,
                                              underlying=self.underlying,
                                              spread='BACKRATIO',
                                              contract='PUT',
                                              side='SELL',
                                              quantity=-1,
                                              strike=380,
                                              price=23.2,
                                              net_price=0.0)

        self.buy_order = create_filled_order(trade_summary=self.trade_summary,
                                             underlying=self.underlying,
                                             spread='BACKRATIO',
                                             contract='PUT',
                                             side='BUY',
                                             quantity=2,
                                             strike=355,
                                             price=11.6,
                                             net_price=0.0)

        self.contract_right = 100

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

        self.long_put_backratio = StageLongPutBackratio(
            filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 9
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='COMBO',
            contract='CALL',
            side='SELL',
            quantity=-1,
            strike=211,
            price=2.26,
            net_price=0.0
        )

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='COMBO',
            contract='PUT',
            side='BUY',
            quantity=1,
            strike=204,
            price=2.72,
            net_price=0.46
        )

        self.contract_right = 100

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

        self.short_combo = StageShortCombo(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 10
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'buy_put': {
                'contract': 'CALL',
                'side': 'BUY',
                'quantity': +1,
                'strike': 25,
                'price': 0.65,
                'net_price': 0.0
            },
            'sell_put': {
                'contract': 'PUT',
                'side': 'SELL',
                'quantity': -1,
                'strike': 27,
                'price': 1.91,
                'net_price': -1.26
            },
        }

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='VERTICAL',
            contract=self.orders['buy_put']['contract'],
            side=self.orders['buy_put']['side'],
            quantity=self.orders['buy_put']['quantity'],
            strike=self.orders['buy_put']['strike'],
            price=self.orders['buy_put']['price'],
            net_price=self.orders['buy_put']['net_price'])

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='VERTICAL',
            contract=self.orders['sell_put']['contract'],
            side=self.orders['sell_put']['side'],
            quantity=self.orders['sell_put']['quantity'],
            strike=self.orders['sell_put']['strike'],
            price=self.orders['sell_put']['price'],
            net_price=self.orders['sell_put']['net_price'])

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

        self.contract_right = 100

        self.short_put_vertical = StageShortPutVertical(
            filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 11
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            "buy_put": {
                "contract": "CALL",
                "side": "BUY",
                "quantity": +1,
                "strike": 26,
                "price": 1.2,
                "net_price": 0.0,
            },
            "sell_put": {
                "contract": "PUT",
                "side": "SELL",
                "quantity": -1,
                "strike": 25,
                "price": 0.65,
                "net_price": 0.55,
            },
        }

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="VERTICAL",
            contract=self.orders["buy_put"]["contract"],
            side=self.orders["buy_put"]["side"],
            quantity=self.orders["buy_put"]["quantity"],
            strike=self.orders["buy_put"]["strike"],
            price=self.orders["buy_put"]["price"],
            net_price=self.orders["buy_put"]["net_price"],
        )

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="VERTICAL",
            contract=self.orders["sell_put"]["contract"],
            side=self.orders["sell_put"]["side"],
            quantity=self.orders["sell_put"]["quantity"],
            strike=self.orders["sell_put"]["strike"],
            price=self.orders["sell_put"]["price"],
            net_price=self.orders["sell_put"]["net_price"],
        )

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

        self.contract_right = 100

        self.long_put_vertical = StageLongPutVertical(filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 12
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            "buy_call": {
                "contract": "CALL",
                "side": "BUY",
                "quantity": +1,
                "strike": 85,
                "price": 1.18,
                "net_price": 2.55,
            },
            "buy_put": {
                "contract": "PUT",
                "side": "BUY",
                "quantity": +1,
                "strike": 80,
                "price": 1.37,
                "net_price": 0.0,
            },
        }

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="STRANGLE",
            contract=self.orders["buy_call"]["contract"],
            side=self.orders["buy_call"]["side"],
            quantity=self.orders["buy_call"]["quantity"],
            strike=self.orders["buy_call"]["strike"],
            price=self.orders["buy_call"]["price"],
            net_price=self.orders["buy_call"]["net_price"],
        )

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="STRANGLE",
            contract=self.orders["buy_put"]["contract"],
            side=self.orders["buy_put"]["side"],
            quantity=self.orders["buy_put"]["quantity"],
            strike=self.orders["buy_put"]["strike"],
            price=self.orders["buy_put"]["price"],
            net_price=self.orders["buy_put"]["net_price"],
        )

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

        self.contract_right = 100

        self.long_strangle = StageLongStrangle(filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 13
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'sell_call': {
                'contract': 'CALL',
                'side': 'SELL',
                'quantity': -1,
                'strike': 54,
                'price': 0.92,
                'net_price': 0.0
            },
            'sell_put': {
                'contract': 'PUT',
                'side': 'SELL',
                'quantity': -1,
                'strike': 54,
                'price': 0.77,
                'net_price': 1.69
            },
        }

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['sell_call']['contract'],
            side=self.orders['sell_call']['side'],
            quantity=self.orders['sell_call']['quantity'],
            strike=self.orders['sell_call']['strike'],
            price=self.orders['sell_call']['price'],
            net_price=self.orders['sell_call']['net_price'])

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['sell_put']['contract'],
            side=self.orders['sell_put']['side'],
            quantity=self.orders['sell_put']['quantity'],
            strike=self.orders['sell_put']['strike'],
            price=self.orders['sell_put']['price'],
            net_price=self.orders['sell_put']['net_price'])

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

        self.contract_right = 100

        self.short_strangle = StageShortStraddle(
            filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 14
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'buy_call': {
                'contract': 'CALL',
                'side': 'BUY',
                'quantity': +1,
                'strike': 120,
                'price': 2.49,
                'net_price': 0.0
            },
            'buy_put': {
                'contract': 'PUT',
                'side': 'BUY',
                'quantity': +1,
                'strike': 120,
                'price': 2.16,
                'net_price': 4.65
            },
        }

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['buy_call']['contract'],
            side=self.orders['buy_call']['side'],
            quantity=self.orders['buy_call']['quantity'],
            strike=self.orders['buy_call']['strike'],
            price=self.orders['buy_call']['price'],
            net_price=self.orders['buy_call']['net_price'])

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['buy_put']['contract'],
            side=self.orders['buy_put']['side'],
            quantity=self.orders['buy_put']['quantity'],
            strike=self.orders['buy_put']['strike'],
            price=self.orders['buy_put']['price'],
            net_price=self.orders['buy_put']['net_price'])

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

        self.contract_right = 100

        self.long_strangle = StageLongStraddle(
            filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 15
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.forex_order = create_filled_order(
            trade_summary=self.trade_summary,
            forex=self.forex,
            spread='FOREX',
            contract='FOREX',
            side='SELL',
            quantity=-10000,
            price=120.1295)

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

        self.long_stock = StageShortForex(filled_orders=filled_orders)
Ejemplo n.º 16
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.stock_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STOCK',
            contract='ETF',
            side='SELL',
            quantity=-10,
            price=126.03)

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

        self.long_stock = StageShortStock(filled_orders=filled_orders)
Ejemplo n.º 17
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.future_order = create_filled_order(
            trade_summary=self.trade_summary,
            future=self.future,
            spread='FUTURE',
            contract='FUTURE',
            side='BUY',
            quantity=1,
            price=480.00,
            net_price=480.00)

        filled_orders = FilledOrder.objects.filter(future=self.future).all()

        self.long_future = StageLongFuture(filled_orders=filled_orders)
Ejemplo n.º 18
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.future_order = create_filled_order(
            trade_summary=self.trade_summary,
            future=self.future,
            spread='FUTURE',
            contract='FUTURE',
            side='SELL',
            quantity=-1,
            price=484.25,
            net_price=484.25)

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

        self.long_stock = StageShortFuture(filled_orders=filled_orders)
Ejemplo n.º 19
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.stock_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STOCK',
            contract='ETF',
            side='BUY',
            quantity=10,
            price=374.24
        )

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

        self.long_stock = StageLongStock(filled_orders=filled_orders)
Ejemplo n.º 20
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.stock_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="STOCK",
            contract="ETF",
            side="SELL",
            quantity=-10,
            price=126.03,
        )

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

        self.long_stock = StageShortStock(filled_orders=filled_orders)
Ejemplo n.º 21
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.forex_order = create_filled_order(
            trade_summary=self.trade_summary,
            forex=self.forex,
            spread='FOREX',
            contract='FOREX',
            side='SELL',
            quantity=-10000,
            price=120.1295
        )

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

        self.long_stock = StageShortForex(filled_orders=filled_orders)
Ejemplo n.º 22
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)
Ejemplo n.º 23
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'stock': {
                'contract': 'STOCK',
                'side': 'BUY',
                'quantity': +100,
                'strike': 0,
                'price': 85.5,
                'net_price': 0.0
            },
            'option': {
                'contract': 'CALL',
                'side': 'SELL',
                'quantity': -1,
                'strike': 85,
                'price': 2.2,
                'net_price': 83.3
            },
        }

        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_call = StageCoveredCall(filled_orders=filled_orders)
Ejemplo n.º 24
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.future_order = create_filled_order(
            trade_summary=self.trade_summary,
            future=self.future,
            spread='FUTURE',
            contract='FUTURE',
            side='SELL',
            quantity=-1,
            price=484.25,
            net_price=484.25
        )

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

        self.long_stock = StageShortFuture(filled_orders=filled_orders)
Ejemplo n.º 25
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.forex_order = create_filled_order(
            trade_summary=self.trade_summary,
            forex=self.forex,
            spread='FOREX',
            contract='FOREX',
            side='BUY',
            quantity=10000,
            price=120.1295)

        self.price_range = 0.2

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

        self.long_future = StageLongForex(filled_orders=filled_orders)
Ejemplo n.º 26
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.future_order = create_filled_order(
            trade_summary=self.trade_summary,
            future=self.future,
            spread='FUTURE',
            contract='FUTURE',
            side='BUY',
            quantity=1,
            price=480.00,
            net_price=480.00
        )

        filled_orders = FilledOrder.objects.filter(future=self.future).all()

        self.long_future = StageLongFuture(filled_orders=filled_orders)
Ejemplo n.º 27
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.forex_order = create_filled_order(
            trade_summary=self.trade_summary,
            forex=self.forex,
            spread='FOREX',
            contract='FOREX',
            side='BUY',
            quantity=10000,
            price=120.1295
        )

        self.price_range = 0.2

        filled_orders = FilledOrder.objects.filter(forex=self.forex)
        
        self.long_future = StageLongForex(filled_orders=filled_orders)
Ejemplo n.º 28
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.option_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='SINGLE',
            contract='CALL',
            side='SELL',
            quantity=-1,
            strike=66,
            price=2.95)

        self.contract_right = 100

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

        self.long_call = StageNakedCall(filled_orders=filled_orders,
                                        contract_right=self.contract_right)
Ejemplo n.º 29
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.option_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread="SINGLE",
            contract="PUT",
            side="BUY",
            quantity=1,
            strike=125,
            price=3.93,
        )

        self.contract_right = 100

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

        self.long_put = StageLongPut(filled_orders=filled_orders, contract_right=self.contract_right)
Ejemplo n.º 30
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'sell_call': {'contract': 'CALL', 'side': 'SELL', 'quantity': -1,
                          'strike': 54, 'price': 0.92, 'net_price': 0.0},
            'sell_put': {'contract': 'PUT', 'side': 'SELL', 'quantity': -1,
                         'strike': 54, 'price': 0.77, 'net_price': 1.69},
        }

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['sell_call']['contract'],
            side=self.orders['sell_call']['side'],
            quantity=self.orders['sell_call']['quantity'],
            strike=self.orders['sell_call']['strike'],
            price=self.orders['sell_call']['price'],
            net_price=self.orders['sell_call']['net_price']
        )

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['sell_put']['contract'],
            side=self.orders['sell_put']['side'],
            quantity=self.orders['sell_put']['quantity'],
            strike=self.orders['sell_put']['strike'],
            price=self.orders['sell_put']['price'],
            net_price=self.orders['sell_put']['net_price']
        )

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

        self.contract_right = 100

        self.short_strangle = StageShortStraddle(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 31
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'buy_call': {'contract': 'CALL', 'side': 'BUY', 'quantity': +1,
                         'strike': 80, 'price': 3.15, 'net_price': 0.0},
            'sell_call': {'contract': 'PUT', 'side': 'SELL', 'quantity': -1,
                          'strike': 85, 'price': 1.51, 'net_price': 4.66},
        }

        self.buy_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='VERTICAL',
            contract=self.orders['buy_call']['contract'],
            side=self.orders['buy_call']['side'],
            quantity=self.orders['buy_call']['quantity'],
            strike=self.orders['buy_call']['strike'],
            price=self.orders['buy_call']['price'],
            net_price=self.orders['buy_call']['net_price']
        )

        self.sell_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='VERTICAL',
            contract=self.orders['sell_call']['contract'],
            side=self.orders['sell_call']['side'],
            quantity=self.orders['sell_call']['quantity'],
            strike=self.orders['sell_call']['strike'],
            price=self.orders['sell_call']['price'],
            net_price=self.orders['sell_call']['net_price']
        )

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

        self.contract_right = 100

        self.long_call_vertical = StageLongCallVertical(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 32
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'buy_call': {'contract': 'CALL', 'side': 'BUY', 'quantity': +1,
                         'strike': 120, 'price': 2.49, 'net_price': 0.0},
            'buy_put': {'contract': 'PUT', 'side': 'BUY', 'quantity': +1,
                        'strike': 120, 'price': 2.16, 'net_price': 4.65},
        }

        self.call_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['buy_call']['contract'],
            side=self.orders['buy_call']['side'],
            quantity=self.orders['buy_call']['quantity'],
            strike=self.orders['buy_call']['strike'],
            price=self.orders['buy_call']['price'],
            net_price=self.orders['buy_call']['net_price']
        )

        self.put_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='STRANGLE',
            contract=self.orders['buy_put']['contract'],
            side=self.orders['buy_put']['side'],
            quantity=self.orders['buy_put']['quantity'],
            strike=self.orders['buy_put']['strike'],
            price=self.orders['buy_put']['price'],
            net_price=self.orders['buy_put']['net_price']
        )

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

        self.contract_right = 100

        self.long_strangle = StageLongStraddle(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 33
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.option_order = create_filled_order(
            trade_summary=self.trade_summary,
            underlying=self.underlying,
            spread='SINGLE',
            contract='CALL',
            side='SELL',
            quantity=-1,
            strike=66,
            price=2.95
        )

        self.contract_right = 100

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

        self.long_call = StageNakedCall(
            filled_orders=filled_orders, contract_right=self.contract_right
        )
Ejemplo n.º 34
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'stock': {'contract': 'STOCK', 'side': 'BUY', 'quantity': +100,
                      'strike': 0, 'price': 85.5, 'net_price': 0.0},
            'option': {'contract': 'CALL', 'side': 'SELL', 'quantity': -1,
                       'strike': 85, 'price': 2.2, 'net_price': 83.3},
        }

        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_call = StageCoveredCall(filled_orders=filled_orders)
Ejemplo n.º 35
0
    def setUp(self):
        TestUnitSetUpStage.setUp(self)

        self.orders = {
            'stock': {'contract': 'STOCK', 'side': 'BUY', 'quantity': 100,
                      'strike': 0, 'price': 55.95, 'net_price': 0.0},
            'option': {'contract': 'PUT', 'side': 'BUY', '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.protective_put = StageProtectivePut(filled_orders=filled_orders)