指标名称:趋势划线(Demark Trend Alert)
版本:MT4 ver. 2.6
交易指标Demark Trend Alert 是代表性的信号指标。如其名,Demark Trend Alert的工作原理基于价格突破趋势划线,指示市场趋势的方向。当价格自上而下突破升行趋势线时,该指标将显示一个警报窗口,告知发生突破的时间框架以及交叉点的价格值。
- 平台:Metatrader 4
- 货币对:任何(推荐主要货币对)
- 交易时间:任何时间
- 时间框架:M5或更高 推
- 当价格向上穿过向下的线时,指标显示向上箭头(进入多头仓位的入场点)。参数:
- showBars = 3000; // 如果showBars=0,则指标将显示在整个图表上
- LevDP = 2; // 点位级别;2表示中心柱高于左侧和右侧的两个柱
- qSteps = 1; // 步数,不超过3
- BackStep = 0; // 回退步数
- startBar = 0; // 如果startBar=0,表示当前柱有推荐,如果为1则为下一个可能的柱
- TrendLine = true; // false表示不显示趋势线
- HorizontLine = false; // true表示显示水平突破线
- ChannelLine = false; // true表示显示与趋势线平行的通道线
- TakeLines = false; // true表示显示获利线
- Comments = false; // true表示显示注释
- Trend = 0; // 1表示仅上升趋势线,-1表示仅下降趋势线,0表示所有趋势线
部分代码:
//+——————————————————————+
//|
property copyright
property link
property version "1.06"
property strict
property description "———————————————"
property description "EA、指标公式分享"
property description "EA、指标编写业务承接"
property description "———————————————"
property description "
property description "
property description "
property description "———————————————"
property description "交易导航仪 – 一款基于随机震荡指标、RSI和CCI读数提供简单交易建议的指标。"
property description "指标一致性提醒。"
property description "支持的时间框架:M1、M5、M15、M30、H1、H4、D1、W1、MN1。"
property indicator_separate_window
property indicator_plots 0
enum enum_candle_to_check
{
Current,
Previous
};
// Input parameters
input enum_candle_to_check CheckCandle = Previous; // CheckCandle: Affects both indications and alerts.
input string Stochastic_Settings = "=== Stochastic Settings ===";
input int PercentK = 8;
input int PercentD = 3;
input int Slowing = 3;
input string RSI_Settings = "=== RSI Settings ===";
input int RSIP1 = 14;
input int RSIP2 = 70;
input string Timeframe_Settings = "=== Timeframe Settings ===";
input bool Enable_M1 = false; // Enable M1
input bool Enable_M5 = true; // Enable M5
input bool Enable_M15 = true; // Enable M15
input bool Enable_M30 = true; // Enable M30
input bool Enable_H1 = true; // Enable H1
input bool Enable_H4 = true; // Enable H4
input bool Enable_D1 = true; // Enable D1
input bool Enable_W1 = true; // Enable W1
input bool Enable_MN1 = false; // Enable MN1
input string My_Alerts = "=== Alerts ===";
input bool EnableNativeAlerts = false;
input bool EnableEmailAlerts = false;
input bool EnablePushAlerts = false;
input string My_Colors = "=== Colors ===";
input color TFColor = clrLightSteelBlue; // Timeframe Color
input color IndicatorColor = clrPaleGoldenrod; // Indicator Color
input color BuyColor = clrLime; // Buy Color
input color SellColor = clrRed; // Sell Color
input color NeutralColor = clrKhaki; // Neutral Color
input string My_Symbols = "=== Wingdings Symbols ===";
input uchar sBuy = 233;
input uchar sSell = 234;
input uchar sWait = 54;
input uchar sCCIAgainstBuy = 238;
input uchar sCCIAgainstSell = 236;
// Global variables
int IndicatorWindow = -1;
string ShortName = "Trade Navigator";
// For alerts
int Confluence[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
int Confluence_prev[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
// Spacing
int scaleX = 100, scaleY = 20, offsetX = 90, offsetY = 20, fontSize = 8;
// Internal indicator parameters
ENUM_TIMEFRAMES TF[] = {PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H4, PERIOD_D1, PERIOD_W1, PERIOD_MN1};
int eCCI[] = {14, 14, 14, 6, 6, 6, 6, 5, 4};
int tCCI[] = {100, 50, 34, 14, 14, 14, 14, 12, 10};
// Text labels
string signalNameStr[] = {"Stoch", "RSI", "Entry CCI", "Trend CCI"};
int OnInit()
{
IndicatorShortName(ShortName);
if ((!Enable_M1) && (!Enable_M5) && (!Enable_M15) && (!Enable_M30) && (!Enable_H1) && (!Enable_H4) && (!Enable_D1) && (!Enable_W1) && (!Enable_MN1)) return INIT_FAILED;
return INIT_SUCCEEDED;
}