public void OnUpdateGUIDealsCollection(string isin, long botId, CObservableIdCollection <IIDable <long>, long> userDealsCol) { Update( new Action(() => UpdateDealSeries(botId, isin) )); }
private void UpdateDealSeries(long botId, string isin) { //not our isin if (isin != m_isin) { return; } //not elements if (m_plaza2Connector.DictBots[botId].GUIBot.UserDealsCollection.Count == 0) { return; } //if allready subscribed just update if (m_dictDealsCollection.ContainsKey(botId)) { UpdateDealsCollection(botId, isin); return; } // if not created yet, update, create series on graph m_dictDealsCollection[botId] = new CObservableIdCollection <CGUIUserDealViewModel, long>(); int cnt = m_dictDealsCollection.Count; m_dictColorsOfBots[botId] = m_listColorsOfSeries[cnt - 1]; UpdateDealsCollection(botId, isin); Style stl = (Style)App.Current.Resources["DealsStyle"]; CandleStickSeries css = new CandleStickSeries(); css.ItemsSource = m_dictDealsCollection[botId]; css.IndependentValuePath = "DateTF";// "Date"; css.DependentValueBinding = new Binding("Pos"); css.SizeValueBinding = new Binding("Height"); css.DataPointStyle = stl; ChartGraph.Series.Add(css); }
public CGUIBot(/*CPlaza2Connector*/ IClientGUIBot plaza2Connector, long botId) { m_plaza2Connector = plaza2Connector; BotId = botId; (new System.Threading.Tasks.Task(TaskSetGUIDispatcher)).Start(); MonitorPos = new CObservableIdCollection <MonitorPosInst, string>(); Orders = new CObservableIdCollection <OrderInst, long>(); PosLog = new ObservableCollection <CBotPos>(); UserDealsCollection = new CUserDealsCollection(BotId, (IClientUserDealsCollection)plaza2Connector); }
public CGUIBox(/*CPlaza2Connector*/ IClientGUIBox plaza2Connector) { Plaza2Connector = plaza2Connector; (new Thread(StartGUICandleBox)).Start(); (new Thread(ThreadWindowsUpdate)).Start(); // (new Thread(ThreadCandlesUpdate)).Start(); (new Thread(ThreadWindowsDealsUpdate)).Start(); (new Thread(ThreadWindowsStockUpdate)).Start(); Part = new ObservableCollection <PART.part>(); VM = new CObservableIdCollection <VMInst, string>(); Position = new CObservableIdCollection <PosisionInst, string>(); Orders = new CObservableIdCollection <OrderInst, long>(); }