コード例 #1
0
ファイル: zCBL.cs プロジェクト: Sandy4321/NinjaIndicators
 protected override void OnStartUp()
 {
     base.OnStartUp();
     System.Windows.Forms.Control[] coll = ChartControl.Controls.Find("tsrTool", false);
     if (coll.Length > 0)
     {
         strip = (System.Windows.Forms.ToolStrip)coll[0];
         System.Windows.Forms.ToolStripItem[] slider = strip.Items.Find(TBName, false);
         if (slider.Length > 0)
         {
             tsch = (RWT.ZControlHost)slider[0];
             tsch.addRef();
             tbar         = (System.Windows.Forms.TrackBar)tsch.Control;
             tbar.Scroll += new EventHandler(trackBar1_Scroll);
         }
         else
         {
             tbar         = new System.Windows.Forms.TrackBar();
             tbar.Maximum = 255;
             tbar.Minimum = 0;
             tbar.Value   = 255;
             tbar.Scroll += new EventHandler(trackBar1_Scroll);
             tsch         = new RWT.ZControlHost(tbar, TBName);
             tsch.addRef();
             strip.Items.Add(tsch);
         }
     }
 }
コード例 #2
0
 protected override void OnTermination()
 {
     if ((strip != null) && (tsch != null))
     {
         if (tsch.removeRef() <= 0)
         {
             strip.Items.Remove(tsch);
         }
         strip = null;
         tsch  = null;
     }
 }
コード例 #3
0
        protected override void OnStartUp()
        {
            slines = new rwt.SRLine[4];
            rlines = new rwt.SRLine[4];
            for (int i = 0; i < slines.Length; ++i)
            {
                slines[i] = new rwt.SRLine((Bars.BarsType.PeriodType == PeriodType.Volume), i, false);
                newBar   += slines[i].newBar;
                rlines[i] = new rwt.SRLine((Bars.BarsType.PeriodType == PeriodType.Volume), i + 4, true);
                newBar   += rlines[i].newBar;
            }
            mx          = zFastMAX(High, swingStrength);
            mn          = zFastMIN(Low, swingStrength);
            lookForHigh = true;
            mxSeen      = -1;
            mnSeen      = 0;
            barsAgo     = -1;
            tolerance   = plotWithin * TickSize;
            //if(Bars.BarsType.PeriodType==PeriodType.Volume) Log("Able to use simple volume!",LogLevel.Information);

            // ZFader Setup.....keep consistent with ZFader indicator...
            System.Windows.Forms.Control[] coll = ChartControl.Controls.Find("tsrTool", false);
            if (coll.Length > 0)
            {
                strip = (System.Windows.Forms.ToolStrip)coll[0];
                System.Windows.Forms.ToolStripItem[] slider = strip.Items.Find(TBName, false);
                if (slider.Length > 0)
                {
                    tsch = (RWT.ZControlHost)slider[0];
                    tsch.addRef();
                    tbar         = (System.Windows.Forms.TrackBar)tsch.Control;
                    tbar.Scroll += new EventHandler(trackBar1_Scroll);
                }
                else
                {
                    tbar         = new System.Windows.Forms.TrackBar();
                    tbar.Maximum = 255;
                    tbar.Minimum = 0;
                    tbar.Value   = 255;
                    tbar.Scroll += new EventHandler(trackBar1_Scroll);
                    tsch         = new RWT.ZControlHost(tbar, TBName);
                    tsch.addRef();
                    strip.Items.Add(tsch);
                }
            }
        }
コード例 #4
0
        protected override void OnStartUp()
        {
            base.OnStartUp();

            alphas = new double[6];
            double per = periodStart;

            for (int i = 0; i < 6; ++i, per += periodAdder)
            {
                Plots[i].Pen.Width = 1;
                Plots[i].Pen.Color = bandColor;
                alphas[i]          = 2.0 / (per + 1.0);
            }

            System.Windows.Forms.Control[] coll = ChartControl.Controls.Find("tsrTool", false);
            if (coll.Length > 0)
            {
                strip = (System.Windows.Forms.ToolStrip)coll[0];
                System.Windows.Forms.ToolStripItem[] slider = strip.Items.Find(TBName, false);
                if (slider.Length > 0)
                {
                    tsch = (RWT.ZControlHost)slider[0];
                    tsch.addRef();
                    tbar         = (System.Windows.Forms.TrackBar)tsch.Control;
                    tbar.Scroll += new EventHandler(trackBar1_Scroll);
                }
                else
                {
                    tbar         = new System.Windows.Forms.TrackBar();
                    tbar.Maximum = 255;
                    tbar.Minimum = 0;
                    tbar.Value   = 255;
                    tbar.Scroll += new EventHandler(trackBar1_Scroll);
                    tsch         = new RWT.ZControlHost(tbar, TBName);
                    tsch.addRef();
                    strip.Items.Add(tsch);
                }
            }
        }