2019-06-28 03:03:57 +00:00
|
|
|
# flake8: noqa
|
2019-01-08 12:45:01 +00:00
|
|
|
from vnpy.event import EventEngine
|
2019-02-10 03:49:09 +00:00
|
|
|
|
2019-01-08 12:45:01 +00:00
|
|
|
from vnpy.trader.engine import MainEngine
|
|
|
|
from vnpy.trader.ui import MainWindow, create_qapp
|
|
|
|
|
2019-07-16 08:15:07 +00:00
|
|
|
# from vnpy.gateway.binance import BinanceGateway
|
2019-09-15 09:44:08 +00:00
|
|
|
from vnpy.gateway.bitmex import BitmexGateway
|
2019-06-25 08:25:34 +00:00
|
|
|
# from vnpy.gateway.futu import FutuGateway
|
2019-06-30 15:39:39 +00:00
|
|
|
# from vnpy.gateway.ib import IbGateway
|
2019-09-20 03:37:32 +00:00
|
|
|
from vnpy.gateway.ctp import CtpGateway
|
2019-06-14 04:12:41 +00:00
|
|
|
# from vnpy.gateway.ctptest import CtptestGateway
|
2019-08-06 06:35:51 +00:00
|
|
|
# from vnpy.gateway.mini import MiniGateway
|
2019-09-01 14:40:29 +00:00
|
|
|
# from vnpy.gateway.sopt import SoptGateway
|
2019-07-19 14:04:21 +00:00
|
|
|
# from vnpy.gateway.minitest import MinitestGateway
|
2019-06-26 13:43:06 +00:00
|
|
|
# from vnpy.gateway.femas import FemasGateway
|
2019-06-29 15:36:50 +00:00
|
|
|
# from vnpy.gateway.tiger import TigerGateway
|
2019-07-02 15:32:36 +00:00
|
|
|
# from vnpy.gateway.oes import OesGateway
|
2019-09-01 14:40:29 +00:00
|
|
|
# from vnpy.gateway.okex import OkexGateway
|
2019-06-25 08:25:34 +00:00
|
|
|
# from vnpy.gateway.huobi import HuobiGateway
|
2019-09-17 15:41:10 +00:00
|
|
|
from vnpy.gateway.bitfinex import BitfinexGateway
|
2019-06-25 08:25:34 +00:00
|
|
|
# from vnpy.gateway.onetoken import OnetokenGateway
|
2019-07-16 08:15:07 +00:00
|
|
|
from vnpy.gateway.okexf import OkexfGateway
|
2019-09-03 01:45:40 +00:00
|
|
|
from vnpy.gateway.okexs import OkexsGateway
|
2019-06-11 14:59:10 +00:00
|
|
|
# from vnpy.gateway.xtp import XtpGateway
|
2019-06-29 15:36:50 +00:00
|
|
|
# from vnpy.gateway.hbdm import HbdmGateway
|
2019-06-26 13:43:06 +00:00
|
|
|
# from vnpy.gateway.tap import TapGateway
|
2019-06-29 15:36:50 +00:00
|
|
|
# from vnpy.gateway.tora import ToraGateway
|
|
|
|
# from vnpy.gateway.alpaca import AlpacaGateway
|
2019-09-01 14:40:29 +00:00
|
|
|
from vnpy.gateway.da import DaGateway
|
2019-09-05 03:23:37 +00:00
|
|
|
from vnpy.gateway.coinbase import CoinbaseGateway
|
2019-09-25 08:00:24 +00:00
|
|
|
from vnpy.gateway.bitstamp import BitstampGateway
|
2019-10-18 11:22:35 +00:00
|
|
|
from vnpy.gateway.gateios import GateiosGateway
|
2019-02-10 03:49:09 +00:00
|
|
|
|
2019-06-29 15:36:50 +00:00
|
|
|
from vnpy.app.cta_strategy import CtaStrategyApp
|
2019-06-25 08:25:34 +00:00
|
|
|
# from vnpy.app.csv_loader import CsvLoaderApp
|
|
|
|
# from vnpy.app.algo_trading import AlgoTradingApp
|
2019-06-29 15:36:50 +00:00
|
|
|
from vnpy.app.cta_backtester import CtaBacktesterApp
|
2019-06-25 08:25:34 +00:00
|
|
|
# from vnpy.app.data_recorder import DataRecorderApp
|
|
|
|
# from vnpy.app.risk_manager import RiskManagerApp
|
2019-06-30 15:39:39 +00:00
|
|
|
from vnpy.app.script_trader import ScriptTraderApp
|
2019-07-02 03:08:14 +00:00
|
|
|
from vnpy.app.rpc_service import RpcServiceApp
|
2019-09-15 09:44:08 +00:00
|
|
|
from vnpy.app.spread_trading import SpreadTradingApp
|
2019-02-10 03:49:09 +00:00
|
|
|
|
2019-01-08 13:53:03 +00:00
|
|
|
|
|
|
|
def main():
|
|
|
|
""""""
|
2019-01-08 12:45:01 +00:00
|
|
|
qapp = create_qapp()
|
|
|
|
|
|
|
|
event_engine = EventEngine()
|
2019-01-10 15:45:21 +00:00
|
|
|
|
2019-01-08 12:45:01 +00:00
|
|
|
main_engine = MainEngine(event_engine)
|
2019-05-17 02:06:43 +00:00
|
|
|
|
2019-07-16 08:15:07 +00:00
|
|
|
# main_engine.add_gateway(BinanceGateway)
|
2019-09-20 03:37:32 +00:00
|
|
|
main_engine.add_gateway(CtpGateway)
|
2019-06-14 04:12:41 +00:00
|
|
|
# main_engine.add_gateway(CtptestGateway)
|
2019-08-06 06:35:51 +00:00
|
|
|
# main_engine.add_gateway(MiniGateway)
|
2019-09-03 01:45:40 +00:00
|
|
|
# main_engine.add_gateway(SoptGateway)
|
2019-07-19 14:04:21 +00:00
|
|
|
# main_engine.add_gateway(MinitestGateway)
|
2019-06-26 13:43:06 +00:00
|
|
|
# main_engine.add_gateway(FemasGateway)
|
2019-06-30 15:39:39 +00:00
|
|
|
# main_engine.add_gateway(IbGateway)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_gateway(FutuGateway)
|
2019-09-15 09:44:08 +00:00
|
|
|
main_engine.add_gateway(BitmexGateway)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_gateway(TigerGateway)
|
2019-07-02 15:32:36 +00:00
|
|
|
# main_engine.add_gateway(OesGateway)
|
2019-07-16 09:15:42 +00:00
|
|
|
# main_engine.add_gateway(OkexGateway)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_gateway(HuobiGateway)
|
2019-09-17 15:41:10 +00:00
|
|
|
main_engine.add_gateway(BitfinexGateway)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_gateway(OnetokenGateway)
|
2019-07-16 09:15:42 +00:00
|
|
|
# main_engine.add_gateway(OkexfGateway)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_gateway(HbdmGateway)
|
2019-06-15 15:58:10 +00:00
|
|
|
# main_engine.add_gateway(XtpGateway)
|
2019-06-26 13:43:06 +00:00
|
|
|
# main_engine.add_gateway(TapGateway)
|
2019-06-29 15:36:50 +00:00
|
|
|
# main_engine.add_gateway(ToraGateway)
|
|
|
|
# main_engine.add_gateway(AlpacaGateway)
|
2019-09-05 03:23:37 +00:00
|
|
|
# main_engine.add_gateway(OkexsGateway)
|
|
|
|
# main_engine.add_gateway(DaGateway)
|
2019-09-25 08:00:24 +00:00
|
|
|
# main_engine.add_gateway(CoinbaseGateway)
|
|
|
|
main_engine.add_gateway(BitstampGateway)
|
2019-10-18 11:22:35 +00:00
|
|
|
main_engine.add_gateway(GateiosGateway)
|
2019-05-17 02:06:43 +00:00
|
|
|
|
2019-09-17 14:35:40 +00:00
|
|
|
main_engine.add_app(CtaStrategyApp)
|
2019-09-17 15:28:36 +00:00
|
|
|
main_engine.add_app(CtaBacktesterApp)
|
2019-06-25 08:25:34 +00:00
|
|
|
# main_engine.add_app(CsvLoaderApp)
|
|
|
|
# main_engine.add_app(AlgoTradingApp)
|
|
|
|
# main_engine.add_app(DataRecorderApp)
|
|
|
|
# main_engine.add_app(RiskManagerApp)
|
2019-09-15 09:44:08 +00:00
|
|
|
# main_engine.add_app(ScriptTraderApp)
|
|
|
|
# main_engine.add_app(RpcServiceApp)
|
|
|
|
main_engine.add_app(SpreadTradingApp)
|
2019-01-18 01:35:35 +00:00
|
|
|
|
2019-01-08 12:45:01 +00:00
|
|
|
main_window = MainWindow(main_engine, event_engine)
|
|
|
|
main_window.showMaximized()
|
|
|
|
|
2019-01-08 13:53:03 +00:00
|
|
|
qapp.exec()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|