Ejemplo n.º 1
0
 public JBWeisWave JBWeisWave(ISeries <double> input, int length, SwingStyle style, bool showLines, bool showVolumes, bool showDeltas, bool showTail, int volumeLabelBarSpacing, int deltaLabelBarSpacing, int waveLineWidth, DashStyleHelper waveLineStyle, SolidColorBrush waveColor, NinjaTrader.Gui.Tools.SimpleFont volumeTextFont, SolidColorBrush upVolColor, SolidColorBrush downVolColor, NinjaTrader.Gui.Tools.SimpleFont deltaTextFont, SolidColorBrush upDeltaColor, SolidColorBrush downDeltaColor)
 {
     if (cacheJBWeisWave != null)
     {
         for (int idx = 0; idx < cacheJBWeisWave.Length; idx++)
         {
             if (cacheJBWeisWave[idx] != null && cacheJBWeisWave[idx].Length == length && cacheJBWeisWave[idx].Style == style && cacheJBWeisWave[idx].ShowLines == showLines && cacheJBWeisWave[idx].ShowVolumes == showVolumes && cacheJBWeisWave[idx].ShowDeltas == showDeltas && cacheJBWeisWave[idx].ShowTail == showTail && cacheJBWeisWave[idx].VolumeLabelBarSpacing == volumeLabelBarSpacing && cacheJBWeisWave[idx].DeltaLabelBarSpacing == deltaLabelBarSpacing && cacheJBWeisWave[idx].WaveLineWidth == waveLineWidth && cacheJBWeisWave[idx].WaveLineStyle == waveLineStyle && cacheJBWeisWave[idx].WaveColor == waveColor && cacheJBWeisWave[idx].VolumeTextFont == volumeTextFont && cacheJBWeisWave[idx].UpVolColor == upVolColor && cacheJBWeisWave[idx].DownVolColor == downVolColor && cacheJBWeisWave[idx].DeltaTextFont == deltaTextFont && cacheJBWeisWave[idx].UpDeltaColor == upDeltaColor && cacheJBWeisWave[idx].DownDeltaColor == downDeltaColor && cacheJBWeisWave[idx].EqualsInput(input))
             {
                 return(cacheJBWeisWave[idx]);
             }
         }
     }
     return(CacheIndicator <JBWeisWave>(new JBWeisWave()
     {
         Length = length, Style = style, ShowLines = showLines, ShowVolumes = showVolumes, ShowDeltas = showDeltas, ShowTail = showTail, VolumeLabelBarSpacing = volumeLabelBarSpacing, DeltaLabelBarSpacing = deltaLabelBarSpacing, WaveLineWidth = waveLineWidth, WaveLineStyle = waveLineStyle, WaveColor = waveColor, VolumeTextFont = volumeTextFont, UpVolColor = upVolColor, DownVolColor = downVolColor, DeltaTextFont = deltaTextFont, UpDeltaColor = upDeltaColor, DownDeltaColor = downDeltaColor
     }, input, ref cacheJBWeisWave));
 }
Ejemplo n.º 2
0
 public Indicators.JBWeisWave JBWeisWave(ISeries <double> input, int length, SwingStyle style, bool showLines, bool showVolumes, bool showDeltas, bool showTail, int volumeLabelBarSpacing, int deltaLabelBarSpacing, int waveLineWidth, DashStyleHelper waveLineStyle, SolidColorBrush waveColor, NinjaTrader.Gui.Tools.SimpleFont volumeTextFont, SolidColorBrush upVolColor, SolidColorBrush downVolColor, NinjaTrader.Gui.Tools.SimpleFont deltaTextFont, SolidColorBrush upDeltaColor, SolidColorBrush downDeltaColor)
 {
     return(indicator.JBWeisWave(input, length, style, showLines, showVolumes, showDeltas, showTail, volumeLabelBarSpacing, deltaLabelBarSpacing, waveLineWidth, waveLineStyle, waveColor, volumeTextFont, upVolColor, downVolColor, deltaTextFont, upDeltaColor, downDeltaColor));
 }
Ejemplo n.º 3
0
 public Indicator.PriceActionSwing PriceActionSwing(int dtbStrength, double swingSize, SwingStyle swingType, bool useCloseValues)
 {
     return(_indicator.PriceActionSwing(Input, dtbStrength, swingSize, swingType, useCloseValues));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Swings
        /// </summary>
        /// <returns></returns>
        public Indicator.PriceActionSwing PriceActionSwing(Data.IDataSeries input, int dtbStrength, double swingSize, SwingStyle swingType, bool useCloseValues)
        {
            if (InInitialize && input == null)
            {
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
            }

            return(_indicator.PriceActionSwing(input, dtbStrength, swingSize, swingType, useCloseValues));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Swings
        /// </summary>
        /// <returns></returns>
        public PriceActionSwing PriceActionSwing(Data.IDataSeries input, int dtbStrength, double swingSize, SwingStyle swingType, bool useCloseValues)
        {
            if (cachePriceActionSwing != null)
            {
                for (int idx = 0; idx < cachePriceActionSwing.Length; idx++)
                {
                    if (cachePriceActionSwing[idx].DtbStrength == dtbStrength && Math.Abs(cachePriceActionSwing[idx].SwingSize - swingSize) <= double.Epsilon && cachePriceActionSwing[idx].SwingType == swingType && cachePriceActionSwing[idx].UseCloseValues == useCloseValues && cachePriceActionSwing[idx].EqualsInput(input))
                    {
                        return(cachePriceActionSwing[idx]);
                    }
                }
            }

            lock (checkPriceActionSwing)
            {
                checkPriceActionSwing.DtbStrength = dtbStrength;
                dtbStrength = checkPriceActionSwing.DtbStrength;
                checkPriceActionSwing.SwingSize = swingSize;
                swingSize = checkPriceActionSwing.SwingSize;
                checkPriceActionSwing.SwingType = swingType;
                swingType = checkPriceActionSwing.SwingType;
                checkPriceActionSwing.UseCloseValues = useCloseValues;
                useCloseValues = checkPriceActionSwing.UseCloseValues;

                if (cachePriceActionSwing != null)
                {
                    for (int idx = 0; idx < cachePriceActionSwing.Length; idx++)
                    {
                        if (cachePriceActionSwing[idx].DtbStrength == dtbStrength && Math.Abs(cachePriceActionSwing[idx].SwingSize - swingSize) <= double.Epsilon && cachePriceActionSwing[idx].SwingType == swingType && cachePriceActionSwing[idx].UseCloseValues == useCloseValues && cachePriceActionSwing[idx].EqualsInput(input))
                        {
                            return(cachePriceActionSwing[idx]);
                        }
                    }
                }

                PriceActionSwing indicator = new PriceActionSwing();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input          = input;
                indicator.DtbStrength    = dtbStrength;
                indicator.SwingSize      = swingSize;
                indicator.SwingType      = swingType;
                indicator.UseCloseValues = useCloseValues;
                Indicators.Add(indicator);
                indicator.SetUp();

                PriceActionSwing[] tmp = new PriceActionSwing[cachePriceActionSwing == null ? 1 : cachePriceActionSwing.Length + 1];
                if (cachePriceActionSwing != null)
                {
                    cachePriceActionSwing.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1]   = indicator;
                cachePriceActionSwing = tmp;
                return(indicator);
            }
        }