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

MACD EXP for Amibroker (AFL)
nicky
almost 14 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 2)
Tags:
trading system, amibroker, exploration

MACD with buy/sell signal

Similar Indicators / Formulas

OPTIMIZED ICHIMOKU
Submitted by ritesh.bafna88 over 12 years ago
Reaction Trend System
Submitted by ajayjain90 almost 15 years ago
Behgozin Strength Finder
Submitted by hotaro3 over 12 years ago
KPL with RSI
Submitted by pdkg_gal almost 15 years ago
Intraday Trend Break System
Submitted by nishantndk almost 15 years ago
ema crossovers
Submitted by rushee.g1100 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
_SECTION_BEGIN("MA Difference 20 Period");
//------------------------------------------------------------------------------
//
//  This indicator displays how far the closing price is above or below a 20
//  period moving average in % terms. It is displayed as a histogram and the
//  bars are green if the closing price is above the MA and red if the closing
//  price is below the MA.
//
//  T may be changed to alter the MA period. ie Change T=20 to T=200 for the
//  200 period MA.
//
//  /*MA Diff 20 by Larry Lovrencic*/
//
//  T=20; /*Time Period for MA*/
//
//  KMA=((C-MA(C,T))/MA(C,T))*100;
//
//  GRAPH0=KMA;
//
//  GRAPH0STYLE=2+4;
//
//  GRAPH0BARCOLOR=iif(KMA>0,5,4);
//
//  graphxspace=5;
//
//  title=name()+" "+date()+" The Close is
//  "+writeval(abs(KMA),format=1.2)+"%"+writeif(KMA>0," above"," below")+" the
//  20 period MA";
//
//  Mark Grid lines:
//
//  Level 0
//
//  Limits
//
//  Show dates
//
//  Percent
//
//  Middle
//
//------------------------------------------------------------------------------
 
/*MA Diff 20 by Larry Lovrencic*/
T=20; /*Time Period for MA*/
KMA=((C-MA(C,T))/MA(C,T))*100;  
Graph0=KMA;
Graph0Style=2+4;
Graph0BarColor=IIf(KMA>0,5,4);
GraphXSpace=5;
 
Title=Name()+" "+Date()+" The Close is "+WriteVal(abs(KMA),format=1.2)+"%"+WriteIf(KMA>0," above"," below")+" the 13 period MA";
_SECTION_END();
 
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
 
_SECTION_END();
 
//------------------------------------------------------------------------------
//  Author: Stephane Carrasset
//------------------------------------------------------------------------------
//
//  Function changes DateNum ex:1040928 en String ddmmyyyy ex:28/09/2004 ( only
//  > 2000 year )
//
//  Returns in Interpretation every date when occurs an Events.
//
//  Example of StrFormat; StrToNum; NumToStr; printf;
//
//  StaticVarSetText;
//
//------------------------------------------------------------------------------
 
_SECTION_BEGIN("ZIG - Zig");
P = ParamField( "Price field" );
change = Param("% change",1,0.1,25,0.1);
Plot( Zig(P, change), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
 
// Paste the code below to your price chart somewhere and green ribbon means both
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the ADX
// are both trending down.
 
_SECTION_BEGIN("trending ribbon");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
 
 
Plot( 3.5, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
 
_SECTION_END();
 
_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
 
_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);
 
 
Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));
 
Cond3 = Zig(C,z)>Ref(Zig(C,z),-2);
Buy = Cond1 AND Cond3;
 
Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));
 
Cond6 = Zig(C,z)<Ref(Zig(C,z),-2);
Sell = Cond4 AND Cond6;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");
 
_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V));
 
BG = IIf(Buy, colorGreen, IIf(Sell, colorRed, colorDefault));
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault));
 
if(Status("action") == actionIndicator)
{
Plot(C, "", colorGrey50, styleBar);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorAqua, 0, L, Offset=-15);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorPaleGreen, 0,L, Offset=-25);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorDarkGreen, 0,L, Offset=-20);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRose, 0, H, Offset=15);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorPink, 0,H, Offset=25);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-20);
 
}
 
if(Status("action") == actionExplore)
 
Filter = Buy OR Sell;
Action = WriteIf(Buy, "BUY", WriteIf(Sell, "SELL", "   "));
SetOption("NoDefaultColumns", True);
if (EndValue(Buy)==1) Say("Buy");
if (EndValue(Sell)==1) Say("Sell");
AddTextColumn(Name(), "    Symbol", 77, colorDefault, IIf(Buy, colorBrightGreen, colorRed),110);
AddColumn( DateTime(),"Date / Time    ", formatDateTime,colorDefault,IIf(Buy,colorBrightGreen,IIf(Sell,colorRed,Null)),150 );
//AddColumn(DateTime(), "Date", formatDateTime, FG, BG, 140);
//AddColumn(TimeNum() ,"Time",1);
AddColumn( C, "Close", 1.2 ,colorDefault,colorDefault,67);
AddColumn( H, "High", 1.2 ,colorDefault,colorDefault,67);
AddColumn(V, "Volume",1,colorDefault,colorDefault,67);
AddColumn(Ref(V,-1),"P-Vol",1,colorDefault,colorDefault,67);
AddColumn(V/Ref(V,-1)*100,"Increase in Vol",1,colorDefault,colorDefault,77);
//AddTextColumn(Action, "Action", 8.0, IIf(Buy, colorDarkGreen, colorDarkRed), colorWhite,67);
 
AddColumn( Buy, "Buy", 1 );
AddColumn( Sell, "Sell", 1 );
 
 
 
 
shape = Buy * shapeHollowUpTriangle + Sell * shapeHollowDownTriangle;
 
Plot( Close, "Price", colorBlack, styleCandle );
 
PlotShapes( shape, IIf( Buy, colorBlue, colorBlue ), 0, IIf( Buy, Low, High ) );
 
GraphXSpace = 7;
 
shape = Buy * shapeUpTriangle + Sell * shapeHollowDownTriangle;
 
Plot( Close, "Price", colorBlack, styleCandle );
 
PlotShapes( shape, IIf( Buy, colorBlue, colorBlue ), 0, IIf( Buy, Low, High ) );
 
GraphXSpace = 7;
_SECTION_END();
 
_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
    Time        = Now( 4 );
    Seconds     = int( Time % 100 );
    Minutes     = int( Time / 100 % 100 );
    Hours   = int( Time / 10000 % 100 );
    SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
    return SecondNum;
}
  
RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft     = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo     = TimeFrame - SecsLeft;
  
if ( NewPeriod )
{
    Say( "New period" );
    Plot( 1, "", colorYellow, styleArea | styleOwnScale, 0, 1 );
}
  
Title = "\n" +
  
        "  Current Time: " + Now( 2 ) + "\n" +
        "Chart Interval: " + NumToStr( TimeFrame, 1.0 ) + " Seconds\n" +
        " Second Number: " + NumToStr( SecNumber, 1.0, False ) + "\n" +
        "  Seconds Left: " + NumToStr( SecsLeft, 1.0, False ) + "\n" +
        " Seconds To Go: " + NumToStr( SecsToGo, 1.0, False );
 
// Background color
 
SetChartBkColor(ParamColor("Panel color ",colorBlue)); 
 
_SECTION_END();
 
_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), IIf( C > O, ParamColor("Up Color", colorGreen ), ParamColor("Down Color", colorRed ) ), ParamStyle( "Style", styleHistogram | styleThick, maskHistogram  ) );
_SECTION_END();

6 comments

1. ahmmad

Very nice Indicator.

2. gajananprofits@yahoo.co.in

nice indicator

3. gajananprofits@yahoo.co.in

it is used in nakshatra AFL.

4. gajananprofits@yahoo.co.in

nograph, only arrows visible.

5. gajananprofits@yahoo.co.in

there are two formulae in this graph.. separate them.

6. gajananprofits@yahoo.co.in

this is useless…The signals change later on.

Leave Comment

Please login here to leave a comment.

Back