DONCHIAN CHANNEL(1)

DONCHIAN CHANNEL(1)最新版

更新日期:2022-03-02分类标签: 语言:中文平台:没限制

11 人已下载 手机查看

// —————————————————————————
// Классический канал Дончиана – по экстремумам за N дней.
//
// Буферы индикатора:
// 0 – Верхняя граница.
// 1 – Нижняя граница.
// 2 – Середина канала.
// —————————————————————————

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 clrRed
#property indicator_color2 clrGreen
#property indicator_color3 clrDarkViolet
#property indicator_style3 STYLE_DOT

// Длина рассматриваемой истории.
extern int HISTORY_DEPTH = 128;

// Буферы индикатора.
double buf_up[], buf_dn[], buf_md[];

// Инициализация.
int init() {
IndicatorShortName(StringConcatenate(
“DONCHIAN CHANNEL (“, HISTORY_DEPTH, “)”));
IndicatorDigits(Digits);

SetIndexBuffer(0, buf_up);
SetIndexBuffer(1, buf_dn);
SetIndexBuffer(2, buf_md);

SetIndexLabel(0, “UPPER BOUND”);
SetIndexLabel(1, “LOWER BOUND”);
SetIndexLabel(2, “MIDDLE LINE”);

return(0);
}

// Главный цикл.
int start() {
int i;

for(i = Bars – IndicatorCounted() – 1; i >= 0; i–) {
buf_up[i] = Close[iHighest(NULL, 0, MODE_CLOSE, HISTORY_DEPTH, i)];
buf_dn[i] = Open [iLowest (NULL, 0, MODE_OPEN, HISTORY_DEPTH, i)];
buf_md[i] = 0.5 * (buf_up[i] + buf_dn[i]);
}

return(0);
}

如果你对文件有了解,请帮助投票!

If you are familiar with the file, please help vote!

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位投票人。

相关资源

暂无评论

暂无评论...