-
CheckCandle(默认:前一个):指定用于检查指标值的蜡烛图,用于显示和提醒。
-
PercentK(默认:8):随机指标 %K 线的时段。
-
PercentD(默认:3):随机指标 %D 线的时段。
-
Slowing(默认:3):随机指标的减缓值。
-
RSIP1(默认:14):快速 RSI 线的时段。
-
RSIP2(默认:70):慢速 RSI 线的时段。
-
Enable(可选:true/false):激活后,指标会在指定时间周期上计算和显示信号。
-
EnableNativeAlerts(默认:false):若激活,多个时间周期出现交汇信号时,将触发 MetaTrader 的本地弹出提醒。
-
EnableEmailAlerts(默认:false):若激活,将通过电子邮件发送多时间周期的交汇信号提示。
-
EnablePushAlerts(默认:false):若激活,将通过推送通知发送多时间周期的交汇信号提示。
部分代码展示
//+——————————————————————+
//| Trade Navigator.mq4 |
//| Copyright © 2009-2024, http://www.QChaos.com |
//| https://www.qchaos.com/ |
//+——————————————————————+
#property copyright “Copyright © 量化混沌, http://www.qchaos.com”
#property link “https://www.qchaos.com”
#property version “1.06”
#property strict
#property description “———————————————”
#property description “EA、指标公式分享”
#property description “EA、指标编写业务承接”
#property description “———————————————”
#property description “更多资源,关注公众号:量化程序”
#property description “微 信:QChaos001”
#property description “手机号:134-8068-5281”
#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;
}