📄 woodie's cci panel intraday (697).afl
字号:
//------------------------------------------------------------------------------
//
// Formula Name: Woodie's CCI Panel Intraday
// Author/Uploader: Dennis Skoblar
// E-mail: DennisAndLisa@sbcglobal.net
// Date/Time Added: 2006-09-09 14:01:57
// Origin: www.woodiescciclub.com
// Keywords: Woodie's CCI
// Level: medium
// Flags: system,exploration,indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=697
// Details URL: http://www.amibroker.com/library/detail.php?id=697
//
//------------------------------------------------------------------------------
//
// *** NEW VERSION ***
//
// As of 9-9-2006
//
// *** The Sidewinder and CZI included in the panel are very close
// approximations derrived from watching the moderator's charts and are not
// derrived from Woodie's proprietary formula ***
//
// Note: to activate the timer properly, make sure the following is set:
//
// click on Tools==>Preferences==>Intraday....
//
// make sure "Allign minute bars to market hours" is checked...
//
// make sure "Start time of interval" is checked...
//
// make sure "Override: Weekly/monthly bars use day of last trade" is checked
//
// Now there is an inner panel color and outer panel color option...Use these
// settings...
//
// Go to Tools==>Colors==>Palette Editor==>Custom Colors
//
// Input these values under the Custom Colors section on the bottom, the first
// square is custom1, the last is custom16.
//
// These settings are for the outer border panel color. Put them in Custom11
// ...
//
// Hue: 86
//
// Sat: 37
//
// Lum: 110
//
// Red: 99
//
// Green: 135
//
// Blue: 104
//
// These settings are for the color of the inner panal color, both the upper
// half and the lower half. Put them in Custom14 ...
//
// Hue: 84
//
// Sat: 34
//
// Lum: 90
//
// Red: 82
//
// Green: 109
//
// Blue: 85
//
// Disclaimer: For educational purposes only, trade at your own risk.
//
// For updates...goto
//
// http://woodiescciclub.com/forum/viewtopic.php?t=1357
//
// -Dennis
//
//------------------------------------------------------------------------------
///////////////////////////////
// CCI Woodies Style
// Codded/Added by Dennis, Kris, Wring, Greg
// Last Update: 9/9/2006
// Amibroker 4.70
///////////////////////////////
// Color setup
// Go to Tools==>Colors==>Palette Editor==>Custom Colors
// Input these values under the Custom Colors section on the bottom, the first
// square is custom1, the last is custom16.
// These settings are for the outer border panel color. Put them in
// Custom11...
// Hue: 86
// Sat: 37
// Lum: 110
// Red: 99
// Green: 135
// Blue: 104
//
// These settings are for the color of the inner panal color,
// both the upper half AND the lower half. Put them in Custom14 ...
// Hue: 84
// Sat: 34
// Lum: 90
// Red: 82
// Green: 109
// Blue: 85
///////////////////////////////
//Setup Parameters section, right click on chart panel, click on Parameters:
// (1) =zlr
// (2) =famir
// (3) =vegas trade
// (4) =gb 100 line cross
// (5) =tony trade
// The last one "choppy" is not a pattern, but a signal that indicates a
// choppy
// market defined as CCI chopping
// back and forth inbetween the 100's. Choppy is gone once a Hook From Extreme
// occures.
///////////////////////////////
//Setup Axes and Grid section (right click on chart panel, click on
// Parameters):
// Scaling: Custom , Min=-275 Max=275
// Show Date Axis = Yes , Show Middle Lines = No
///////////////////////////////
// To activate the timer properly, make sure the following is set:
// click on Tools==>Preferences==>Intraday....
// make sure "Allign minute bars to market hours" is checked...
// make sure "Start time of interval" is checked...
// make sure "Override: Weekly/monthly bars use day of last trade" is checked.
///////////////////////////////
// Discalimer: For educational purposes only. Trade at your own risk.
///////////////////////////////
Version(4.70);
PositionSize = MarginDeposit = 1;
MH1=Param("Market Open",default=063000,000000,240000);
MH2=Param("Market Close",default=122700,000000,240000);
MarketHours = TimeNum()>=MH1 AND TimeNum()<=MH2;
MArketClose= TimeNum()<=MH2;
SetChartBkColor(ParamColor("Outer panel color ",colorCustom11)); // color of
// outer border
SetChartBkGradientFill( ParamColor("Inner panel color upper half",
colorCustom14),ParamColor("Inner panel color lower half",
colorCustom14)); // color of inner panel
zperiod=Param("CCI Period",default=14,0,100);
z = CCI(zperiod);
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(colorWhite);
MinuteVar = int(TimeRem );
if (TimeRem[BarCount - 1] > 60)
{
TitleTimeRem = TitleTimeRem + EncodeColor(colorWhite) + MinuteVar + "s";
}
else if (TimeRem[BarCount - 1] > 45)
{
TitleTimeRem = TitleTimeRem + EncodeColor(colorWhite) + MinuteVar + "s";
}
else
{
TitleTimeRem = TitleTimeRem + EncodeColor(colorYellow) + MinuteVar + "s";
}
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;
// 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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -