- 发布者:
- [删除]
- 显示:
- 1617
- 等级:
- 已发布:
- 2014.01.24 08:15
- 已更新:
- 2016.11.22 07:33
-
需要基于此代码的EA交易或指标吗?请在自由职业者服务中订购 进入自由职业者服务
MT5 客户端自编译版 344 之后, 加入了显示财经日历新闻的图形对象 (OBJ_EVENT)。
脚本输出当前的财经数据作为财经日历的示范, 最后一个主要 (粉红色) 事件的日期。
使用函数 datetime last_pink_event_date()
//+------------------------------------------------------------------+ //| The function returns the date of the last event | //| marked in pink (economic indicator | //| is less than expected). | //+------------------------------------------------------------------+ datetime last_pink_event_date() { string name=""; int total=ObjectsTotal(0)-1; for(int i=total; i>=0; i --) { name=ObjectName(0,i); if(ObjectGetInteger(0,name,OBJPROP_TYPE,0) != 109) continue; // 对象类型 if(ObjectGetInteger(0,name,OBJPROP_COLOR,0) != Pink) continue; // 对象颜色 datetime date=(datetime)StringSubstr(name,0,16); // 对象名字 return(date); //返回日期 } return(0); }
推荐:
- 在周末时, 图表上没有数据对象
- 指定图形对象显示并激活
由MetaQuotes Ltd译自英文
原代码: https://www.mql5.com/en/code/205

通过填加智能标记器增强您的图表, 标记器可以显示重要价格点, 以及年、月、周、日、时段的开始/结束, 包括当价格临近重要价格点时改变颜色 (如, 历史最高点/最低点)

这款 EA 使用两条均线和 RSI 指标。