|
Статистика |
|
|
Онлайн всего: 1 Гостей: 1 Пользователей: 0 |
|
|
|
Каталог файлов |
|
Индикатор TrendMagic
[ Скачать с сервера (1.6 Kb)
]
| 20.10.2010, 22:44 |
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Black
#property indicator_color4 Black
extern int CCPeriod = 21;
extern int ATRPeriod = 120;
double bufGreen[];
double bufRed[];
int init()
{
{SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(0, bufGreen);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(1, bufRed);}
return (0);
}
int deinit()
{
return (0);
}
int start()
{
double dCCiNormal;
double dCCiShift1;
int counted = IndicatorCounted();
if (counted < 0) return (-1);
if (counted > 0) counted--;
int li_0 = Bars - counted;
for (int i = li_0; i >= 1; i--)
{
dCCiNormal = iCCI(NULL, 0, CCPeriod, PRICE_TYPICAL, i);
dCCiShift1 = iCCI(NULL, 0, CCPeriod, PRICE_TYPICAL, i + 1);
if (dCCiNormal >= 0 && dCCiShift1 < 0) bufGreen[i + 1] = bufRed[i + 1];
if (dCCiNormal <= 0 && dCCiShift1 > 0) bufRed[i + 1] = bufGreen[i + 1];
if (dCCiNormal >= 0)
{
bufGreen[i] = (Low[i]+Close[i])/2 - iATR(NULL, 0, ATRPeriod, i);
if (bufGreen[i] < bufGreen[i + 1] && Close[i] > bufGreen[i]) bufGreen[i] = bufGreen[i + 1];
}
else
{
if (dCCiNormal <= 0)
{
bufRed[i] = (High[i]+Close[i])/2 + iATR(NULL, 0, ATRPeriod, i);
if (bufRed[i] > bufRed[i + 1] && Close[i] < bufRed[i]) bufRed[i] = bufRed[i + 1];
}
}
}
return (0);
}
|
Категория: Мои файлы | Добавил: fxpart
|
Просмотров: 1909 | Загрузок: 198
| Комментарии: 2
| Рейтинг: 0.0/0 |
Всего комментариев: 1 | |
1
fuhhiffvoli
(02.01.2012 21:50)
0
почему бы и нет :)
|
|
|
|
|
|
Copyright MyCorp © 2024 |
|
|