Professional Documents
Culture Documents
Afl
Afl
//------------------------------------------------------------------------------
//
// Formula Name: Woodie's CCI Intraday Panel
// Author/Uploader: Dennis Skoblar
// E-mail: DennisAndLisa@sbcglobal.net
// Date/Time Added: 2006-07-23 23:12:08
// Origin: www.woodiescciclub.com
// Keywords: Woodies CCI, CCI
// Level: medium
// Flags: system,exploration,indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=646
// Details URL: http://www.amibroker.com/library/detail.php?id=646
//
//------------------------------------------------------------------------------
//
// Here is Woodie's CCI Intraday panel which was originally coded by
// Crasher_FL and Wring. It is a modified Daily CCI Panel with the CCI 14, and
// CCI 6. It is complete with pattern recognition,backtesting, scanning, and
// exploration options. The Pattern Recognition helps find the ZLR, HFE,
// GB100(with a 34ema +/- 15 degree nuance), VT,FAMIR,MR and Choppy (Chop mode
// being defined as the CCI bars inbetween the 100's for 10 or more bars. The
// reset out of chop is when the CCI hooks from extreme at the 200's). . The
// pattern recognition is located at the top left corner next to "Signal: ".
//
// 1=zlr
//
// 2-famir
//
// 3=vt
//
// 4=gb100
//
// 5=momentum reversal
//
// This version has the Mplay Exit Indicator in it. The MPLAY exit is a CCI
// hook to the oposite direction followed by another with the price closing in
// the oposite direction of the trade. I have coded the MPLAY Indicator with
// the CCI panel. It is a series of green and red circles just below the +200
// line. The nearest green circle that appears after a pattern (any pattern,
// not just the coded ones) is the exit for a long position. The nearest red
// circle is the exit after a short pattern. Ignore all the ones inbetween.
// The circles appear after every and any occurance of an MPLAY Exit,
// regardless if a pattern has appeared or not. Just use the nearest
// applicable circle to exit a pattern entered.
//
// I also added the EMA angle colors to the 100's. Turquoise= uptrend,
// Red=downtrend, Yellow=not trending. This code was originally in the cci
// panel coded by Crasher, I just tweeked it to be displayed in visual format.
// It is identical to woodie's modification to the cci panel, which he uses as
// a chop inicator as well. If there is a constant color, the trend is in that
// direction. If the colors are mixed, then there is a chop.
//
// *** Set background preference to Dark Olive Green
//
// Trade at your own risk, please use your own descretion, for educational
// purposes only.
//
// -Dennis
//
//------------------------------------------------------------------------------
///////////////////////////////
// Codded/Added by Kris
// Version: 1.027
// Additions:
// timer, EMA angle, LSMA angle, trending indicator, pattern recognition (Choppy,
HFE, ZLR, FAMIR, VT, GB100)
// Amibroker 4.70
///////////////////////////////
Version(4.70);
z = CCI(14);
z6 = CCI(6);
CCI50_var = CCI(50);
LSMA25 = LinearReg(C, 25 );
EMA34 = EMA(C,34);
PI = atan(1.00) * 4;
periods = 30;
TTMperiod = 6;
else
if(SelectedValue(CCI50_var) < 0)
CCI50Title = EncodeColor(colorRed);
else
CCI50Title = EncodeColor(colorLime);
x1_EMA34 = 0;
x2_EMA34 = 1;
y1_EMA34 = 0;
else
{
x1_LSMA25 = 0;
x2_LSMA25 = 1;
y1_LSMA25 = 0;
else
{
TrendBarCount = 6;
Color[0] = colorDefault;
Trend[0] = 0;
TTMColor[0] = colorDefault;
TTMColor[i] = colorDarkGreen;
TTMColor[i] = colorDarkRed;
}
else
Trend[i] = 1;
Trend[i] = -1;
else
if (Trend[i] == 1)
if (Minusbars[i] == TrendBarCount - 1)
Color[i] = colorYellow;
Color[i] = colorGrey40;
else
Color[i] = colorLime;
}
if (Plusbars[i] == TrendBarCount - 1)
Color[i] = colorYellow;
Color[i] = colorGrey40;
else
Color[i] = colorRed;
else
Color[i] = colorDefault;
// CCI Line
// Turbo CCI
// CCI Histogram
Plot(z,"", Color, styleHistogram | styleThick | styleNoLabel);
// CCI 50
// Set up color for the 100s, green if 34ema above red if below
Color=colorWhite;
//Plot(100,"",Color,styleDashed|styleNoLabel);
//Plot(-100,"",Color,styleDashed|styleNoLabel);
PlotGrid(0);
PlotGrid(50);
PlotGrid(-50);
PlotGrid(-100);
PlotGrid(100);
PlotGrid(-200);
PlotGrid(200);
// choppy
bs_a=BarsSince(A);
bs_b=BarsSince(B);
// ZLR Long
uptrend_a=BarsSince(z<0);
uptrend_b=BarsSince(z>0);
barsfromline_long=BarsSince(Linex_long);
PlotShapes(IIf(zlrlong,shapeDigit1,shapeNone),colorLime,0,0,-15);
// ZLR Short
downtrend_a=BarsSince(z>0);
downtrend_b=BarsSince(z<0);
barsfromline_short=BarsSince(Linex_short);
PlotShapes(IIf(zlrshort,shapeDigit1+ shapePositionAbove,shapeNone),colorRed,0,0,-
15);
// Famir Short
Famir_downtrend_a=BarsSince(z<0);
Famir_downtrend_b=BarsSince(z>0);
Famir_barsfromline_short=BarsSince(FamirLinex_short);
Ref(Famir_downtrend_a,-3)>=6 OR Ref(Famir_downtrend_a,-2)>=6 OR
Ref(Famir_downtrend_a,-1)>=6))) AND C<LSMA25;
PlotShapes(IIf(famirShort,shapeDigit2+ shapePositionAbove,shapeNone),colorRed,0,0,-
15);
// Famir Long
Famir_uptrend_a=BarsSince(z<0);
Famir_uptrend_b=BarsSince(z>0);
Famir_barsfromline_long=BarsSince(FamirLinex_long);
PlotShapes(IIf(famirlong,shapeDigit2,shapeNone),colorLime,0,0,-15);
// HFE
// VT Long
vt_barsfromline_long=BarsSince(vtLinex_long);
vtlong_A = z<-200;
vtlong_B = Ref(z,-1)<=Ref(z,-2) OR
Ref(z,-2)<=Ref(z,-3) OR
Ref(z,-3)<=Ref(z,-4) OR
Ref(z,-4)<=Ref(z,-5) OR
Ref(z,-5)<=Ref(z,-6) OR
Ref(z,-6)<=Ref(z,-7) OR
Ref(z,-7)<=Ref(z,-8);
vtlong_bs_A = BarsSince(vtlong_A);
vtlong_bs_B = BarsSince(vtlong_b);
vt_pivotlong= Vtlong_bars;
swinghibars=BarsSince(z>Ref(HHV(z,vt_barsfromline_long),-1));
PlotShapes(IIf(vtlong,shapeDigit3,shapeNone),colorLime,0,Min(z,0),-45);
// VT Short
vt_barsfromline_short=BarsSince(vtLinex_short);
vtshort_A = z>200 ;
vtshort_B =Ref(z,-1)>=Ref(z,-2) OR
Ref(z,-2)>=Ref(z,-3) OR
Ref(z,-3)>=Ref(z,-4) OR
Ref(z,-4)>=Ref(z,-5) OR
Ref(z,-5)>=Ref(z,-6) OR
Ref(z,-6)>=Ref(z,-7) OR
Ref(z,-7)>=Ref(z,-8);
vtshort_bs_A = BarsSince(vtshort_A);
vtshort_bs_B = BarsSince(vtshort_b);
vt_pivotshort= Vtshort_bars;
swinglowbars= BarsSince(z<Ref(LLV(z,vt_barsfromline_short),-1));
PlotShapes(IIf(vtshort,shapeDigit3+
shapePositionAbove,shapeNone),colorRed,0,Max(z,0),-45);
// GB 100 Long
uptrend_a=BarsSince(z<0);
uptrend_b=BarsSince(z>0);
barsfromline_longGB=BarsSince(Linex_longGB);
Ref(uptrend_a,-2)>=6 OR Ref(uptrend_a,-1)>=6));
PlotShapes(IIf(GB100long,shapeDigit4,shapeNone),colorLime,0,0,-60);
// GB100 Short
downtrend_a=BarsSince(z>0);
downtrend_b=BarsSince(z<0);
barsfromline_shortGB=BarsSince(Linex_shortGB);
PlotShapes(IIf(GB100short,shapeDigit4+ shapePositionAbove,shapeNone),colorRed,0,0,-
60);
// MR Long
MRuptrend_a=BarsSince(z<0);
MRuptrend_b=BarsSince(z>0);
MRbarsfromline_long=BarsSince(MRLinex_long);
PlotShapes(IIf(MRlong,shapeDigit5,shapeNone),colorLime,0,0,-50);
// MR Short
MRdowntrend_a=BarsSince(z>0);
MRdowntrend_b=BarsSince(z<0);
MRbarsfromline_short=BarsSince(MRLinex_short);
PlotShapes(IIf(MRshort,shapeDigit5+ shapePositionAbove,shapeNone),colorRed,0,0,-
50);
AddColumn( IIf(zlrlong,1,IIf(zlrshort,-
1,0)) ,"ZLR",1.0,colorWhite,IIf(zlrlong,colorGreen,IIf(zlrshort,colorRed,colorBlack
)));
AddColumn(IIf(famirlong,1,IIf(famirShort,-
1,0)),"Famir",1.0,colorWhite,IIf(famirlong,colorGreen,IIf(famirShort,colorRed,color
Black)));
AddColumn(IIf(vtlong,1,IIf(vtShort,-
1,0)),"Vegas",1.0,colorWhite,IIf(vtlong,colorGreen,IIf(vtShort,colorRed,colorBlack)
));
AddColumn(IIf(gb100long,1,IIf(gb100Short,-
1,0)),"GB100",1.0,colorWhite,IIf(gb100long,colorGreen,IIf(gb100Short,colorRed,color
Black)));
AddColumn( IIf(mrlong,1,IIf(mrShort,-
1,0)) ,"MR",1.0,colorWhite,IIf(mrlong,colorGreen,IIf(mrShort,colorRed,colorBlack)))
;
AddColumn(IIf(hfelong,1,IIf(hfeshort,-
1,0)),"HFE",1.0,colorWhite,IIf(hfelong,colorGreen,IIf(hfeshort,colorRed,colorBlack)
));
//Sell1=ExRem(Sell,Buy);
//Cover1=ExRem(Cover,Short);
//PlotShapes(IIf(Sell1,shapeDownArrow,shapeNone),colorLime,0,200,10);
//PlotShapes(IIf(Cover1,shapeDownArrow,shapeNone),colorRed,0,200,10);
//Signal Title
WriteIf(Famirlong,EncodeColor(colorYellow) + "FAMIR
",WriteIf(HFE,EncodeColor(colorYellow) + "HFE
",WriteIf(VTlong,EncodeColor(colorYellow) + "VT ",
WriteIf(VTshort,EncodeColor(colorYellow) + "VT
",WriteIf(GB100long,EncodeColor(colorYellow) + "GB100 ",
//Choppy Title
ChoppyTitle= WriteIf(A,EncodeColor(colorYellow) +
"CHOPPY",WriteIf(bars,EncodeColor(colorYellow) + "CHOPPY",""));
//Exit Title
Ctoema=round(C-EMA34);
Ctitle= WriteIf(Ctoema>0," points above EMA,",WriteIf(Ctoema<0," points below
EMA,"," on EMA,"));
angletitle= BarsSince(anglelimit);
//Title
Title = "" + Name() + ", " + Interval(2) + ", " + Date() + "\n" +
TitleTimeRem + EncodeColor(colorWhite) +
//Mplay Exit
PlotShapes(IIf(MplayExitLong,shapeSmallCircle,shapeNone),colorLime,0,200,-10);
PlotShapes(IIf(MplayExitShort,shapeSmallCircle,shapeNone),colorRed,0,200,-10);
_SECTION_END();