Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (ThisHigh == A)
- {
- if (ShowAlerts == true)
- {
- Alert("MyAlrt1" + CurrentBar.ToString(), Priority.High, "D3SpotterV3: High Found", MyAlert1, 3, Brushes.Black, Brushes.Yellow);
- }
- for (int i = QueueLength-1; i >= 1; i--)
- {
- HighBarsAgo[i] = HighBarsAgo[i-1];
- }
- HighBarsAgo[0] = CurrentBar - A;
- Draw.Dot(this, "Hdot" + CurrentBar.ToString(), true, A, High[A] + (TickSize * MarkerDistanceFactor), UpperDotColor);
- DrawOnPricePanel = false;
- Draw.Dot(this, "IHdot" + CurrentBar.ToString(), true, A, Indicator[A], UpperDotColor);
- DrawOnPricePanel = true;
- if (++QHLength >= 2)
- {
- for(int i = 0; i < Math.Min(QHLength, QueueLength); i++)
- {
- BarsAgo = CurrentBar - HighBarsAgo[i];
- IndicatorDiff = Indicator[A] - Indicator[BarsAgo];
- switch (PType)
- {
- case D3SpotPriceType.High_Low:
- PriceDiff = High[A] - High[BarsAgo];
- break;
- case D3SpotPriceType.Open_Close:
- PriceDiff = Close[A] - Close[BarsAgo];
- break;
- case D3SpotPriceType.SMA1:
- PriceDiff = SMA(High, 1)[A] - SMA(High, 1)[BarsAgo];
- break;
- default :
- PriceDiff = High[A] - High[BarsAgo];
- break;
- }
- if (((IndicatorDiff < IndicatorDiffLimit) && (PriceDiff >= PriceDiffLimit)) || ((IndicatorDiff > IndicatorDiffLimit)
- && (PriceDiff <= PriceDiffLimit)))
- {
- if ((BarsAgo - A) < ScanWidth)
- {
- if (ShowAlerts == true)
- {
- Alert("MyAlrt2" + CurrentBar.ToString(), Priority.High, "D3SpotterV3: Divergence Found", MyAlert2, 10, Brushes.Black, Brushes.Red);
- }
- Draw.Line(this, "high"+CurrentBar.ToString() + BarsAgo.ToString(), true, BarsAgo, High[BarsAgo] + (TickSize * MarkerDistanceFactor), A,
- High[A] + (TickSize * MarkerDistanceFactor), divergenceColor, divergenceDashStyle, divergenceLineWidth);
- Draw.TriangleDown(this, CurrentBar.ToString(), true, 0, High[0] + (TickSize * MarkerDistanceFactor), Brushes.Red);
- DrawOnPricePanel = false;
- Draw.Line(this, "IH"+CurrentBar.ToString() + BarsAgo.ToString(), true, BarsAgo, Indicator[BarsAgo], A, Indicator[A], divergenceColor,
- divergenceDashStyle, divergenceLineWidth);
- DrawOnPricePanel = true;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment