protected override void CalcBar()
        {
            if (!Bars.LastBarOnChart)
            {
                return;
            }

            ExecControl.RecalcLastBarAfter(TimeSpan.FromSeconds(updatespeed_seconds));

            if (Bars.DOM.Connected)
            {
                m_value11 = 0;

                foreach (var domPrice in Bars.DOM.Ask)
                {
                    m_value11 = Math.Max(m_value11, domPrice.Size);
                }
                foreach (var domPrice in Bars.DOM.Bid)
                {
                    m_value11 = Math.Max(m_value11, domPrice.Size);
                }

                m_draw_dom_level1.Call();
                m_draw_dom_level2.Call();

                Plot1.Set("OK", Color.White);
            }
            else
            {
                Plot1.Set("Level2 data is not avaliable", Color.Red);
            }
        }
示例#2
0
        protected override void CalcBar()
        {
            m_avgdouble.Value = m_dema[0];
            // indicator logic
            if (((Displace >= 0) || Bars.CurrentBar > Math.Abs(Displace)))
            {
                Plot1.Set(Displace, m_avgdouble.Value);
            }
            if (BreakSignal)
            {
                if (m_dema[0] >= Bars.Close[0])
                {
                    if (!MarketStage.Equals("Falling"))
                    {
                        MarketStage = "Falling";
                        Alerts.Alert("Get ready for the falling trend start");
                    }
                    CellColor = Color.Red;
                                        #if DEBUG
                    //Output.WriteLine("Be ready for break down");
                                        #endif
                }
                else if (m_dema[0] <= Bars.Close[0])
                {
                    if (!MarketStage.Equals("Rising"))
                    {
                        MarketStage = "Rising";
                        Alerts.Alert("Get ready for the rising trend start");
                    }
                    CellColor = Color.Green;
                                        #if DEBUG
                    //Output.WriteLine("Be ready for break up");
                                        #endif
                }
            }

            Plot2.Set(MarketStage, CellColor);
        }