forked from Komnomnomnom/swigibpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswigibpy.py
1325 lines (1145 loc) · 69.4 KB
/
swigibpy.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
Python wrapper for Interactive Brokers TWS C++ API
"""
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _swigibpy.SWIG_PyInstanceMethod_New(func)
else:
from new import instancemethod as new_instancemethod
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_swigibpy', [dirname(__file__)])
except ImportError:
import _swigibpy
return _swigibpy
if fp is not None:
try:
_mod = imp.load_module('_swigibpy', fp, pathname, description)
finally:
fp.close()
return _mod
_swigibpy = swig_import_helper()
del swig_import_helper
else:
import _swigibpy
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
def _swig_setattr_nondynamic_method(set):
def set_attr(self,name,value):
if (name == "thisown"): return self.this.own(value)
if hasattr(self,name) or (name == "this"):
set(self,name,value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
return set_attr
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
GROUPS = _swigibpy.GROUPS
PROFILES = _swigibpy.PROFILES
ALIASES = _swigibpy.ALIASES
def faDataTypeStr(*args):
"""faDataTypeStr(faDataType pFaDataType) -> char"""
return _swigibpy.faDataTypeStr(*args)
SAME_POS = _swigibpy.SAME_POS
OPEN_POS = _swigibpy.OPEN_POS
CLOSE_POS = _swigibpy.CLOSE_POS
UNKNOWN_POS = _swigibpy.UNKNOWN_POS
class ComboLeg(object):
"""Proxy of C++ ComboLeg class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> ComboLeg"""
_swigibpy.ComboLeg_swiginit(self,_swigibpy.new_ComboLeg())
conId = _swig_property(_swigibpy.ComboLeg_conId_get, _swigibpy.ComboLeg_conId_set)
ratio = _swig_property(_swigibpy.ComboLeg_ratio_get, _swigibpy.ComboLeg_ratio_set)
action = _swig_property(_swigibpy.ComboLeg_action_get, _swigibpy.ComboLeg_action_set)
exchange = _swig_property(_swigibpy.ComboLeg_exchange_get, _swigibpy.ComboLeg_exchange_set)
openClose = _swig_property(_swigibpy.ComboLeg_openClose_get, _swigibpy.ComboLeg_openClose_set)
shortSaleSlot = _swig_property(_swigibpy.ComboLeg_shortSaleSlot_get, _swigibpy.ComboLeg_shortSaleSlot_set)
designatedLocation = _swig_property(_swigibpy.ComboLeg_designatedLocation_get, _swigibpy.ComboLeg_designatedLocation_set)
exemptCode = _swig_property(_swigibpy.ComboLeg_exemptCode_get, _swigibpy.ComboLeg_exemptCode_set)
def __eq__(self, *args):
"""__eq__(self, ComboLeg other) -> bool"""
return _swigibpy.ComboLeg___eq__(self, *args)
__swig_destroy__ = _swigibpy.delete_ComboLeg
ComboLeg.__eq__ = new_instancemethod(_swigibpy.ComboLeg___eq__,None,ComboLeg)
ComboLeg_swigregister = _swigibpy.ComboLeg_swigregister
ComboLeg_swigregister(ComboLeg)
class UnderComp(object):
"""Proxy of C++ UnderComp class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> UnderComp"""
_swigibpy.UnderComp_swiginit(self,_swigibpy.new_UnderComp())
conId = _swig_property(_swigibpy.UnderComp_conId_get, _swigibpy.UnderComp_conId_set)
delta = _swig_property(_swigibpy.UnderComp_delta_get, _swigibpy.UnderComp_delta_set)
price = _swig_property(_swigibpy.UnderComp_price_get, _swigibpy.UnderComp_price_set)
__swig_destroy__ = _swigibpy.delete_UnderComp
UnderComp_swigregister = _swigibpy.UnderComp_swigregister
UnderComp_swigregister(UnderComp)
class Contract(object):
"""Proxy of C++ Contract class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Contract"""
_swigibpy.Contract_swiginit(self,_swigibpy.new_Contract())
conId = _swig_property(_swigibpy.Contract_conId_get, _swigibpy.Contract_conId_set)
symbol = _swig_property(_swigibpy.Contract_symbol_get, _swigibpy.Contract_symbol_set)
secType = _swig_property(_swigibpy.Contract_secType_get, _swigibpy.Contract_secType_set)
expiry = _swig_property(_swigibpy.Contract_expiry_get, _swigibpy.Contract_expiry_set)
strike = _swig_property(_swigibpy.Contract_strike_get, _swigibpy.Contract_strike_set)
right = _swig_property(_swigibpy.Contract_right_get, _swigibpy.Contract_right_set)
multiplier = _swig_property(_swigibpy.Contract_multiplier_get, _swigibpy.Contract_multiplier_set)
exchange = _swig_property(_swigibpy.Contract_exchange_get, _swigibpy.Contract_exchange_set)
primaryExchange = _swig_property(_swigibpy.Contract_primaryExchange_get, _swigibpy.Contract_primaryExchange_set)
currency = _swig_property(_swigibpy.Contract_currency_get, _swigibpy.Contract_currency_set)
localSymbol = _swig_property(_swigibpy.Contract_localSymbol_get, _swigibpy.Contract_localSymbol_set)
includeExpired = _swig_property(_swigibpy.Contract_includeExpired_get, _swigibpy.Contract_includeExpired_set)
secIdType = _swig_property(_swigibpy.Contract_secIdType_get, _swigibpy.Contract_secIdType_set)
secId = _swig_property(_swigibpy.Contract_secId_get, _swigibpy.Contract_secId_set)
comboLegsDescrip = _swig_property(_swigibpy.Contract_comboLegsDescrip_get, _swigibpy.Contract_comboLegsDescrip_set)
comboLegs = _swig_property(_swigibpy.Contract_comboLegs_get, _swigibpy.Contract_comboLegs_set)
underComp = _swig_property(_swigibpy.Contract_underComp_get, _swigibpy.Contract_underComp_set)
def CloneComboLegs(*args):
"""CloneComboLegs(ComboLegList dst, ComboLegList src)"""
return _swigibpy.Contract_CloneComboLegs(*args)
CloneComboLegs = staticmethod(CloneComboLegs)
def CleanupComboLegs(*args):
"""CleanupComboLegs(ComboLegList arg0)"""
return _swigibpy.Contract_CleanupComboLegs(*args)
CleanupComboLegs = staticmethod(CleanupComboLegs)
__swig_destroy__ = _swigibpy.delete_Contract
Contract_swigregister = _swigibpy.Contract_swigregister
Contract_swigregister(Contract)
def Contract_CloneComboLegs(*args):
"""Contract_CloneComboLegs(ComboLegList dst, ComboLegList src)"""
return _swigibpy.Contract_CloneComboLegs(*args)
def Contract_CleanupComboLegs(*args):
"""Contract_CleanupComboLegs(ComboLegList arg0)"""
return _swigibpy.Contract_CleanupComboLegs(*args)
class ContractDetails(object):
"""Proxy of C++ ContractDetails class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> ContractDetails"""
_swigibpy.ContractDetails_swiginit(self,_swigibpy.new_ContractDetails())
summary = _swig_property(_swigibpy.ContractDetails_summary_get, _swigibpy.ContractDetails_summary_set)
marketName = _swig_property(_swigibpy.ContractDetails_marketName_get, _swigibpy.ContractDetails_marketName_set)
tradingClass = _swig_property(_swigibpy.ContractDetails_tradingClass_get, _swigibpy.ContractDetails_tradingClass_set)
minTick = _swig_property(_swigibpy.ContractDetails_minTick_get, _swigibpy.ContractDetails_minTick_set)
orderTypes = _swig_property(_swigibpy.ContractDetails_orderTypes_get, _swigibpy.ContractDetails_orderTypes_set)
validExchanges = _swig_property(_swigibpy.ContractDetails_validExchanges_get, _swigibpy.ContractDetails_validExchanges_set)
priceMagnifier = _swig_property(_swigibpy.ContractDetails_priceMagnifier_get, _swigibpy.ContractDetails_priceMagnifier_set)
underConId = _swig_property(_swigibpy.ContractDetails_underConId_get, _swigibpy.ContractDetails_underConId_set)
longName = _swig_property(_swigibpy.ContractDetails_longName_get, _swigibpy.ContractDetails_longName_set)
contractMonth = _swig_property(_swigibpy.ContractDetails_contractMonth_get, _swigibpy.ContractDetails_contractMonth_set)
industry = _swig_property(_swigibpy.ContractDetails_industry_get, _swigibpy.ContractDetails_industry_set)
category = _swig_property(_swigibpy.ContractDetails_category_get, _swigibpy.ContractDetails_category_set)
subcategory = _swig_property(_swigibpy.ContractDetails_subcategory_get, _swigibpy.ContractDetails_subcategory_set)
timeZoneId = _swig_property(_swigibpy.ContractDetails_timeZoneId_get, _swigibpy.ContractDetails_timeZoneId_set)
tradingHours = _swig_property(_swigibpy.ContractDetails_tradingHours_get, _swigibpy.ContractDetails_tradingHours_set)
liquidHours = _swig_property(_swigibpy.ContractDetails_liquidHours_get, _swigibpy.ContractDetails_liquidHours_set)
cusip = _swig_property(_swigibpy.ContractDetails_cusip_get, _swigibpy.ContractDetails_cusip_set)
ratings = _swig_property(_swigibpy.ContractDetails_ratings_get, _swigibpy.ContractDetails_ratings_set)
descAppend = _swig_property(_swigibpy.ContractDetails_descAppend_get, _swigibpy.ContractDetails_descAppend_set)
bondType = _swig_property(_swigibpy.ContractDetails_bondType_get, _swigibpy.ContractDetails_bondType_set)
couponType = _swig_property(_swigibpy.ContractDetails_couponType_get, _swigibpy.ContractDetails_couponType_set)
callable = _swig_property(_swigibpy.ContractDetails_callable_get, _swigibpy.ContractDetails_callable_set)
putable = _swig_property(_swigibpy.ContractDetails_putable_get, _swigibpy.ContractDetails_putable_set)
coupon = _swig_property(_swigibpy.ContractDetails_coupon_get, _swigibpy.ContractDetails_coupon_set)
convertible = _swig_property(_swigibpy.ContractDetails_convertible_get, _swigibpy.ContractDetails_convertible_set)
maturity = _swig_property(_swigibpy.ContractDetails_maturity_get, _swigibpy.ContractDetails_maturity_set)
issueDate = _swig_property(_swigibpy.ContractDetails_issueDate_get, _swigibpy.ContractDetails_issueDate_set)
nextOptionDate = _swig_property(_swigibpy.ContractDetails_nextOptionDate_get, _swigibpy.ContractDetails_nextOptionDate_set)
nextOptionType = _swig_property(_swigibpy.ContractDetails_nextOptionType_get, _swigibpy.ContractDetails_nextOptionType_set)
nextOptionPartial = _swig_property(_swigibpy.ContractDetails_nextOptionPartial_get, _swigibpy.ContractDetails_nextOptionPartial_set)
notes = _swig_property(_swigibpy.ContractDetails_notes_get, _swigibpy.ContractDetails_notes_set)
__swig_destroy__ = _swigibpy.delete_ContractDetails
ContractDetails_swigregister = _swigibpy.ContractDetails_swigregister
ContractDetails_swigregister(ContractDetails)
class EClient(object):
"""Proxy of C++ EClient class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _swigibpy.delete_EClient
def eConnect(self, *args):
"""
eConnect(self, char host, unsigned int port, int clientId = 0) -> bool
eConnect(self, char host, unsigned int port) -> bool
"""
return _swigibpy.EClient_eConnect(self, *args)
def eDisconnect(self):
"""eDisconnect(self)"""
return _swigibpy.EClient_eDisconnect(self)
def serverVersion(self):
"""serverVersion(self) -> int"""
return _swigibpy.EClient_serverVersion(self)
def TwsConnectionTime(self):
"""TwsConnectionTime(self) -> IBString"""
return _swigibpy.EClient_TwsConnectionTime(self)
def reqMktData(self, *args):
"""
reqMktData(self, TickerId id, Contract contract, IBString genericTicks,
bool snapshot)
"""
return _swigibpy.EClient_reqMktData(self, *args)
def cancelMktData(self, *args):
"""cancelMktData(self, TickerId id)"""
return _swigibpy.EClient_cancelMktData(self, *args)
def placeOrder(self, *args):
"""placeOrder(self, OrderId id, Contract contract, Order order)"""
return _swigibpy.EClient_placeOrder(self, *args)
def cancelOrder(self, *args):
"""cancelOrder(self, OrderId id)"""
return _swigibpy.EClient_cancelOrder(self, *args)
def reqOpenOrders(self):
"""reqOpenOrders(self)"""
return _swigibpy.EClient_reqOpenOrders(self)
def reqAccountUpdates(self, *args):
"""reqAccountUpdates(self, bool subscribe, IBString acctCode)"""
return _swigibpy.EClient_reqAccountUpdates(self, *args)
def reqExecutions(self, *args):
"""reqExecutions(self, int reqId, ExecutionFilter filter)"""
return _swigibpy.EClient_reqExecutions(self, *args)
def reqIds(self, *args):
"""reqIds(self, int numIds)"""
return _swigibpy.EClient_reqIds(self, *args)
def checkMessages(self):
"""checkMessages(self) -> bool"""
return _swigibpy.EClient_checkMessages(self)
def reqContractDetails(self, *args):
"""reqContractDetails(self, int reqId, Contract contract)"""
return _swigibpy.EClient_reqContractDetails(self, *args)
def reqMktDepth(self, *args):
"""reqMktDepth(self, TickerId id, Contract contract, int numRows)"""
return _swigibpy.EClient_reqMktDepth(self, *args)
def cancelMktDepth(self, *args):
"""cancelMktDepth(self, TickerId id)"""
return _swigibpy.EClient_cancelMktDepth(self, *args)
def reqNewsBulletins(self, *args):
"""reqNewsBulletins(self, bool allMsgs)"""
return _swigibpy.EClient_reqNewsBulletins(self, *args)
def cancelNewsBulletins(self):
"""cancelNewsBulletins(self)"""
return _swigibpy.EClient_cancelNewsBulletins(self)
def setServerLogLevel(self, *args):
"""setServerLogLevel(self, int level)"""
return _swigibpy.EClient_setServerLogLevel(self, *args)
def reqAutoOpenOrders(self, *args):
"""reqAutoOpenOrders(self, bool bAutoBind)"""
return _swigibpy.EClient_reqAutoOpenOrders(self, *args)
def reqAllOpenOrders(self):
"""reqAllOpenOrders(self)"""
return _swigibpy.EClient_reqAllOpenOrders(self)
def reqManagedAccts(self):
"""reqManagedAccts(self)"""
return _swigibpy.EClient_reqManagedAccts(self)
def requestFA(self, *args):
"""requestFA(self, faDataType pFaDataType)"""
return _swigibpy.EClient_requestFA(self, *args)
def replaceFA(self, *args):
"""replaceFA(self, faDataType pFaDataType, IBString cxml)"""
return _swigibpy.EClient_replaceFA(self, *args)
def reqHistoricalData(self, *args):
"""
reqHistoricalData(self, TickerId id, Contract contract, IBString endDateTime,
IBString durationStr, IBString barSizeSetting,
IBString whatToShow, int useRTH, int formatDate)
"""
return _swigibpy.EClient_reqHistoricalData(self, *args)
def exerciseOptions(self, *args):
"""
exerciseOptions(self, TickerId id, Contract contract, int exerciseAction,
int exerciseQuantity, IBString account, int override)
"""
return _swigibpy.EClient_exerciseOptions(self, *args)
def cancelHistoricalData(self, *args):
"""cancelHistoricalData(self, TickerId tickerId)"""
return _swigibpy.EClient_cancelHistoricalData(self, *args)
def reqRealTimeBars(self, *args):
"""
reqRealTimeBars(self, TickerId id, Contract contract, int barSize, IBString whatToShow,
bool useRTH)
"""
return _swigibpy.EClient_reqRealTimeBars(self, *args)
def cancelRealTimeBars(self, *args):
"""cancelRealTimeBars(self, TickerId tickerId)"""
return _swigibpy.EClient_cancelRealTimeBars(self, *args)
def cancelScannerSubscription(self, *args):
"""cancelScannerSubscription(self, int tickerId)"""
return _swigibpy.EClient_cancelScannerSubscription(self, *args)
def reqScannerParameters(self):
"""reqScannerParameters(self)"""
return _swigibpy.EClient_reqScannerParameters(self)
def reqScannerSubscription(self, *args):
"""reqScannerSubscription(self, int tickerId, ScannerSubscription subscription)"""
return _swigibpy.EClient_reqScannerSubscription(self, *args)
def reqCurrentTime(self):
"""reqCurrentTime(self)"""
return _swigibpy.EClient_reqCurrentTime(self)
def reqFundamentalData(self, *args):
"""reqFundamentalData(self, TickerId reqId, Contract arg1, IBString reportType)"""
return _swigibpy.EClient_reqFundamentalData(self, *args)
def cancelFundamentalData(self, *args):
"""cancelFundamentalData(self, TickerId reqId)"""
return _swigibpy.EClient_cancelFundamentalData(self, *args)
def calculateImpliedVolatility(self, *args):
"""
calculateImpliedVolatility(self, TickerId reqId, Contract contract, double optionPrice,
double underPrice)
"""
return _swigibpy.EClient_calculateImpliedVolatility(self, *args)
def calculateOptionPrice(self, *args):
"""
calculateOptionPrice(self, TickerId reqId, Contract contract, double volatility,
double underPrice)
"""
return _swigibpy.EClient_calculateOptionPrice(self, *args)
def cancelCalculateImpliedVolatility(self, *args):
"""cancelCalculateImpliedVolatility(self, TickerId reqId)"""
return _swigibpy.EClient_cancelCalculateImpliedVolatility(self, *args)
def cancelCalculateOptionPrice(self, *args):
"""cancelCalculateOptionPrice(self, TickerId reqId)"""
return _swigibpy.EClient_cancelCalculateOptionPrice(self, *args)
def reqGlobalCancel(self):
"""reqGlobalCancel(self)"""
return _swigibpy.EClient_reqGlobalCancel(self)
EClient.eConnect = new_instancemethod(_swigibpy.EClient_eConnect,None,EClient)
EClient.eDisconnect = new_instancemethod(_swigibpy.EClient_eDisconnect,None,EClient)
EClient.serverVersion = new_instancemethod(_swigibpy.EClient_serverVersion,None,EClient)
EClient.TwsConnectionTime = new_instancemethod(_swigibpy.EClient_TwsConnectionTime,None,EClient)
EClient.reqMktData = new_instancemethod(_swigibpy.EClient_reqMktData,None,EClient)
EClient.cancelMktData = new_instancemethod(_swigibpy.EClient_cancelMktData,None,EClient)
EClient.placeOrder = new_instancemethod(_swigibpy.EClient_placeOrder,None,EClient)
EClient.cancelOrder = new_instancemethod(_swigibpy.EClient_cancelOrder,None,EClient)
EClient.reqOpenOrders = new_instancemethod(_swigibpy.EClient_reqOpenOrders,None,EClient)
EClient.reqAccountUpdates = new_instancemethod(_swigibpy.EClient_reqAccountUpdates,None,EClient)
EClient.reqExecutions = new_instancemethod(_swigibpy.EClient_reqExecutions,None,EClient)
EClient.reqIds = new_instancemethod(_swigibpy.EClient_reqIds,None,EClient)
EClient.checkMessages = new_instancemethod(_swigibpy.EClient_checkMessages,None,EClient)
EClient.reqContractDetails = new_instancemethod(_swigibpy.EClient_reqContractDetails,None,EClient)
EClient.reqMktDepth = new_instancemethod(_swigibpy.EClient_reqMktDepth,None,EClient)
EClient.cancelMktDepth = new_instancemethod(_swigibpy.EClient_cancelMktDepth,None,EClient)
EClient.reqNewsBulletins = new_instancemethod(_swigibpy.EClient_reqNewsBulletins,None,EClient)
EClient.cancelNewsBulletins = new_instancemethod(_swigibpy.EClient_cancelNewsBulletins,None,EClient)
EClient.setServerLogLevel = new_instancemethod(_swigibpy.EClient_setServerLogLevel,None,EClient)
EClient.reqAutoOpenOrders = new_instancemethod(_swigibpy.EClient_reqAutoOpenOrders,None,EClient)
EClient.reqAllOpenOrders = new_instancemethod(_swigibpy.EClient_reqAllOpenOrders,None,EClient)
EClient.reqManagedAccts = new_instancemethod(_swigibpy.EClient_reqManagedAccts,None,EClient)
EClient.requestFA = new_instancemethod(_swigibpy.EClient_requestFA,None,EClient)
EClient.replaceFA = new_instancemethod(_swigibpy.EClient_replaceFA,None,EClient)
EClient.reqHistoricalData = new_instancemethod(_swigibpy.EClient_reqHistoricalData,None,EClient)
EClient.exerciseOptions = new_instancemethod(_swigibpy.EClient_exerciseOptions,None,EClient)
EClient.cancelHistoricalData = new_instancemethod(_swigibpy.EClient_cancelHistoricalData,None,EClient)
EClient.reqRealTimeBars = new_instancemethod(_swigibpy.EClient_reqRealTimeBars,None,EClient)
EClient.cancelRealTimeBars = new_instancemethod(_swigibpy.EClient_cancelRealTimeBars,None,EClient)
EClient.cancelScannerSubscription = new_instancemethod(_swigibpy.EClient_cancelScannerSubscription,None,EClient)
EClient.reqScannerParameters = new_instancemethod(_swigibpy.EClient_reqScannerParameters,None,EClient)
EClient.reqScannerSubscription = new_instancemethod(_swigibpy.EClient_reqScannerSubscription,None,EClient)
EClient.reqCurrentTime = new_instancemethod(_swigibpy.EClient_reqCurrentTime,None,EClient)
EClient.reqFundamentalData = new_instancemethod(_swigibpy.EClient_reqFundamentalData,None,EClient)
EClient.cancelFundamentalData = new_instancemethod(_swigibpy.EClient_cancelFundamentalData,None,EClient)
EClient.calculateImpliedVolatility = new_instancemethod(_swigibpy.EClient_calculateImpliedVolatility,None,EClient)
EClient.calculateOptionPrice = new_instancemethod(_swigibpy.EClient_calculateOptionPrice,None,EClient)
EClient.cancelCalculateImpliedVolatility = new_instancemethod(_swigibpy.EClient_cancelCalculateImpliedVolatility,None,EClient)
EClient.cancelCalculateOptionPrice = new_instancemethod(_swigibpy.EClient_cancelCalculateOptionPrice,None,EClient)
EClient.reqGlobalCancel = new_instancemethod(_swigibpy.EClient_reqGlobalCancel,None,EClient)
EClient_swigregister = _swigibpy.EClient_swigregister
EClient_swigregister(EClient)
class EClientSocketBase(EClient):
"""Proxy of C++ EClientSocketBase class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _swigibpy.delete_EClientSocketBase
def eConnect(self, *args):
"""
eConnect(self, char host, unsigned int port, int clientId = 0) -> bool
eConnect(self, char host, unsigned int port) -> bool
"""
return _swigibpy.EClientSocketBase_eConnect(self, *args)
def eDisconnect(self):
"""eDisconnect(self)"""
return _swigibpy.EClientSocketBase_eDisconnect(self)
def isConnected(self):
"""isConnected(self) -> bool"""
return _swigibpy.EClientSocketBase_isConnected(self)
def isInBufferEmpty(self):
"""isInBufferEmpty(self) -> bool"""
return _swigibpy.EClientSocketBase_isInBufferEmpty(self)
def isOutBufferEmpty(self):
"""isOutBufferEmpty(self) -> bool"""
return _swigibpy.EClientSocketBase_isOutBufferEmpty(self)
def serverVersion(self):
"""serverVersion(self) -> int"""
return _swigibpy.EClientSocketBase_serverVersion(self)
def TwsConnectionTime(self):
"""TwsConnectionTime(self) -> IBString"""
return _swigibpy.EClientSocketBase_TwsConnectionTime(self)
def reqMktData(self, *args):
"""
reqMktData(self, TickerId id, Contract contract, IBString genericTicks,
bool snapshot)
"""
return _swigibpy.EClientSocketBase_reqMktData(self, *args)
def cancelMktData(self, *args):
"""cancelMktData(self, TickerId id)"""
return _swigibpy.EClientSocketBase_cancelMktData(self, *args)
def placeOrder(self, *args):
"""placeOrder(self, OrderId id, Contract contract, Order order)"""
return _swigibpy.EClientSocketBase_placeOrder(self, *args)
def cancelOrder(self, *args):
"""cancelOrder(self, OrderId id)"""
return _swigibpy.EClientSocketBase_cancelOrder(self, *args)
def reqOpenOrders(self):
"""reqOpenOrders(self)"""
return _swigibpy.EClientSocketBase_reqOpenOrders(self)
def reqAccountUpdates(self, *args):
"""reqAccountUpdates(self, bool subscribe, IBString acctCode)"""
return _swigibpy.EClientSocketBase_reqAccountUpdates(self, *args)
def reqExecutions(self, *args):
"""reqExecutions(self, int reqId, ExecutionFilter filter)"""
return _swigibpy.EClientSocketBase_reqExecutions(self, *args)
def reqIds(self, *args):
"""reqIds(self, int numIds)"""
return _swigibpy.EClientSocketBase_reqIds(self, *args)
def checkMessages(self):
"""checkMessages(self) -> bool"""
return _swigibpy.EClientSocketBase_checkMessages(self)
def reqContractDetails(self, *args):
"""reqContractDetails(self, int reqId, Contract contract)"""
return _swigibpy.EClientSocketBase_reqContractDetails(self, *args)
def reqMktDepth(self, *args):
"""reqMktDepth(self, TickerId tickerId, Contract contract, int numRows)"""
return _swigibpy.EClientSocketBase_reqMktDepth(self, *args)
def cancelMktDepth(self, *args):
"""cancelMktDepth(self, TickerId tickerId)"""
return _swigibpy.EClientSocketBase_cancelMktDepth(self, *args)
def reqNewsBulletins(self, *args):
"""reqNewsBulletins(self, bool allMsgs)"""
return _swigibpy.EClientSocketBase_reqNewsBulletins(self, *args)
def cancelNewsBulletins(self):
"""cancelNewsBulletins(self)"""
return _swigibpy.EClientSocketBase_cancelNewsBulletins(self)
def setServerLogLevel(self, *args):
"""setServerLogLevel(self, int level)"""
return _swigibpy.EClientSocketBase_setServerLogLevel(self, *args)
def reqAutoOpenOrders(self, *args):
"""reqAutoOpenOrders(self, bool bAutoBind)"""
return _swigibpy.EClientSocketBase_reqAutoOpenOrders(self, *args)
def reqAllOpenOrders(self):
"""reqAllOpenOrders(self)"""
return _swigibpy.EClientSocketBase_reqAllOpenOrders(self)
def reqManagedAccts(self):
"""reqManagedAccts(self)"""
return _swigibpy.EClientSocketBase_reqManagedAccts(self)
def requestFA(self, *args):
"""requestFA(self, faDataType pFaDataType)"""
return _swigibpy.EClientSocketBase_requestFA(self, *args)
def replaceFA(self, *args):
"""replaceFA(self, faDataType pFaDataType, IBString cxml)"""
return _swigibpy.EClientSocketBase_replaceFA(self, *args)
def reqHistoricalData(self, *args):
"""
reqHistoricalData(self, TickerId id, Contract contract, IBString endDateTime,
IBString durationStr, IBString barSizeSetting,
IBString whatToShow, int useRTH, int formatDate)
"""
return _swigibpy.EClientSocketBase_reqHistoricalData(self, *args)
def exerciseOptions(self, *args):
"""
exerciseOptions(self, TickerId tickerId, Contract contract, int exerciseAction,
int exerciseQuantity, IBString account,
int override)
"""
return _swigibpy.EClientSocketBase_exerciseOptions(self, *args)
def cancelHistoricalData(self, *args):
"""cancelHistoricalData(self, TickerId tickerId)"""
return _swigibpy.EClientSocketBase_cancelHistoricalData(self, *args)
def reqRealTimeBars(self, *args):
"""
reqRealTimeBars(self, TickerId id, Contract contract, int barSize, IBString whatToShow,
bool useRTH)
"""
return _swigibpy.EClientSocketBase_reqRealTimeBars(self, *args)
def cancelRealTimeBars(self, *args):
"""cancelRealTimeBars(self, TickerId tickerId)"""
return _swigibpy.EClientSocketBase_cancelRealTimeBars(self, *args)
def cancelScannerSubscription(self, *args):
"""cancelScannerSubscription(self, int tickerId)"""
return _swigibpy.EClientSocketBase_cancelScannerSubscription(self, *args)
def reqScannerParameters(self):
"""reqScannerParameters(self)"""
return _swigibpy.EClientSocketBase_reqScannerParameters(self)
def reqScannerSubscription(self, *args):
"""reqScannerSubscription(self, int tickerId, ScannerSubscription subscription)"""
return _swigibpy.EClientSocketBase_reqScannerSubscription(self, *args)
def reqCurrentTime(self):
"""reqCurrentTime(self)"""
return _swigibpy.EClientSocketBase_reqCurrentTime(self)
def reqFundamentalData(self, *args):
"""reqFundamentalData(self, TickerId reqId, Contract arg1, IBString reportType)"""
return _swigibpy.EClientSocketBase_reqFundamentalData(self, *args)
def cancelFundamentalData(self, *args):
"""cancelFundamentalData(self, TickerId reqId)"""
return _swigibpy.EClientSocketBase_cancelFundamentalData(self, *args)
def calculateImpliedVolatility(self, *args):
"""
calculateImpliedVolatility(self, TickerId reqId, Contract contract, double optionPrice,
double underPrice)
"""
return _swigibpy.EClientSocketBase_calculateImpliedVolatility(self, *args)
def calculateOptionPrice(self, *args):
"""
calculateOptionPrice(self, TickerId reqId, Contract contract, double volatility,
double underPrice)
"""
return _swigibpy.EClientSocketBase_calculateOptionPrice(self, *args)
def cancelCalculateImpliedVolatility(self, *args):
"""cancelCalculateImpliedVolatility(self, TickerId reqId)"""
return _swigibpy.EClientSocketBase_cancelCalculateImpliedVolatility(self, *args)
def cancelCalculateOptionPrice(self, *args):
"""cancelCalculateOptionPrice(self, TickerId reqId)"""
return _swigibpy.EClientSocketBase_cancelCalculateOptionPrice(self, *args)
def reqGlobalCancel(self):
"""reqGlobalCancel(self)"""
return _swigibpy.EClientSocketBase_reqGlobalCancel(self)
EClientSocketBase.eConnect = new_instancemethod(_swigibpy.EClientSocketBase_eConnect,None,EClientSocketBase)
EClientSocketBase.eDisconnect = new_instancemethod(_swigibpy.EClientSocketBase_eDisconnect,None,EClientSocketBase)
EClientSocketBase.isConnected = new_instancemethod(_swigibpy.EClientSocketBase_isConnected,None,EClientSocketBase)
EClientSocketBase.isInBufferEmpty = new_instancemethod(_swigibpy.EClientSocketBase_isInBufferEmpty,None,EClientSocketBase)
EClientSocketBase.isOutBufferEmpty = new_instancemethod(_swigibpy.EClientSocketBase_isOutBufferEmpty,None,EClientSocketBase)
EClientSocketBase.serverVersion = new_instancemethod(_swigibpy.EClientSocketBase_serverVersion,None,EClientSocketBase)
EClientSocketBase.TwsConnectionTime = new_instancemethod(_swigibpy.EClientSocketBase_TwsConnectionTime,None,EClientSocketBase)
EClientSocketBase.reqMktData = new_instancemethod(_swigibpy.EClientSocketBase_reqMktData,None,EClientSocketBase)
EClientSocketBase.cancelMktData = new_instancemethod(_swigibpy.EClientSocketBase_cancelMktData,None,EClientSocketBase)
EClientSocketBase.placeOrder = new_instancemethod(_swigibpy.EClientSocketBase_placeOrder,None,EClientSocketBase)
EClientSocketBase.cancelOrder = new_instancemethod(_swigibpy.EClientSocketBase_cancelOrder,None,EClientSocketBase)
EClientSocketBase.reqOpenOrders = new_instancemethod(_swigibpy.EClientSocketBase_reqOpenOrders,None,EClientSocketBase)
EClientSocketBase.reqAccountUpdates = new_instancemethod(_swigibpy.EClientSocketBase_reqAccountUpdates,None,EClientSocketBase)
EClientSocketBase.reqExecutions = new_instancemethod(_swigibpy.EClientSocketBase_reqExecutions,None,EClientSocketBase)
EClientSocketBase.reqIds = new_instancemethod(_swigibpy.EClientSocketBase_reqIds,None,EClientSocketBase)
EClientSocketBase.checkMessages = new_instancemethod(_swigibpy.EClientSocketBase_checkMessages,None,EClientSocketBase)
EClientSocketBase.reqContractDetails = new_instancemethod(_swigibpy.EClientSocketBase_reqContractDetails,None,EClientSocketBase)
EClientSocketBase.reqMktDepth = new_instancemethod(_swigibpy.EClientSocketBase_reqMktDepth,None,EClientSocketBase)
EClientSocketBase.cancelMktDepth = new_instancemethod(_swigibpy.EClientSocketBase_cancelMktDepth,None,EClientSocketBase)
EClientSocketBase.reqNewsBulletins = new_instancemethod(_swigibpy.EClientSocketBase_reqNewsBulletins,None,EClientSocketBase)
EClientSocketBase.cancelNewsBulletins = new_instancemethod(_swigibpy.EClientSocketBase_cancelNewsBulletins,None,EClientSocketBase)
EClientSocketBase.setServerLogLevel = new_instancemethod(_swigibpy.EClientSocketBase_setServerLogLevel,None,EClientSocketBase)
EClientSocketBase.reqAutoOpenOrders = new_instancemethod(_swigibpy.EClientSocketBase_reqAutoOpenOrders,None,EClientSocketBase)
EClientSocketBase.reqAllOpenOrders = new_instancemethod(_swigibpy.EClientSocketBase_reqAllOpenOrders,None,EClientSocketBase)
EClientSocketBase.reqManagedAccts = new_instancemethod(_swigibpy.EClientSocketBase_reqManagedAccts,None,EClientSocketBase)
EClientSocketBase.requestFA = new_instancemethod(_swigibpy.EClientSocketBase_requestFA,None,EClientSocketBase)
EClientSocketBase.replaceFA = new_instancemethod(_swigibpy.EClientSocketBase_replaceFA,None,EClientSocketBase)
EClientSocketBase.reqHistoricalData = new_instancemethod(_swigibpy.EClientSocketBase_reqHistoricalData,None,EClientSocketBase)
EClientSocketBase.exerciseOptions = new_instancemethod(_swigibpy.EClientSocketBase_exerciseOptions,None,EClientSocketBase)
EClientSocketBase.cancelHistoricalData = new_instancemethod(_swigibpy.EClientSocketBase_cancelHistoricalData,None,EClientSocketBase)
EClientSocketBase.reqRealTimeBars = new_instancemethod(_swigibpy.EClientSocketBase_reqRealTimeBars,None,EClientSocketBase)
EClientSocketBase.cancelRealTimeBars = new_instancemethod(_swigibpy.EClientSocketBase_cancelRealTimeBars,None,EClientSocketBase)
EClientSocketBase.cancelScannerSubscription = new_instancemethod(_swigibpy.EClientSocketBase_cancelScannerSubscription,None,EClientSocketBase)
EClientSocketBase.reqScannerParameters = new_instancemethod(_swigibpy.EClientSocketBase_reqScannerParameters,None,EClientSocketBase)
EClientSocketBase.reqScannerSubscription = new_instancemethod(_swigibpy.EClientSocketBase_reqScannerSubscription,None,EClientSocketBase)
EClientSocketBase.reqCurrentTime = new_instancemethod(_swigibpy.EClientSocketBase_reqCurrentTime,None,EClientSocketBase)
EClientSocketBase.reqFundamentalData = new_instancemethod(_swigibpy.EClientSocketBase_reqFundamentalData,None,EClientSocketBase)
EClientSocketBase.cancelFundamentalData = new_instancemethod(_swigibpy.EClientSocketBase_cancelFundamentalData,None,EClientSocketBase)
EClientSocketBase.calculateImpliedVolatility = new_instancemethod(_swigibpy.EClientSocketBase_calculateImpliedVolatility,None,EClientSocketBase)
EClientSocketBase.calculateOptionPrice = new_instancemethod(_swigibpy.EClientSocketBase_calculateOptionPrice,None,EClientSocketBase)
EClientSocketBase.cancelCalculateImpliedVolatility = new_instancemethod(_swigibpy.EClientSocketBase_cancelCalculateImpliedVolatility,None,EClientSocketBase)
EClientSocketBase.cancelCalculateOptionPrice = new_instancemethod(_swigibpy.EClientSocketBase_cancelCalculateOptionPrice,None,EClientSocketBase)
EClientSocketBase.reqGlobalCancel = new_instancemethod(_swigibpy.EClientSocketBase_reqGlobalCancel,None,EClientSocketBase)
EClientSocketBase_swigregister = _swigibpy.EClientSocketBase_swigregister
EClientSocketBase_swigregister(EClientSocketBase)
class Execution(object):
"""Proxy of C++ Execution class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Execution"""
_swigibpy.Execution_swiginit(self,_swigibpy.new_Execution())
execId = _swig_property(_swigibpy.Execution_execId_get, _swigibpy.Execution_execId_set)
time = _swig_property(_swigibpy.Execution_time_get, _swigibpy.Execution_time_set)
acctNumber = _swig_property(_swigibpy.Execution_acctNumber_get, _swigibpy.Execution_acctNumber_set)
exchange = _swig_property(_swigibpy.Execution_exchange_get, _swigibpy.Execution_exchange_set)
side = _swig_property(_swigibpy.Execution_side_get, _swigibpy.Execution_side_set)
shares = _swig_property(_swigibpy.Execution_shares_get, _swigibpy.Execution_shares_set)
price = _swig_property(_swigibpy.Execution_price_get, _swigibpy.Execution_price_set)
permId = _swig_property(_swigibpy.Execution_permId_get, _swigibpy.Execution_permId_set)
clientId = _swig_property(_swigibpy.Execution_clientId_get, _swigibpy.Execution_clientId_set)
orderId = _swig_property(_swigibpy.Execution_orderId_get, _swigibpy.Execution_orderId_set)
liquidation = _swig_property(_swigibpy.Execution_liquidation_get, _swigibpy.Execution_liquidation_set)
cumQty = _swig_property(_swigibpy.Execution_cumQty_get, _swigibpy.Execution_cumQty_set)
avgPrice = _swig_property(_swigibpy.Execution_avgPrice_get, _swigibpy.Execution_avgPrice_set)
__swig_destroy__ = _swigibpy.delete_Execution
Execution_swigregister = _swigibpy.Execution_swigregister
Execution_swigregister(Execution)
class ExecutionFilter(object):
"""Proxy of C++ ExecutionFilter class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> ExecutionFilter"""
_swigibpy.ExecutionFilter_swiginit(self,_swigibpy.new_ExecutionFilter())
m_clientId = _swig_property(_swigibpy.ExecutionFilter_m_clientId_get, _swigibpy.ExecutionFilter_m_clientId_set)
m_acctCode = _swig_property(_swigibpy.ExecutionFilter_m_acctCode_get, _swigibpy.ExecutionFilter_m_acctCode_set)
m_time = _swig_property(_swigibpy.ExecutionFilter_m_time_get, _swigibpy.ExecutionFilter_m_time_set)
m_symbol = _swig_property(_swigibpy.ExecutionFilter_m_symbol_get, _swigibpy.ExecutionFilter_m_symbol_set)
m_secType = _swig_property(_swigibpy.ExecutionFilter_m_secType_get, _swigibpy.ExecutionFilter_m_secType_set)
m_exchange = _swig_property(_swigibpy.ExecutionFilter_m_exchange_get, _swigibpy.ExecutionFilter_m_exchange_set)
m_side = _swig_property(_swigibpy.ExecutionFilter_m_side_get, _swigibpy.ExecutionFilter_m_side_set)
__swig_destroy__ = _swigibpy.delete_ExecutionFilter
ExecutionFilter_swigregister = _swigibpy.ExecutionFilter_swigregister
ExecutionFilter_swigregister(ExecutionFilter)
CUSTOMER = _swigibpy.CUSTOMER
FIRM = _swigibpy.FIRM
UNKNOWN = _swigibpy.UNKNOWN
AUCTION_UNSET = _swigibpy.AUCTION_UNSET
AUCTION_MATCH = _swigibpy.AUCTION_MATCH
AUCTION_IMPROVEMENT = _swigibpy.AUCTION_IMPROVEMENT
AUCTION_TRANSPARENT = _swigibpy.AUCTION_TRANSPARENT
class TagValue(object):
"""Proxy of C++ TagValue class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self) -> TagValue
__init__(self, IBString p_tag, IBString p_value) -> TagValue
"""
_swigibpy.TagValue_swiginit(self,_swigibpy.new_TagValue(*args))
tag = _swig_property(_swigibpy.TagValue_tag_get, _swigibpy.TagValue_tag_set)
value = _swig_property(_swigibpy.TagValue_value_get, _swigibpy.TagValue_value_set)
__swig_destroy__ = _swigibpy.delete_TagValue
TagValue_swigregister = _swigibpy.TagValue_swigregister
TagValue_swigregister(TagValue)
class Order(object):
"""Proxy of C++ Order class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> Order"""
_swigibpy.Order_swiginit(self,_swigibpy.new_Order())
orderId = _swig_property(_swigibpy.Order_orderId_get, _swigibpy.Order_orderId_set)
clientId = _swig_property(_swigibpy.Order_clientId_get, _swigibpy.Order_clientId_set)
permId = _swig_property(_swigibpy.Order_permId_get, _swigibpy.Order_permId_set)
action = _swig_property(_swigibpy.Order_action_get, _swigibpy.Order_action_set)
totalQuantity = _swig_property(_swigibpy.Order_totalQuantity_get, _swigibpy.Order_totalQuantity_set)
orderType = _swig_property(_swigibpy.Order_orderType_get, _swigibpy.Order_orderType_set)
lmtPrice = _swig_property(_swigibpy.Order_lmtPrice_get, _swigibpy.Order_lmtPrice_set)
auxPrice = _swig_property(_swigibpy.Order_auxPrice_get, _swigibpy.Order_auxPrice_set)
tif = _swig_property(_swigibpy.Order_tif_get, _swigibpy.Order_tif_set)
ocaGroup = _swig_property(_swigibpy.Order_ocaGroup_get, _swigibpy.Order_ocaGroup_set)
ocaType = _swig_property(_swigibpy.Order_ocaType_get, _swigibpy.Order_ocaType_set)
orderRef = _swig_property(_swigibpy.Order_orderRef_get, _swigibpy.Order_orderRef_set)
transmit = _swig_property(_swigibpy.Order_transmit_get, _swigibpy.Order_transmit_set)
parentId = _swig_property(_swigibpy.Order_parentId_get, _swigibpy.Order_parentId_set)
blockOrder = _swig_property(_swigibpy.Order_blockOrder_get, _swigibpy.Order_blockOrder_set)
sweepToFill = _swig_property(_swigibpy.Order_sweepToFill_get, _swigibpy.Order_sweepToFill_set)
displaySize = _swig_property(_swigibpy.Order_displaySize_get, _swigibpy.Order_displaySize_set)
triggerMethod = _swig_property(_swigibpy.Order_triggerMethod_get, _swigibpy.Order_triggerMethod_set)
outsideRth = _swig_property(_swigibpy.Order_outsideRth_get, _swigibpy.Order_outsideRth_set)
hidden = _swig_property(_swigibpy.Order_hidden_get, _swigibpy.Order_hidden_set)
goodAfterTime = _swig_property(_swigibpy.Order_goodAfterTime_get, _swigibpy.Order_goodAfterTime_set)
goodTillDate = _swig_property(_swigibpy.Order_goodTillDate_get, _swigibpy.Order_goodTillDate_set)
rule80A = _swig_property(_swigibpy.Order_rule80A_get, _swigibpy.Order_rule80A_set)
allOrNone = _swig_property(_swigibpy.Order_allOrNone_get, _swigibpy.Order_allOrNone_set)
minQty = _swig_property(_swigibpy.Order_minQty_get, _swigibpy.Order_minQty_set)
percentOffset = _swig_property(_swigibpy.Order_percentOffset_get, _swigibpy.Order_percentOffset_set)
overridePercentageConstraints = _swig_property(_swigibpy.Order_overridePercentageConstraints_get, _swigibpy.Order_overridePercentageConstraints_set)
trailStopPrice = _swig_property(_swigibpy.Order_trailStopPrice_get, _swigibpy.Order_trailStopPrice_set)
faGroup = _swig_property(_swigibpy.Order_faGroup_get, _swigibpy.Order_faGroup_set)
faProfile = _swig_property(_swigibpy.Order_faProfile_get, _swigibpy.Order_faProfile_set)
faMethod = _swig_property(_swigibpy.Order_faMethod_get, _swigibpy.Order_faMethod_set)
faPercentage = _swig_property(_swigibpy.Order_faPercentage_get, _swigibpy.Order_faPercentage_set)
openClose = _swig_property(_swigibpy.Order_openClose_get, _swigibpy.Order_openClose_set)
origin = _swig_property(_swigibpy.Order_origin_get, _swigibpy.Order_origin_set)
shortSaleSlot = _swig_property(_swigibpy.Order_shortSaleSlot_get, _swigibpy.Order_shortSaleSlot_set)
designatedLocation = _swig_property(_swigibpy.Order_designatedLocation_get, _swigibpy.Order_designatedLocation_set)
exemptCode = _swig_property(_swigibpy.Order_exemptCode_get, _swigibpy.Order_exemptCode_set)
discretionaryAmt = _swig_property(_swigibpy.Order_discretionaryAmt_get, _swigibpy.Order_discretionaryAmt_set)
eTradeOnly = _swig_property(_swigibpy.Order_eTradeOnly_get, _swigibpy.Order_eTradeOnly_set)
firmQuoteOnly = _swig_property(_swigibpy.Order_firmQuoteOnly_get, _swigibpy.Order_firmQuoteOnly_set)
nbboPriceCap = _swig_property(_swigibpy.Order_nbboPriceCap_get, _swigibpy.Order_nbboPriceCap_set)
auctionStrategy = _swig_property(_swigibpy.Order_auctionStrategy_get, _swigibpy.Order_auctionStrategy_set)
startingPrice = _swig_property(_swigibpy.Order_startingPrice_get, _swigibpy.Order_startingPrice_set)
stockRefPrice = _swig_property(_swigibpy.Order_stockRefPrice_get, _swigibpy.Order_stockRefPrice_set)
delta = _swig_property(_swigibpy.Order_delta_get, _swigibpy.Order_delta_set)
stockRangeLower = _swig_property(_swigibpy.Order_stockRangeLower_get, _swigibpy.Order_stockRangeLower_set)
stockRangeUpper = _swig_property(_swigibpy.Order_stockRangeUpper_get, _swigibpy.Order_stockRangeUpper_set)
volatility = _swig_property(_swigibpy.Order_volatility_get, _swigibpy.Order_volatility_set)
volatilityType = _swig_property(_swigibpy.Order_volatilityType_get, _swigibpy.Order_volatilityType_set)
deltaNeutralOrderType = _swig_property(_swigibpy.Order_deltaNeutralOrderType_get, _swigibpy.Order_deltaNeutralOrderType_set)
deltaNeutralAuxPrice = _swig_property(_swigibpy.Order_deltaNeutralAuxPrice_get, _swigibpy.Order_deltaNeutralAuxPrice_set)
continuousUpdate = _swig_property(_swigibpy.Order_continuousUpdate_get, _swigibpy.Order_continuousUpdate_set)
referencePriceType = _swig_property(_swigibpy.Order_referencePriceType_get, _swigibpy.Order_referencePriceType_set)
basisPoints = _swig_property(_swigibpy.Order_basisPoints_get, _swigibpy.Order_basisPoints_set)
basisPointsType = _swig_property(_swigibpy.Order_basisPointsType_get, _swigibpy.Order_basisPointsType_set)
scaleInitLevelSize = _swig_property(_swigibpy.Order_scaleInitLevelSize_get, _swigibpy.Order_scaleInitLevelSize_set)
scaleSubsLevelSize = _swig_property(_swigibpy.Order_scaleSubsLevelSize_get, _swigibpy.Order_scaleSubsLevelSize_set)
scalePriceIncrement = _swig_property(_swigibpy.Order_scalePriceIncrement_get, _swigibpy.Order_scalePriceIncrement_set)
account = _swig_property(_swigibpy.Order_account_get, _swigibpy.Order_account_set)
settlingFirm = _swig_property(_swigibpy.Order_settlingFirm_get, _swigibpy.Order_settlingFirm_set)
clearingAccount = _swig_property(_swigibpy.Order_clearingAccount_get, _swigibpy.Order_clearingAccount_set)
clearingIntent = _swig_property(_swigibpy.Order_clearingIntent_get, _swigibpy.Order_clearingIntent_set)
algoStrategy = _swig_property(_swigibpy.Order_algoStrategy_get, _swigibpy.Order_algoStrategy_set)
algoParams = _swig_property(_swigibpy.Order_algoParams_get, _swigibpy.Order_algoParams_set)
whatIf = _swig_property(_swigibpy.Order_whatIf_get, _swigibpy.Order_whatIf_set)
notHeld = _swig_property(_swigibpy.Order_notHeld_get, _swigibpy.Order_notHeld_set)
__swig_destroy__ = _swigibpy.delete_Order
Order_swigregister = _swigibpy.Order_swigregister
Order_swigregister(Order)
class OrderState(object):
"""Proxy of C++ OrderState class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> OrderState"""
_swigibpy.OrderState_swiginit(self,_swigibpy.new_OrderState())
status = _swig_property(_swigibpy.OrderState_status_get, _swigibpy.OrderState_status_set)
initMargin = _swig_property(_swigibpy.OrderState_initMargin_get, _swigibpy.OrderState_initMargin_set)
maintMargin = _swig_property(_swigibpy.OrderState_maintMargin_get, _swigibpy.OrderState_maintMargin_set)
equityWithLoan = _swig_property(_swigibpy.OrderState_equityWithLoan_get, _swigibpy.OrderState_equityWithLoan_set)
commission = _swig_property(_swigibpy.OrderState_commission_get, _swigibpy.OrderState_commission_set)
minCommission = _swig_property(_swigibpy.OrderState_minCommission_get, _swigibpy.OrderState_minCommission_set)
maxCommission = _swig_property(_swigibpy.OrderState_maxCommission_get, _swigibpy.OrderState_maxCommission_set)
commissionCurrency = _swig_property(_swigibpy.OrderState_commissionCurrency_get, _swigibpy.OrderState_commissionCurrency_set)
warningText = _swig_property(_swigibpy.OrderState_warningText_get, _swigibpy.OrderState_warningText_set)
__swig_destroy__ = _swigibpy.delete_OrderState
OrderState_swigregister = _swigibpy.OrderState_swigregister
OrderState_swigregister(OrderState)
NO_ROW_NUMBER_SPECIFIED = _swigibpy.NO_ROW_NUMBER_SPECIFIED
class ScannerSubscription(object):
"""Proxy of C++ ScannerSubscription class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self):
"""__init__(self) -> ScannerSubscription"""
_swigibpy.ScannerSubscription_swiginit(self,_swigibpy.new_ScannerSubscription())
numberOfRows = _swig_property(_swigibpy.ScannerSubscription_numberOfRows_get, _swigibpy.ScannerSubscription_numberOfRows_set)
instrument = _swig_property(_swigibpy.ScannerSubscription_instrument_get, _swigibpy.ScannerSubscription_instrument_set)
locationCode = _swig_property(_swigibpy.ScannerSubscription_locationCode_get, _swigibpy.ScannerSubscription_locationCode_set)
scanCode = _swig_property(_swigibpy.ScannerSubscription_scanCode_get, _swigibpy.ScannerSubscription_scanCode_set)
abovePrice = _swig_property(_swigibpy.ScannerSubscription_abovePrice_get, _swigibpy.ScannerSubscription_abovePrice_set)
belowPrice = _swig_property(_swigibpy.ScannerSubscription_belowPrice_get, _swigibpy.ScannerSubscription_belowPrice_set)
aboveVolume = _swig_property(_swigibpy.ScannerSubscription_aboveVolume_get, _swigibpy.ScannerSubscription_aboveVolume_set)
marketCapAbove = _swig_property(_swigibpy.ScannerSubscription_marketCapAbove_get, _swigibpy.ScannerSubscription_marketCapAbove_set)
marketCapBelow = _swig_property(_swigibpy.ScannerSubscription_marketCapBelow_get, _swigibpy.ScannerSubscription_marketCapBelow_set)
moodyRatingAbove = _swig_property(_swigibpy.ScannerSubscription_moodyRatingAbove_get, _swigibpy.ScannerSubscription_moodyRatingAbove_set)
moodyRatingBelow = _swig_property(_swigibpy.ScannerSubscription_moodyRatingBelow_get, _swigibpy.ScannerSubscription_moodyRatingBelow_set)
spRatingAbove = _swig_property(_swigibpy.ScannerSubscription_spRatingAbove_get, _swigibpy.ScannerSubscription_spRatingAbove_set)
spRatingBelow = _swig_property(_swigibpy.ScannerSubscription_spRatingBelow_get, _swigibpy.ScannerSubscription_spRatingBelow_set)
maturityDateAbove = _swig_property(_swigibpy.ScannerSubscription_maturityDateAbove_get, _swigibpy.ScannerSubscription_maturityDateAbove_set)
maturityDateBelow = _swig_property(_swigibpy.ScannerSubscription_maturityDateBelow_get, _swigibpy.ScannerSubscription_maturityDateBelow_set)
couponRateAbove = _swig_property(_swigibpy.ScannerSubscription_couponRateAbove_get, _swigibpy.ScannerSubscription_couponRateAbove_set)
couponRateBelow = _swig_property(_swigibpy.ScannerSubscription_couponRateBelow_get, _swigibpy.ScannerSubscription_couponRateBelow_set)
excludeConvertible = _swig_property(_swigibpy.ScannerSubscription_excludeConvertible_get, _swigibpy.ScannerSubscription_excludeConvertible_set)
averageOptionVolumeAbove = _swig_property(_swigibpy.ScannerSubscription_averageOptionVolumeAbove_get, _swigibpy.ScannerSubscription_averageOptionVolumeAbove_set)
scannerSettingPairs = _swig_property(_swigibpy.ScannerSubscription_scannerSettingPairs_get, _swigibpy.ScannerSubscription_scannerSettingPairs_set)
stockTypeFilter = _swig_property(_swigibpy.ScannerSubscription_stockTypeFilter_get, _swigibpy.ScannerSubscription_stockTypeFilter_set)
__swig_destroy__ = _swigibpy.delete_ScannerSubscription
ScannerSubscription_swigregister = _swigibpy.ScannerSubscription_swigregister
ScannerSubscription_swigregister(ScannerSubscription)
import threading
import time
class TWSPoller(threading.Thread):
'''Polls TWS every second for any outstanding messages'''
def __init__(self, tws):
super(TWSPoller, self).__init__()
self.daemon = True
self._tws = tws
self.stop_polling = False
def run(self):
'''Continually poll TWS until the stop flag is set'''
while not self.stop_polling:
try:
self._tws.checkMessages()
except:
if self.stop_polling:
break
else:
raise
time.sleep(1)
class EPosixClientSocket(EClientSocketBase):
"""Proxy of C++ EPosixClientSocket class"""
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""__init__(self, EWrapper ptr) -> EPosixClientSocket"""
_swigibpy.EPosixClientSocket_swiginit(self,_swigibpy.new_EPosixClientSocket(*args))
__swig_destroy__ = _swigibpy.delete_EPosixClientSocket
def eConnect(self, *args):
"""
eConnect(self, char host, unsigned int port, int clientId = 0) -> bool
eConnect(self, char host, unsigned int port) -> bool
"""
val = _swigibpy.EPosixClientSocket_eConnect(self, *args)
if val:
self.poller = TWSPoller(self)
self.poller.start()
return val
def eDisconnect(self):
"""eDisconnect(self)"""
if self.poller:
self.poller.stop_polling = True
self.poller = None
return _swigibpy.EPosixClientSocket_eDisconnect(self)
def isSocketOK(self):
"""isSocketOK(self) -> bool"""
return _swigibpy.EPosixClientSocket_isSocketOK(self)
def fd(self):
"""fd(self) -> int"""
return _swigibpy.EPosixClientSocket_fd(self)
def onReceive(self):
"""onReceive(self)"""
return _swigibpy.EPosixClientSocket_onReceive(self)
def onSend(self):
"""onSend(self)"""
return _swigibpy.EPosixClientSocket_onSend(self)
def onError(self):
"""onError(self)"""
return _swigibpy.EPosixClientSocket_onError(self)
def handleSocketError(self):
"""handleSocketError(self) -> bool"""
return _swigibpy.EPosixClientSocket_handleSocketError(self)
EPosixClientSocket.isSocketOK = new_instancemethod(_swigibpy.EPosixClientSocket_isSocketOK,None,EPosixClientSocket)
EPosixClientSocket.fd = new_instancemethod(_swigibpy.EPosixClientSocket_fd,None,EPosixClientSocket)
EPosixClientSocket.onReceive = new_instancemethod(_swigibpy.EPosixClientSocket_onReceive,None,EPosixClientSocket)
EPosixClientSocket.onSend = new_instancemethod(_swigibpy.EPosixClientSocket_onSend,None,EPosixClientSocket)
EPosixClientSocket.onError = new_instancemethod(_swigibpy.EPosixClientSocket_onError,None,EPosixClientSocket)
EPosixClientSocket.handleSocketError = new_instancemethod(_swigibpy.EPosixClientSocket_handleSocketError,None,EPosixClientSocket)
EPosixClientSocket_swigregister = _swigibpy.EPosixClientSocket_swigregister
EPosixClientSocket_swigregister(EPosixClientSocket)
class TWSError(Exception):
'''Exception raised during communication with Interactive Brokers TWS
application
'''
def __init__(self, code, msg):
self.code = code
self.msg = msg
def __str__(self):