Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Dynamic Positioning Indicator (DPI) for Amibroker (AFL)

Rating:
3 / 5 (Votes 7)
Tags:
oscillator, amibroker

DPI is a modified MACD indicator from Russ Horn.

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh over 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader over 14 years ago
3 Days Track
Submitted by janet0211 almost 15 years ago
Chande Momentum Oscillator
Submitted by klimpek over 14 years ago

Indicator / Formula

Copy & Paste Friendly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
_SECTION_BEGIN("rrm_dpi");
//--created by Kelvinhand
cBk =ParamColor("Background Color", colorBlack);
cBkTitle =ParamColor("Background Title Color", colorBlack);
 
SetChartBkGradientFill( cBk,cBk, cBkTitle);
SetChartOptions( 3, 0, chartGridMiddle);
 
cDodgerBlue = ColorRGB(30,144,255);
 
 
DPIfast = Param("Fast",  8,  2,200);
DPIslow = Param("Slow",  13, 2,200);
DPIsig  = Param("Signal", 13, 2,200);
 
cDPI= ParamColor("DPI Color", colorDarkGrey);
 
DPIThick  = ParamToggle("DPI Thick", "No|Yes", 1);
if (DPIThick)
  DPI_Style = styleNoLabel|styleThick;
else
  DPI_Style = styleNoLabel;
 
 
iMacd= MACD(DPIfast,DPIslow);
iSig = MA(iMACD, DPIsig);
 
iDiff = iMacd - iSig;
 
 
iDPI = Null;
iDPIMin =Null;
iDPIMax = Null;
 
 
dBull = Null;
dBear = Null;
 
for (i=0; i<BarCount; i++)
{
       
      if (iDiff[i] > 0.0 && iMacd[i] > 0.0)
          iDPI[i] = Min(iDiff[i], iMacd[i]);
           
      if (iDiff[i] < 0.0 && iMacd[i] < 0.0)
          iDPI[i] = Max(iDiff[i], iMacd[i]);
           
      if (iMacd[i] > 0.0)
          dBull = Max(iDiff[i], iMacd[i]);
      else 
          dBull = 0;
           
      if (iDiff[i] < 0.0)
          dBear = Min(iDiff[i], iMacd[i]);
      else
      {
         dBear = 0;
         dBull = Max(iDiff[i], iMacd[i]);
      }
       
      if (iMacd[i] < 0.0)
          dBear = Min(iDiff[i], iMacd[i]);
           
      if (abs(dBull) >= abs(dBear))
      {
         iDPIMax[i] = Max(dBull, dBear);
         if (dBull < 0.0 || dBear < 0.0)
            iDPIMin[i] = Min(dBull, dBear);
         else
            iDPIMin[i] = Null;
             
         iLead[i] = Null;
         iFollow[i] = Null;
          
      }
      else
      {
         iLead[i] = Min(dBull[i], dBear[i]);
         if (dBull > 0.0 || dBear > 0.0)
            iFollow[i] = Max(dBull, dBear);
         else
            iFollow[i] = Null;
 
         iDPIMax[i] = Null;
         iDPIMin[i] = Null;
      }
}
 
 
Plot(iMacd, "Macd", cDodgerBlue, DPI_Style);                           
Plot(iDiff, "Diff", colorRed,    DPI_Style);           
 
//Plot(iSig, "", colorDarkGrey,  styleNoLabel|styleThick|styleHistogram);          
 
Plot(iDPI, "", cDPI,  DPI_Style|styleHistogram, Null, Null, 0, -1);
Plot(iLead,   "", colorRed,  DPI_Style|styleHistogram, Null, Null, 0, -1); 
Plot(iFollow, "", colorRed,  DPI_Style|styleHistogram, Null, Null, 0, -1); 
Plot(iDPIMax, "", colorGold, DPI_Style|styleHistogram, Null, Null, 0, -1); 
Plot(iDPIMin, "", colorGold, DPI_Style|styleHistogram, Null, Null, 0, -1); 
 
 
Plot(0,   "", colorDarkGreystyleNoLabel);    //0
//--created by Kelvinhand
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back