Example #1
0
 public void Init(PermanentQueue<Event> messages, object[] args)
 {
   this.messageQueue = messages;
   messages.AddReader((object) this);
     this.portfolioName =  args[0] as string;
   this.Reset();
 }
Example #2
0
 public void Init(PermanentQueue <Event> messages, object[] args)
 {
     this.messageQueue = messages;
     messages.AddReader((object)this);
     this.portfolioName = args[0] as string;
     this.Reset();
 }
Example #3
0
 protected override void OnInit()
 {
     Queue = new PermanentQueue <Event>();
     Queue.AddReader(this);
     Reset(true);
     this.framework.EventManager.Dispatcher.FrameworkCleared += new FrameworkEventHandler(OnFrameworkCleared);
     this.framework.GroupDispatcher.AddListener(this);
     this.eventsBySelectorKey[""] = new List <GroupEvent>();
 }
Example #4
0
 protected override void OnInit()
 {
     Queue = new PermanentQueue<Event>();
     Queue.AddReader(this);
     Reset(true);
     this.framework.EventManager.Dispatcher.FrameworkCleared += OnFrameworkCleared;
     this.framework.GroupDispatcher.AddListener(this);
     this.eventsBySelectorKey[""] = new List<GroupEvent>();
 }
        public StrategyMonitorWidget()
        {
            Build();
            Queue = new PermanentQueue <Event>();
            Queue.AddReader(this);
            var f = Framework.Current;

            f.GroupDispatcher = new GroupDispatcher(f);
            f.GroupDispatcher.AddListener(this);
        }
Example #6
0
 public DataLoader(Framework framework)
 {
     OrderManagerQueue = new PermanentQueue<Event>();
     PortfolioEventQueue = new PermanentQueue<Event>();
     PortfolioManagerEventQueue = new PermanentQueue<Event>();
     framework.EventManager.Dispatcher.FrameworkCleared += DispatcherFrameworkCleared;
     framework.EventManager.Dispatcher.ExecutionCommand += DispatcherExecutionCommand;
     framework.EventManager.Dispatcher.ExecutionReport += DispatcherExecutionReport;
     framework.EventManager.Dispatcher.OrderManagerCleared += DispatcherOrderManagerCleared;
     framework.EventManager.Dispatcher.PositionOpened += DispatcherPositionOpened;
     framework.EventManager.Dispatcher.PositionChanged += DispatcherPositionChanged;
     framework.EventManager.Dispatcher.PositionClosed += DispatcherPositionClosed;
     framework.EventManager.Dispatcher.Fill += DispatcherNewFill;
     framework.EventManager.Dispatcher.Transaction += DispatcherTransaction;
     framework.EventManager.Dispatcher.PortfolioAdded += DispatcherPortfolioAdded;
     framework.EventManager.Dispatcher.PortfolioRemoved += DispatcherPortfolioRemoved;
     framework.EventManager.Dispatcher.PortfolioParentChanged += DispatcherParentChanged;
 }
Example #7
0
 public DataLoader(Framework framework)
 {
     OrderManagerQueue          = new PermanentQueue <Event>();
     PortfolioEventQueue        = new PermanentQueue <Event>();
     PortfolioManagerEventQueue = new PermanentQueue <Event>();
     framework.EventManager.Dispatcher.FrameworkCleared    += DispatcherFrameworkCleared;
     framework.EventManager.Dispatcher.ExecutionCommand    += DispatcherExecutionCommand;
     framework.EventManager.Dispatcher.ExecutionReport     += DispatcherExecutionReport;
     framework.EventManager.Dispatcher.OrderManagerCleared += DispatcherOrderManagerCleared;
     framework.EventManager.Dispatcher.PositionOpened      += DispatcherPositionOpened;
     framework.EventManager.Dispatcher.PositionChanged     += DispatcherPositionChanged;
     framework.EventManager.Dispatcher.PositionClosed      += DispatcherPositionClosed;
     framework.EventManager.Dispatcher.Fill                   += DispatcherNewFill;
     framework.EventManager.Dispatcher.Transaction            += DispatcherTransaction;
     framework.EventManager.Dispatcher.PortfolioAdded         += DispatcherPortfolioAdded;
     framework.EventManager.Dispatcher.PortfolioRemoved       += DispatcherPortfolioRemoved;
     framework.EventManager.Dispatcher.PortfolioParentChanged += DispatcherParentChanged;
 }
Example #8
0
        public OrderManagerWidget()
        {
            Build();

            this.messageQueue = SmartQuantService.DataLoader.OrderManagerQueue;
            this.messageQueue.AddReader(this);
            allOrders       = new OrderedDictionary();
            workingOrders   = new OrderedDictionary();
            filledOrders    = new OrderedDictionary();
            cancelledOrders = new OrderedDictionary();
            rejectedOrders  = new OrderedDictionary();
            orderFactory    = new OrderFactory();
//            this.seriesLists = new SortedList<DataTypeItem, List<InstrumentDataSeries>>(new DataTypeItemComparer());
//            var f = Framework.Current;
//            foreach (var instrument in f.InstrumentManager.Instruments)
//            {
//                foreach (var ds in f.DataManager.GetDataSeriesList(instrument, null))
//                {
//                    byte dataType = DataSeriesNameHelper.GetDataType(ds);
//                    DataTypeItem item = null;
//                    if (dataType == DataObjectType.Bar)
//                    {
//                        BarType barType;
//                        long barSize;
//                        if (DataSeriesNameHelper.TryGetBarTypeSize(ds, out barType, out barSize))
//                            item = new DataTypeItem(dataType, new BarType?(barType), new long?(barSize));
//                    }
//                    else
//                        item = new DataTypeItem(dataType, new BarType?(), new long?());
//                    if (item != null)
//                    {
//                        List<InstrumentDataSeries> list;
//                        if (!this.seriesLists.TryGetValue(item, out list))
//                        {
//                            list = new List<InstrumentDataSeries>();
//                            this.seriesLists.Add(item, list);
//                        }
//                        list.Add(new InstrumentDataSeries(instrument, ds, item));
//                    }
//                }
//            }
        }
Example #9
0
 public void Init(PermanentQueue<Event> messages)
 {
   this.messageQueue = messages;
   messages.AddReader((object) this);
 }
Example #10
0
        public DataLoader(Framework framework)
        {
            OrderManagerQueue          = new PermanentQueue <Event>();
            PortfolioEventQueue        = new PermanentQueue <Event>();
            PortfolioManagerEventQueue = new PermanentQueue <Event>();

            framework.EventManager.Dispatcher.ExecutionCommand += (sender, command) =>
            {
                OrderManagerQueue.Enqueue(command);
            };

            framework.EventManager.Dispatcher.ExecutionReport += (sender, report) =>
            {
                OrderManagerQueue.Enqueue(report);
            };

            framework.EventManager.Dispatcher.OrderManagerCleared += (sender, data) =>
            {
                OrderManagerQueue.Clear();
                OrderManagerQueue.Enqueue(data);
            };

            framework.EventManager.Dispatcher.FrameworkCleared += (sender, args) =>
            {
                PortfolioEventQueue.Clear();
                PortfolioManagerEventQueue.Clear();
                PortfolioEventQueue.Enqueue(new OnFrameworkCleared(args.Framework));
            };

            framework.EventManager.Dispatcher.PositionOpened += (sender, args) =>
            {
                PortfolioEventQueue.Enqueue(new OnPositionOpened(args.Portfolio, args.Position));
            };

            framework.EventManager.Dispatcher.PositionChanged += (sender, args) =>
            {
                PortfolioEventQueue.Enqueue(new OnPositionChanged(args.Portfolio, args.Position));
            };

            framework.EventManager.Dispatcher.PositionClosed += (sender, args) =>
            {
                PortfolioEventQueue.Enqueue(new OnPositionClosed(args.Portfolio, args.Position));
            };

            framework.EventManager.Dispatcher.Fill += (sender, fill) =>
            {
                PortfolioEventQueue.Enqueue(fill);
            };

            framework.EventManager.Dispatcher.Transaction += (object sender, global::SmartQuant.OnTransaction transaction) =>
            {
                PortfolioEventQueue.Enqueue(transaction);
            };

            framework.EventManager.Dispatcher.PortfolioAdded += (sender, args) =>
            {
                PortfolioManagerEventQueue.Enqueue(new OnPortfolioAdded(args.Portfolio));
            };

            framework.EventManager.Dispatcher.PortfolioDeleted += (sender, args) =>
            {
                PortfolioManagerEventQueue.Enqueue(new OnPortfolioDeleted(args.Portfolio));
            };

            framework.EventManager.Dispatcher.PortfolioParentChanged += (sender, args) =>
            {
                PortfolioManagerEventQueue.Enqueue(new OnPortfolioParentChanged(args.Portfolio));
            };
        }
Example #11
0
 public void Init(PermanentQueue <Event> messages)
 {
     this.messageQueue = messages;
     messages.AddReader((object)this);
 }
 public void Init(PermanentQueue<Event> messages, bool createOrders)
 {
     this.messageQueue = messages;
     this.messageQueue.AddReader((object)this);
 }