[global]
server.socket_host: "0.0.0.0"
#server.socket_port: 8082
server.socket_port: 8091

[redis]
redis.server: "localhost"
redis.port: 6379
# db - 0 production larry046, 3 development, 2 production mchan927
redis.db: 3


redis.sleep: 0.5
redis.datastore.key.option_implv: 'opt_implv'
redis.datastore.key.option_chains: 'opt_chains'
redis.datastore.key.option_set: 'opt_set'
redis.datastore.key.option_implv_ts_set: 'opt_implv_ts_set'
redis.datastore.key.option_implv_ts: 'opt_implv_ts' 

# a redis key that stores all the contract ids of contracts in a portfolio  
redis.datastore.key.port_conid_set: 'port_conid_set' 
redis.datastore.key.port_prefix: 'PT'
# note that the port summary key has no prefix assigned to it
# to retrive its value just use rs.get instead of self.rs_<xxx>
redis.datastore.key.port_summary: 'port_summary'
redis.datastore.key.port_items: 'port_items'
redis.datastore.key.acct_summary: 'acct_summary'
redis.datastore.key.hkex_holiday_prefix: 'hkex_holiday_'

 
[/]
tools.sessions.on : True
tools.staticdir.root : '/home/larry-13.04/workspace/finopt/src/'
#tools.staticdir.root : '/home/larry-13.04/production/finopt/'

[/static]
tools.staticdir.on : True
tools.staticdir.tmpl : './html'
#tools.staticdir : './html'

[/public]
tools.staticdir.on: True
tools.staticdir.dir : './html/public'

[/ws]
tools.websocket.on: True
tools.websocket.handler_cls: opt_serve.OptWebSocket



[options_data]
options_data.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/opt.log', 'filemode': 'w','level': logging.DEBUG}"

[portfolio]
portfolio.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/port.log', 'filemode': 'w','level': logging.INFO}"
portfolio.epc: "{'stream_to_Kafka': True}"   
portfolio.account_summary_tags: "['AccountType','NetLiquidation','TotalCashValue','SettledCash','AccruedCash','BuyingPower','EquityWithLoanValue','PreviousDayEquityWithLoanValue','GrossPositionValue','RegTEquity','RegTMargin','SMA','InitMarginReq','MaintMarginReq','AvailableFunds','ExcessLiquidity','Cushion','FullInitMarginReq','FullMaintMarginReq','FullAvailableFunds','FullExcessLiquidity','LookAheadNextChange','LookAheadInitMarginReq','LookAheadMaintMarginReq','LookAheadAvailableFunds','LookAheadExcessLiquidity','HighestSeverity','DayTradesRemaining','Leverage']"


[opt_serve]
opt_serve.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/serve.log', 'filemode': 'w','level': logging.INFO}"


[cep]
kafka.host: 'localhost'
kafka.port: 9092
kafka.ib.topic.tick_price: 'ib_tick_price'
kafka.ib.topic.tick_size: 'ib_tick_size'
ib.subscription.fileloc: '/home/larry-13.04/workspace/finopt/data/subscription.txt'


[market]
hkex.openhours: '{"morning":[915,1200], "afternoon":[1300,1615]}'



#ib.gateway: '127.0.0.1'
ib.gateway: 'vsu-bison'

# 7496 - production larry046, 7496 - development,  8496 production mchan927
ib.port: 7496
#gw port
#ib.port:4001

# 9922: production larry046, 9922 development, 9933 production mchan927
ib.appid.portfolio: 9933

# 9911: production larry046, 9911 development, 9913 production mchan927
ib.appid: 9913

option.underlying = "('HSI', 'FUT', 'HKFE', 'HKD', '', 0, '')"

# the month value is no longer required as the system
# will auto retrieve holidays from hk gov website
# and deduce the near and next month options last trading date
option.underlying.month_price = "[['20160629', 20100, '^HSI'], ['20160728', 20100.0, '^HSI']]"
option.underlying.yahoo_ws = "{'use_yahoo': True, 'func': 'ystockquote.get_price'}"
option.underlying.tick_size = 200

# refer to this link for rate and div
# https://www.hkex.com.hk/eng/sorc/tools/calculator_index_option.aspx
option.greeks.recal = "{'use_last_if_no_bidask': True, 'rate':0.0009, 'div':0.328, 'vol':0.2}"
option.chain_range = 0.08
option.bid_ask_spread_tolerance = 0.90

[alert_bot]
msg_bot.jid: "robo@route69.hopto.org"
msg_bot.pass: 123
msg_bot.recipients: "['blueman@route69.hopto.org']"
msg_bot.redis_mq: 'chatq'
msg_bot.redis_prefix: 'alert_bot'  
#
# 'filename': '../log/alert_bot.log', 'filemode': 'w', 
msg_bot.logconfig: "{'level': logging.INFO}"

[epc]
kafka.host: 'localhost'
kafka.port: 9092

[ib_mds]
ib_mds.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/ib_mds.log', 'filemode': 'w','level': logging.INFO}"
ib_mds.ib_port: 7496
#ib_mds.ib_port: 4001
ib_mds.appid.id: 9800
ib_mds.gateway: 'localhost'
#ib_mds.gateway: '192.168.1.118'
ib_mds.is_persist: 1
ib_mds.persist_dir: '/home/larry-13.04/workspace/finopt/data/mds_files'
ib_mds.spill_over_limit: 10000

[ib_heartbeat]
ib_heartbeat.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/ib_mds.log', 'filemode': 'w','level': logging.INFO}"
#ib_heartbeat.ib_port: 4001
ib_heartbeat.ib_port: 7496
ib_heartbeat.appid.id: 9911
#ib_heartbeat.gateway: 'localhost'
ib_heartbeat.gateway: '192.168.1.118'
ib_heartbeat.try_interval: 60
ib_heartbeat.suppress_msg_interval: 120

[smart_order]
smart_order.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/smart_order.log', 'filemode': 'w','level': logging.INFO}"


[tws_gateway]
subscription_manager.subscriptions.redis_key: 'subscriptions'  
tws_gateway.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/tws_gateway.log', 'filemode': 'w','level': logging.INFO}"
tws_gateway.order_transmit: False


[options_chain]
options_calculation_engine.logconfig: "{'filename': '/home/larry-13.04/workspace/finopt/log/oce.log', 'filemode': 'w','level': logging.INFO}"
option_chain_id.redis_key_prefix: 'optchain-'
clear_redis_on_start: True
