From 5a9dfa747d4b6e1441d84deddc58386fd6111186 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 14 Sep 2019 11:06:08 +0800 Subject: [PATCH] [Add] new spread trading app --- vnpy/app/spread_trading/__init__.py | 17 +++++++++++++++++ vnpy/app/spread_trading/engine.py | 13 +++++++++++++ vnpy/app/spread_trading/ui/__init__.py | 1 + vnpy/app/spread_trading/ui/spread.ico | Bin 0 -> 67646 bytes vnpy/app/spread_trading/ui/widget.py | 25 +++++++++++++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 vnpy/app/spread_trading/__init__.py create mode 100644 vnpy/app/spread_trading/engine.py create mode 100644 vnpy/app/spread_trading/ui/__init__.py create mode 100644 vnpy/app/spread_trading/ui/spread.ico create mode 100644 vnpy/app/spread_trading/ui/widget.py diff --git a/vnpy/app/spread_trading/__init__.py b/vnpy/app/spread_trading/__init__.py new file mode 100644 index 00000000..7ff1bf13 --- /dev/null +++ b/vnpy/app/spread_trading/__init__.py @@ -0,0 +1,17 @@ +from pathlib import Path + +from vnpy.trader.app import BaseApp + +from .engine import SpreadEngine, APP_NAME + + +class AlgoTradingApp(BaseApp): + """""" + + app_name = APP_NAME + app_module = __module__ + app_path = Path(__file__).parent + display_name = "价差交易" + engine_class = SpreadEngine + widget_name = "SpreadManager" + icon_name = "spread.ico" diff --git a/vnpy/app/spread_trading/engine.py b/vnpy/app/spread_trading/engine.py new file mode 100644 index 00000000..1e4584b9 --- /dev/null +++ b/vnpy/app/spread_trading/engine.py @@ -0,0 +1,13 @@ + +from vnpy.event import EventEngine, Event +from vnpy.trader.engine import BaseEngine, MainEngine + +APP_NAME = "SpreadTrading" + + +class SpreadEngine(BaseEngine): + """""" + + def __init__(self, main_engine: MainEngine, event_engine: EventEngine): + """Constructor""" + super().__init__(main_engine, event_engine, APP_NAME) diff --git a/vnpy/app/spread_trading/ui/__init__.py b/vnpy/app/spread_trading/ui/__init__.py new file mode 100644 index 00000000..c7639754 --- /dev/null +++ b/vnpy/app/spread_trading/ui/__init__.py @@ -0,0 +1 @@ +from .widget import SpreadManager diff --git a/vnpy/app/spread_trading/ui/spread.ico b/vnpy/app/spread_trading/ui/spread.ico new file mode 100644 index 0000000000000000000000000000000000000000..05b3d571bd19802b6fa8529759d887b4f1639811 GIT binary patch literal 67646 zcmeI4S!`U_eTNUFgmG;lZ4xDMgFx~_9vsU+mc}AypW$#D4tG*gVn+{c9TZ6GIGF|o z3Ima9!$A5_q(E95c}icJNa%x~g0?nVsF1jbt4MJdhoY>7S}cl*NrRyzo_^e;#gtghhA*_JZ@fP;Beg>oF5Jcm~I3!r_B`k>!e^h&r^D;;9{Alo zpw9JCTnSVRMnuIxBwTSmx?C|9m5lOWKRs~9*bA=W{8iZF?t|h=ptM(0F%lIJ#=YrZ z^?+iS9_TiD;4bb@!U1;=sB?W3egdX{p8s6`ss~2d3;LYBU>fH~51tN{SDcQBZ-E;1 zQP>G=`uyAbfEtJBgD&Imf)#q;ZM^TRID>zS!cL&HXJ0uI6P4`$m1D7Gkef0RlNG)6 z!s&>j9~usJg?3e*;r9d7sE@)+pmG%dqcPL}IQ}1m>W@KsfW3fce-ZC*;C-)hZ&P>) zl=h5$qgBF(f8Ti3GRQ5#UQo$ifb(^D5B&Z!)xvis=1|(H7S8HT|5f?!%O8=!34 zKIk&~pr5e;cG)?ov6K#L-A^#S35y^-M{isP$7^J8;t|2U0z>oxdx5p)HyHQ&yV+|j zN~H%_H*2m+z>5EDTm}Xd?6Y11SBCpZ{O<(2f9!jV(g*AXtbHBc!@WPyT_pnafK9RY zL7XoeU(-ufnUaC(vCjg55PxUDPcQ8mkq-;hI!Qx_9+@ zQ0)b0>4Wb0T{wyV1IoRdVr+!)WSt04)TJ0@sS_Hnlc7O=V|w_#>8_rJqfoB)0Uy5$ zA;w}m4F8kbzq|KCBm5@x(g)quEATe{_bK-_#nc0lsd@n^keW;eVYL?w@V8KRjiMhK zLf!FQq3&Axz@!-ZK>N=)|5*P|*30lY`k>e7gGIc*0ei#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