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

BUY-SELL RIBBON for Amibroker (AFL)

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

afl with BUY-SELL with trend ribbon area for easy decision for trading…

Screenshots

Similar Indicators / Formulas

All in One
Submitted by Nahid over 14 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 10 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
Arvind' System
Submitted by akdabc over 14 years ago
Miftha remix for dse
Submitted by coolpace 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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
_SECTION_BEGIN("Chart Settings");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
    SetChartBkGradientFill(ParamColor("Upper Chart",1),ParamColor("Lower Chart",23));
    GraphXSpace=Param("GraphXSpace",10,0,100,1);
    dec = (Param("Decimals",2,0,7,1)/10)+1;
    bi = BarIndex();
    Lbi = LastValue(BarIndex());
    sbi = SelectedValue(bi);
    x1= BarCount-1;
Title = EncodeColor(55)+  Title = Name() + "     " + EncodeColor(32) + Date() +
"      " + EncodeColor(5) + "{{INTERVAL}}  " +
    EncodeColor(55)+ "     Open = "+ EncodeColor(52)+ WriteVal(O,dec) +
    EncodeColor(55)+ "     High = "+ EncodeColor(5) + WriteVal(H,dec) +
    EncodeColor(55)+ "      Low = "+ EncodeColor(32)+ WriteVal(L,dec) +
    EncodeColor(55)+ "    Close = "+ EncodeColor(52)+ WriteVal(C,dec)+
    EncodeColor(55)+ "    Volume = "+ EncodeColor(52)+ WriteVal(V,1);
_SECTION_END();
 
 
 
 
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
 
 
 
 
_SECTION_BEGIN("a");
// 3 period EMA >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
P3 = ParamField("Price field",-1);
Periods3 = Param("Periods3", 3 );
Plot( EMA( P3, Periods3 ), "3 EMA",ParamColor( "Color", colorBlack ),
ParamStyle("Style", styleDots) );
 
_SECTION_END();
 
_SECTION_BEGIN("b");
// 15 period EMA >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
P15 = ParamField("Price field",-1);
Periods15 = Param("Periods15", 15);
Plot( EMA( P15, Periods15 ), "15 EMA",/*_DEFAULT_NAME(),*/ ParamColor( "Color", colorBrown ),
ParamStyle("Style", styleDots) );
_SECTION_END();
 
_SECTION_BEGIN("swing1");
no=20;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
supres=IIf(avn==1,sup,res);
 
a=Cross(C,supres);
b=Cross(supres,C);
 
//Plot(supres,"Swing",colorYellow,styleStaircase);
Plot(supres,"Swing",colorYellow,styleDots);
 
//SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),ParamColor("BgBottom", ColorRGB( 172,172,172 )),ParamColor("titleblock",ColorRGB( 172,172,172 )));
 
 
grid_day = IIf(Day()!=Ref(Day(),-1),1,0); 
Plot(grid_day,"",colorDarkGrey,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
 
 
prev=AMA2(C,1,0);
d=IIf(C>( Ref(Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),-1) ),Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))), IIf(C<Ref(Min(Min(L,Ref(L,-20)),Min(Ref(L,-10),Ref(L,-15))),-1),Max(Max(H,Ref(H,-20)),Max(Ref(H,-10),Ref(H,-15))),PREV));
a=Cross(Close,d);
b=Cross(d,Close);
state=IIf(BarsSince(a)<BarsSince(b),1,0);
s=state>Ref(state,-1);
ss=state<Ref(state,-1);
sss=state==Ref(state,-1);
col=IIf(state == 1 ,51,IIf(state ==0,4,1));
 
//Plot(C,"",Col,64);
PlotShapes( shapeUpArrow * s ,colorBlack,0,L, Offset=s);
PlotShapes( shapeUpArrow * s ,colorWhite,0,L, Offset=s-12);
 
PlotShapes( shapeDownArrow *ss ,colorBlack,0,H, Offset=s);
PlotShapes( shapeDownArrow *ss ,colorWhite,0,H, Offset=s-12);
_SECTION_END();
 
 
 
_SECTION_BEGIN("VWAP with SD band");
 
ND = Day() != Ref(Day(), -1);
_SECTION_BEGIN("LETSGROW");
SetChartOptions(0,chartShowArrows|chartShowDates);
  
_N(Title = StrFormat(" Open %g, Hi %g, Lo %g, Close %g (%.1f%%)", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
 if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorGold)+ "----systems " " - " Name() + " - " + EncodeColor(colorDarkYellow)+ Interval(2) + EncodeColor(colorDarkYellow) +
 "  - " + Date() +" - "+ EncodeColor(colorRed) + "Open = "+EncodeColor(colorBlack)+WriteVal(O,8.2) + EncodeColor(colorRed) + ", High = "+EncodeColor(colorBlack)+ WriteVal(H,8.2)+ EncodeColor(colorRed) + ", Low= "+EncodeColor(colorBlack)+ WriteVal(L,8.2)+ EncodeColor(colorRed ) + ", Close= "+EncodeColor(colorBlack)+ WriteVal(C,8.2)+ EncodeColor(colorRed) + ", Vol= "+EncodeColor(colorBlack)+ WriteVal(V,1)+("\n")
);
 
//Plot( C, "Close", ParamColor("Color", colorWhite ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
 //Plot(C,"",colorRose, styleCandle );
Plot( C, "Close", ParamColor("Color", colorBlack ), ParamStyle("Style") | GetPriceStyle() );
Plot( O, "Open", ParamColor("Color", colorBlack ), styleNoDraw);
Plot( H, "High", ParamColor("Color", colorBlack ), styleNoDraw);
Plot( L, "Low", ParamColor("Color", colorBlack ),styleNoDraw);
 
 
 
 if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
 {
 ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
 }
 
 
 
 SL = ( HHV( H, 26 ) + LLV( L, 26) )/2; // standard, base, or kijun-sen line
 TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2; // turning, conversion, or tenkan-sen line
 DL = Ref( C, 26 ); // delayed close price, or chikou span
 Span1 = Ref( ( SL + TL )/2, -25 ); //Span1 and Span2 define the clouds
 Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
  
 hue = Param("Hue",140,0,255,1);
 sat = Param("Sat",100,0,255,1);
 bri = Param("bri",220,0,255,1);
 
Span1 = Ref( ( SL + TL )/2, -25 );      //Span1 and Span2 define the clouds
Span21 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);
 
SR=Span1-Span21;
Span2=Span1-0.05*SR;
Span3=Span1-0.1*SR;
Span4=Span1-0.15*SR;
Span5=Span1-0.2*SR;
Span6=Span1-0.25*SR;
Span7=Span1-0.3*SR;
Span8=Span1-0.35*SR;
Span9=Span1-0.4*SR;
Span10=Span1-0.45*SR;
Span11=Span1-0.5*SR;
Span12=Span1-0.55*SR;
Span13=Span1-0.6*SR;
Span14=Span1-0.65*SR;
Span15=Span1-0.7*SR;
Span16=Span1-0.75*SR;
Span17=Span1-0.8*SR;
Span18=Span1-0.85*SR;
Span19=Span1-0.9*SR;
Span20=Span1-0.95*SR;
 
ColorKumo=IIf(C>Span1,ColorRGB(10,100,40),IIf(C<Span2,ColorRGB(100,10,40),colorGrey40));
 
 
 
Plot(Span1,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span2,"",ColorKumo,styleDashed |styleNoLabel);
Plot(Span3,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span4,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span5,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span6,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span7,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span8,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span9,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span10,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span11,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span12,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span13,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span14,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span15,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span16,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span17,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span18,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span19,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span20,"",ColorKumo,styleDashed|styleNoLabel);
Plot(Span21,"",ColorKumo,styleDashed|styleNoLabel);
 
 Buy = Cross(TL,SL);
 Sell = Cross(SL,TL);
 shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
 //PlotShapes(shape,IIf(Buy,colorDarkGreen,colorRed), 0,IIf(Buy,Low,High));
 
 above = IIf(TL>Span1 AND TL>Span2,1,0);
 within = IIf(TL>Span1 AND TL<Span2,1,0);
 below = IIf(TL<Span1 AND TL<Span2,1,0);
 Buy = Cross(TL,SL) AND (DL>Close);
 Sell = Cross(SL,TL) AND (DL<SL);
 StrongBuy = Buy AND above;
 MediumBuy = Buy AND within;
 WeakBuy = Buy AND below;
 StrongSell = Sell AND below;
 MediumSell = Sell AND within;
 WeakSell = Sell AND above;
//////////////////////////////////////////////////code addition //////////////////////////////////////////////////////////////
 
GraphXSpace = 5;
dist = 4.5*ATR(10); 
  
 
_SECTION_END();
 
 
_SECTION_BEGIN("trend");
uptrend=PDI(20)>MDI(10)AND Signal(29)<MACD(13);
downtrend=MDI(10)>PDI(20)AND Signal(29)>MACD(13);
 
Plot( 2, /* 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, 1 );
 
_SECTION_END();
 
 
_SECTION_BEGIN("Magnified Market Price");
 
FS=Param("Font Size",28,11,100,1);
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorViolet) );
 
Hor=Param("Horizontal Position",766,1,1200,1);
Ver=Param("Vertical Position",1,1,1,1);
GfxTextOut(""+C,Hor , Ver );
GfxTextOut( Name(), Hor,Ver-50 );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Arial", 12, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorViolet) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
 
_SECTION_END();

2 comments

1. Caaher

does this formula look into future?

2. Caaher

???

Leave Comment

Please login here to leave a comment.

Back