-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScannerSubscriptionSamples.py
69 lines (56 loc) · 1.99 KB
/
ScannerSubscriptionSamples.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
"""
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
import sys
from ibapi.object_implem import Object
from ibapi.scanner import ScannerSubscription
class ScannerSubscriptionSamples(Object):
@staticmethod
def HotUSStkByVolume():
#! [hotusvolume]
#Hot US stocks by volume
scanSub = ScannerSubscription()
scanSub.instrument = "STK"
scanSub.locationCode = "STK.US.MAJOR"
scanSub.scanCode = "HOT_BY_VOLUME"
#! [hotusvolume]
return scanSub
@staticmethod
def TopPercentGainersIbis():
#! [toppercentgaineribis]
# Top % gainers at IBIS
scanSub = ScannerSubscription()
scanSub.instrument = "STOCK.EU"
scanSub.locationCode = "STK.EU.IBIS"
scanSub.scanCode = "TOP_PERC_GAIN"
#! [toppercentgaineribis]
return scanSub
@staticmethod
def MostActiveFutSoffex():
#! [mostactivefutsoffex]
# Most active futures at SOFFEX
scanSub = ScannerSubscription()
scanSub.instrument = "FUT.EU"
scanSub.locationCode = "FUT.EU.SOFFEX"
scanSub.scanCode = "MOST_ACTIVE"
#! [mostactivefutsoffex]
return scanSub
@staticmethod
def HighOptVolumePCRatioUSIndexes():
#! [highoptvolume]
# High option volume P/C ratio US indexes
scanSub = ScannerSubscription()
scanSub.instrument = "IND.US"
scanSub.locationCode = "IND.US"
scanSub.scanCode = "HIGH_OPT_VOLUME_PUT_CALL_RATIO"
#! [highoptvolume]
return scanSub
def Test():
print(ScannerSubscriptionSamples.HotUSStkByVolume())
print(ScannerSubscriptionSamples.TopPercentGainersIbis())
print(ScannerSubscriptionSamples.MostActiveFutSoffex())
print(ScannerSubscriptionSamples.HighOptVolumePCRatioUSIndexes())
if "__main__" == __name__:
Test()