00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #pragma once
00024
00025 #include <string>
00026 #include <list>
00027
00028 #include "RobotHelperInterfaces.h"
00029
00030 using namespace corelib;
00031
00032 namespace RT {
00033
00034 class RoboTrader;
00035
00036
00044 class RoboTrader : public IMarketDataConsumer,
00045 public IOrderConsumer,
00046 public IRiskInfoConsumer
00047 {
00048 public:
00050 RoboTrader() {}
00052 virtual ~RoboTrader() {}
00053
00055 virtual void onInit ()=0;
00057 virtual void onStart()=0;
00059 virtual void onStop ()=0;
00061 virtual void onClose()=0;
00063 virtual void onParameters()=0;
00064
00072 virtual void onNotification (const char* topic, const unsigned char* payload, int length) = 0;
00073
00075 virtual RTRobotStateInfo& robot_state_ref() {return robot_state_info_;}
00076
00077
00079 virtual void onMarketData (RTInstrument&) { }
00081 virtual void onMarketData (const inside_market_notification_t&, const std::string &) { }
00083 virtual void onMarketData (const market_depth_notification_t&, const std::string &) { }
00085 virtual void onMarketData (const implied_market_depth_notification_t&, const std::string &) { }
00087 virtual void onMarketData (const outright_market_depth_notification_t&, const std::string &) { }
00089 virtual void onMarketData (const market_state_notification_t&, const std::string &) { }
00091 virtual void onMarketData (const last_trade_carrier_t&, const std::string &) { }
00093 virtual void onMarketData (const rfq_notification_t&, const std::string &) { }
00095 virtual void onMarketData (const ohlc_carrier_t&, const std::string &) { }
00096
00097
00098
00100 virtual void execution_report (const RTExecutionReport& rp) = 0;
00102 virtual void order_cancel_reject (const RTOrderCancelReject& rp) = 0;
00104 virtual void business_message_reject(const RTBusinessMessageReject& rp) = 0;
00106 virtual void trade_report (const RTExecutionReport& rp) = 0;
00108 virtual void order_state_report (const RTExecutionReport& rp) = 0;
00109
00110
00111
00112 virtual void process_account(IAccount&) = 0;
00113
00114 virtual void process_position(IPosition&) = 0;
00116 virtual void process_alert(IAlert&) = 0;
00117
00119 virtual RobotHelperInterfacesProvider * api() {return api_;}
00121 virtual void api(RobotHelperInterfacesProvider* api) { api_ = api; }
00122
00123 protected:
00124 RobotHelperInterfacesProvider * api_;
00125 RTRobotStateInfo robot_state_info_;
00126 };
00127
00128 }
00129