⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 woodie's cci intraday panel.afl

📁 一个更精度的平滑涵数, 可用于股票交易系统.用于Amibroker 平台
💻 AFL
📖 第 1 页 / 共 2 页
字号:
//------------------------------------------------------------------------------
//
//  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
//
//------------------------------------------------------------------------------

/////////////////////////////// 

// CCI Woodies Style - Started by Wring 

// Codded/Added by Kris 

// Added by Dennis and Greg 

// Version: 1.027 

// Last Update: 11/24/2005 

// Additions: 

// timer, EMA angle, LSMA angle, trending indicator, pattern recognition (Choppy, HFE, ZLR, FAMIR, VT, GB100) 

// Amibroker 4.70 

/////////////////////////////// 

Version(4.70); 

//MarketHours = TimeNum()>=63000 AND TimeNum()<=125959; 

//MArketClose= TimeNum()>=125959 AND TimeNum()<=130000; 

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; 

HighHigh = HHV(H, periods); 

LowLow = LLV(L, periods); 

range = 25 / (HighHigh - LowLow) * LowLow; 

TTMperiod = 6; 

Low_ma = EMA(L, TTMperiod); 

High_ma = EMA(H, TTMperiod); 

Low_third = (High_ma - Low_ma) / 3 + Low_ma; 

High_third = 2 * (High_ma - Low_ma) / 3 + Low_ma; 

tempnum = Now( 4 ) - TimeNum(); 

TimeRem = Interval() - ((int(tempnum[BarCount - 1] / 100) * 60) + (tempnum[BarCount - 1] - int(tempnum[BarCount - 1] / 100) * 100)); 

if (TimeRem[BarCount - 1] < 0) TimeRem = 0; 

TitleTimeRem = EncodeColor(colorBlueGrey) + "Time Remaining: "; 

MinuteVar = int(TimeRem / 60); 

SecondsVar = int(frac(TimeRem / 60) * 60); 

if (TimeRem[BarCount - 1] > 60) 

{ 

TitleTimeRem = TitleTimeRem + EncodeColor(colorWhite) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; 

} 

else if (TimeRem[BarCount - 1] > 20) 

{ 

TitleTimeRem = TitleTimeRem + EncodeColor(colorYellow) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; 

} 

else 

{ 

TitleTimeRem = TitleTimeRem + EncodeColor(colorLime) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar; 

} 

if(SelectedValue(CCI50_var) < 0) 

{ 

CCI50Title = EncodeColor(colorRed); 

} 

else 

{ 

CCI50Title = EncodeColor(colorLime); 

} 

CCI50Title = CCI50Title + "CCI 50 = " + round(CCI50_var) + ", "; 

stop_range = IIf(O < C, IIf((H - O) < (C - L), C - L, H - O), 

IIf((O - L) < (H - C), H - C, O - L)); 

StopTitle = EncodeColor(colorWhite) + "Stop = " + EncodeColor(colorYellow); 

StopTitle = StopTitle + StrToNum(NumToStr(stop_range, 4.4)); 

x1_EMA34 = 0; 

x2_EMA34 = 1; 

y1_EMA34 = 0; 

y2_EMA34 = (Ref(EMA34, -1) - EMA34) / Avg * range; 

c_EMA34 = sqrt((x2_EMA34 - x1_EMA34)*(x2_EMA34 - x1_EMA34) + (y2_EMA34 - y1_EMA34)*(y2_EMA34 - y1_EMA34)); 

angle_EMA34 = round(180 * acos((x2_EMA34 - x1_EMA34)/c_EMA34) / PI); 

TitleAngleEMA34 = EncodeColor(colorWhite) + "\nEMA34 angle = "; 

angle_EMA34 = IIf(y2_EMA34 > 0, - angle_EMA34, angle_EMA34); 

if(SelectedValue(angle_EMA34) >= 25) 

{ 

TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorTurquoise); 

} 

else if(SelectedValue(angle_EMA34) <= -25) 

{ 

TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorRed); 

} 

else if(SelectedValue(angle_EMA34) >= 5) 

{ 

TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorTurquoise); 

} 

else if(SelectedValue(angle_EMA34) <= -5) 

{ 

TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorRed); 

} 

else 

{ 

TitleAngleEMA34 = TitleAngleEMA34 + EncodeColor(colorYellow); 

} 

TitleAngleEMA34 = TitleAngleEMA34 + angle_EMA34; 

x1_LSMA25 = 0; 

x2_LSMA25 = 1; 

y1_LSMA25 = 0; 

y2_LSMA25 = (Ref(LSMA25, -1) - LSMA25) / Avg * range; 

c_LSMA25 = sqrt((x2_LSMA25 - x1_LSMA25)*(x2_LSMA25 - x1_LSMA25) + (y2_LSMA25 - y1_LSMA25)*(y2_LSMA25 - y1_LSMA25)); 

angle_LSMA25 = round(180 * acos((x2_LSMA25 - x1_LSMA25)/c_LSMA25) / PI); 

TitleAngleLSMA25 = EncodeColor(colorWhite) + "LSMA25 angle = "; 

angle_LSMA25 = IIf(y2_LSMA25 > 0, - angle_LSMA25, angle_LSMA25); 

if(SelectedValue(angle_LSMA25) >= 25) 

{ 

TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorTurquoise); 

} 

else if(abs(SelectedValue(angle_LSMA25)) <= -25) 

{ 

TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorRed); 

} 

else if(SelectedValue(angle_LSMA25) >= 5) 

{ 

TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorTurquoise); 

} 

else if(SelectedValue(angle_LSMA25) <= -5) 

{ 

TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorRed); 

} 

else 

{ 

TitleAngleLSMA25 = TitleAngleLSMA25 + EncodeColor(colorYellow); 

} 

TitleAngleLSMA25 = TitleAngleLSMA25 + angle_LSMA25; 

TitleTrending = WriteIf((abs(angle_EMA34) >= 15) AND (abs(angle_EMA34 + angle_LSMA25) >= 50), EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorLime) + "TRENDING", 

WriteIf((abs(angle_EMA34) >= 5) AND (((angle_EMA34 >= 0) AND (angle_LSMA25 >= 0)) OR ((angle_EMA34 <= 0) AND (angle_LSMA25 <= 0))) AND (abs(angle_EMA34 + angle_LSMA25) >= 30), EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorYellow) + "NORMAL", 

EncodeColor(colorWhite) + ", SW = " + EncodeColor(colorRed) + "FLAT")); 

SW = IIf((abs(angle_EMA34) >= 15) AND (abs(angle_EMA34 + angle_LSMA25) >= 50), IIf(angle_LSMA25 > 0, 2, -2), 

IIf((abs(angle_EMA34) >= 5) AND (((angle_EMA34 >= 0) AND (angle_LSMA25 >= 0)) OR ((angle_EMA34 <= 0) AND (angle_LSMA25 <= 0))) AND (abs(angle_EMA34 + angle_LSMA25) >= 30), IIf(angle_LSMA25 > 0, 1, -1), 0)); 

// Colour the bars for Woodies Trend Following 

Plusbars = BarsSince(z < 0); 

Minusbars = BarsSince(z > 0); 

TrendBarCount = 6; 

Color[0] = colorDefault; 

Trend[0] = 0; 

TTMColor[0] = colorDefault; 

for( i = 1; i < BarCount; i++ ) 

{ 

if (C[i] > High_third[i]) 

{ 

TTMColor[i] = colorDarkGreen; 

} 

else if (C[i] < Low_third[i]) 

{ 

TTMColor[i] = colorDarkRed; 

} 

else 

{ 

TTMColor[i] = TTMColor[i - 1]; 

} 

if (Plusbars[i] >= TrendBarCount) 

{ 

Trend[i] = 1; 

} 

else if (Minusbars[i] >= TrendBarCount) 

{ 

Trend[i] = -1; 

} 

else 

{ 

Trend[i] = Trend[i - 1]; 

} 

if (Trend[i] == 1) 

{ 

if (Minusbars[i] == TrendBarCount - 1) 

{ 

Color[i] = colorYellow; 

} 

else if (z[i] < 0) 

{ 

Color[i] = colorBlack; 

} 

else 

{ 

Color[i] = colorLime; 

} 

} 

else if (Trend[i] == -1) 

{ 

if (Plusbars[i] == TrendBarCount - 1) 

{ 

Color[i] = colorYellow; 

} 

else if (z[i] >= 0) 

{ 

Color[i] = colorBlack; 

} 

else 

{ 

Color[i] = colorRed; 

} 

} 

else 

{ 

Color[i] = colorDefault; 

} 

} 

// CCI Line 

Plot(z,"CCI 14", colorBlack, styleLine | styleThick); 

// Turbo CCI 

Plot(z6,"CCI 6", colorDarkYellow, styleLine | styleNoLabel); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -