This repository has been archived by the owner on Jan 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 503
/
ComboLeg.py
89 lines (77 loc) · 2.98 KB
/
ComboLeg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# Translated source for ComboLeg.
##
# Source file: ComboLeg.java
# Target file: ComboLeg.py
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
from ib.lib.overloading import overloaded
from ib.ext.Util import Util
class ComboLeg(object):
""" generated source for ComboLeg
"""
SAME = 0
OPEN = 1
CLOSE = 2
UNKNOWN = 3
m_conId = 0
m_ratio = 0
m_action = ""
m_exchange = ""
m_openClose = 0
m_shortSaleSlot = 0
m_designatedLocation = ""
m_exemptCode = 0
@overloaded
def __init__(self):
pass # super(ComboLeg, self).__init__(0, 0, None, None, 0, 0, None, -1)
@__init__.register(object, int, int, str, str, int)
def __init___0(self, p_conId,
p_ratio,
p_action,
p_exchange,
p_openClose):
pass # super(ComboLeg, self).__init__(p_conId, p_ratio, p_action, p_exchange, p_openClose, 0, None, -1)
@__init__.register(object, int, int, str, str, int, int, str)
def __init___1(self, p_conId,
p_ratio,
p_action,
p_exchange,
p_openClose,
p_shortSaleSlot,
p_designatedLocation):
pass # super(ComboLeg, self).__init__(p_conId, p_ratio, p_action, p_exchange, p_openClose, p_shortSaleSlot, p_designatedLocation, -1)
@__init__.register(object, int, int, str, str, int, int, str, int)
def __init___2(self, p_conId,
p_ratio,
p_action,
p_exchange,
p_openClose,
p_shortSaleSlot,
p_designatedLocation,
p_exemptCode):
self.m_conId = p_conId
self.m_ratio = p_ratio
self.m_action = p_action
self.m_exchange = p_exchange
self.m_openClose = p_openClose
self.m_shortSaleSlot = p_shortSaleSlot
self.m_designatedLocation = p_designatedLocation
self.m_exemptCode = p_exemptCode
def __eq__(self, p_other):
if self is p_other:
return True
else:
if p_other is None:
return False
l_theOther = p_other
if (self.m_conId != l_theOther.m_conId) or (self.m_ratio != l_theOther.m_ratio) or (self.m_openClose != l_theOther.m_openClose) or (self.m_shortSaleSlot != l_theOther.m_shortSaleSlot) or (self.m_exemptCode != l_theOther.m_exemptCode):
return False
if (Util.StringCompareIgnCase(self.m_action, l_theOther.m_action) != 0) or (Util.StringCompareIgnCase(self.m_exchange, l_theOther.m_exchange) != 0) or (Util.StringCompareIgnCase(self.m_designatedLocation, l_theOther.m_designatedLocation) != 0):
return False
return True