示例#1
0
        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public zFastMIN zFastMIN(Data.IDataSeries input, int period)
        {
            if (cachezFastMIN != null)
            {
                for (int idx = 0; idx < cachezFastMIN.Length; idx++)
                {
                    if (cachezFastMIN[idx].Period == period && cachezFastMIN[idx].EqualsInput(input))
                    {
                        return(cachezFastMIN[idx]);
                    }
                }
            }

            lock (checkzFastMIN)
            {
                checkzFastMIN.Period = period;
                period = checkzFastMIN.Period;

                if (cachezFastMIN != null)
                {
                    for (int idx = 0; idx < cachezFastMIN.Length; idx++)
                    {
                        if (cachezFastMIN[idx].Period == period && cachezFastMIN[idx].EqualsInput(input))
                        {
                            return(cachezFastMIN[idx]);
                        }
                    }
                }

                zFastMIN indicator = new zFastMIN();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input  = input;
                indicator.Period = period;
                Indicators.Add(indicator);
                indicator.SetUp();

                zFastMIN[] tmp = new zFastMIN[cachezFastMIN == null ? 1 : cachezFastMIN.Length + 1];
                if (cachezFastMIN != null)
                {
                    cachezFastMIN.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cachezFastMIN       = tmp;
                return(indicator);
            }
        }
示例#2
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);
                }
            }
        }
示例#3
0
        protected override void OnStartUp()
        {
            if (intype == RWT_HA.PrimaryOHLC.BARS)
            {
                highSeries = High;
                lowSeries  = Low;
            }
            else
            {
                highSeries = Input;
                lowSeries  = Input;
            }

            maxs     = zFastMAX(highSeries, swingStrength);
            mins     = zFastMIN(lowSeries, swingStrength);
            smoother = RWT_MA.MAFactory.create(type, (double)length);
            smoother.init(lowSeries[0]);
            extseen     = highSeries[0];
            lookForHigh = true;
        }
示例#4
0
 protected override void OnStartUp()
 {
     zmax = zFastMAX((useJustInput?High:Input), length);
     zmin = zFastMIN((useJustInput?Low:Input), length);
 }