MT4价格预警指标

标签:
mt4价格预警报警提示指标脚本财经 |
分类: 交易成长 |
iPan
2011-12-31
1 源码如下
//+------------------------------------------------------------------+
//|
//|
//|
//+------------------------------------------------------------------+
#property copyright "Copyright ?2011, iPan."
#property
link
#property indicator_chart_window
//--- input parameters
extern double
extern
int
//+------------------------------------------------------------------+
//| Custom indicator initialization
function
//+------------------------------------------------------------------+
int init()
//+------------------------------------------------------------------+
//| Custom indicator deinitialization
function
//+------------------------------------------------------------------+
int deinit()
//+------------------------------------------------------------------+
//| Custom indicator iteration
function
//+------------------------------------------------------------------+
int start()
//+------------------------------------------------------------------+
2 使用
1)打开MetaEditor编辑器,新建 -> 客户指标 -> 导入上面源码 -> 编译;
2)在MT4主界面调用,选择“价格预警”指标,如下图:
5)价格修改成1562后,当前卖价是1562.8突破了1562,则报警如下:
--------------------------------------------------------------------------------------------------
增强版本如下:
//+------------------------------------------------------------------+
//|
//|
//|
//+------------------------------------------------------------------+
#property copyright "Copyright ?2012-06-11, iPan."
#property
link
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- indicator parameters
extern double
extern
int
extern bool audio = false; // 默认音频关闭
//--- buffers
double PriceLine[]; // 价位线
//+------------------------------------------------------------------+
//| Custom indicator initialization
function
//+------------------------------------------------------------------+
int init()
//+------------------------------------------------------------------+
//| Custom indicator deinitialization
function
//+------------------------------------------------------------------+
int deinit()
//+------------------------------------------------------------------+
//| Custom indicator iteration
function
//+------------------------------------------------------------------+
int start()
//+------------------------------------------------------------------+