private ICTMComD2R CreateProxy()
 {
     //instantinate proxy            
     m_PipeProxy = m_PipeFactory.CreateChannel();
     return m_PipeProxy;
 }
        public void RequestDataRefresh()
        {
            if (m_PipeProxy == null)
                m_PipeProxy = ConnectionFactory.Instance.D2RConnectionInstance;
            try
            {
                if (oxyMainPlot.Model == null)
                    SetPlotModel();
                else
                    this.RefreshPlot();

                int l_OrderType = DecideOrderType();
                if (l_OrderType == 1)
                {
                    tbVolume.Text = ForexHelper.CalculateRisk(m_AdditionalData.Ask, sldBottomLine.Value, Double.Parse(tbRiskPercentage.Text), m_AdditionalData, m_CrossCurrencyData).ToString();
                }
                else if (l_OrderType == -1)
                {
                    tbVolume.Text = ForexHelper.CalculateRisk(m_AdditionalData.Bid, sldBottomLine.Value, Double.Parse(tbRiskPercentage.Text), m_AdditionalData, m_CrossCurrencyData).ToString();
                }

                tbPVolume.Text = ForexHelper.CalculateRisk(sldPendingLine.Value, sldBottomLine.Value, Double.Parse(tbRiskPercentage.Text), m_AdditionalData, m_CrossCurrencyData).ToString();
            }
            catch
            {
            }
        }
 public void CreateNewConnection()
 {
     //Connect to the robot channel
     l_RobotComFactory = new ChannelFactory<ICTMComD2R>(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/Robot/CTMComD2R"));
     m_D2RConnectionInstance = l_RobotComFactory.CreateChannel();
 }