外汇MT4编程:一种画线数值的编写方法
更新时间:2024-06-30 19:15:01 阅读量: 综合文库 文档下载
外汇MT4编程:一种画线数值的编写方法
外汇MT4编程:
一种获得画线数值的编写方法 非本人杰作,相信会对一些朋友有用
如何获得 所画的横线 竖线 趋势线 横竖线
趋势线的价格相信用来做 半自动EA 或指标比较实用
//下面这个函数 可以获得 最后一根横线的价格HlineBar 竖线的位置VlineBar 趋势线最后对应的价格 TrendArrayPrice[0],
实际上是TrendArrayPrice[] VlineTimeArray[] HlineArrayPrice[]
如果设置为全局数组可以把屏幕上的横线 竖线 趋势线都获得 改变数组的下标就可以了
//===========================================================int 自动获取物件()
{
RefreshRates();
int VlineCount=0;
int HlineCount=0;
int TrendCount=0;
int obj_total = ObjectsTotal();
ArrayResize(VlineTimeArray, obj_total);
ArrayResize(HlineArrayPrice, obj_total);
ArrayResize(TrendArrayPrice, obj_total);
VlineTimeArray[0]=NULL;
HlineArrayPrice[0]=NULL;
TrendArrayPrice[0]=NULL;
string name,text; int i, j;
for(i = 0; i < obj_total; i++) {
name = ObjectName(i);
if(ObjectType(name) == OBJ_VLINE) {
VlineTimeArray[VlineCount]=ObjectGet(name,OBJPROP_TIME1);
VlineCount++;
}if(ObjectType(name) == OBJ_HLINE) {
HlineArrayPrice[HlineCount]=ObjectGet(name,OBJPROP_PRICE1);
HlineCount++; }
if(ObjectType(name)==OBJ_TREND) //ObjectGetValueByShift {
TrendArrayPrice[TrendCount]=ObjectGetValueByShift(name,0);
TrendCount++;
}
}//for(i = 0; i < obj_total;
i++)VlineBar=iBarShift(Symbol(),0,VlineTimeArray[0],true);
HlineBar=HlineArrayPrice[0];
if(显示开关) {
//_Show(\订单号,0,200,0);
_ShowStr(\划线文字X位置,划线文字Y位置);
_Show(\划线文字X位置,划线文字Y位置+20,文字颜色);
_Show(\划线文字X位置,划线文字Y位置+40,文字颜色);
int obj_total = ObjectsTotal();
ArrayResize(VlineTimeArray, obj_total);
ArrayResize(HlineArrayPrice, obj_total);
ArrayResize(TrendArrayPrice, obj_total);
VlineTimeArray[0]=NULL;
HlineArrayPrice[0]=NULL;
TrendArrayPrice[0]=NULL;
string name,text; int i, j;
for(i = 0; i < obj_total; i++)
{
name = ObjectName(i);
if(ObjectType(name) == OBJ_VLINE) {
VlineTimeArray[VlineCount]=ObjectGet(name,OBJPROP_TIME1);
VlineCount++;
}if(ObjectType(name) == OBJ_HLINE) {
HlineArrayPrice[HlineCount]=ObjectGet(name,OBJPROP_PRICE1);
HlineCount++;
}
if(ObjectType(name)==OBJ_TREND) //ObjectGetValueByShift {
TrendArrayPrice[TrendCount]=ObjectGetValueByShift(name,0);
TrendCount++; }
}//for(i = 0; i < obj_total;
i++)VlineBar=iBarShift(Symbol(),0,VlineTimeArray[0],true);
HlineBar=HlineArrayPrice[0];
if(显示开关) {
//_Show(\订单号,0,200,0);
_ShowStr(\划线文字X位置,划线文字Y位置);
_Show(\划线文字X位置,划线文字Y位置+20,文字颜色);
_Show(\划线文字X位置,划线文字Y位置+40,文字颜色);
_Show(\划线文字X位置,划线文字Y位置+60,文字颜色); }
if(!显示开关) {
// ObjectDelete(\
ObjectDelete(\
ObjectDelete(\
ObjectDelete(\
ObjectDelete(\ }}
//====================================================================================== 4 在屏幕上显示自定义文字_show() 可以用来 显示 整形 double 数据
_showStr() 可以用来显示字符串可以见3 中的使用方法
//======================================================================================
void _Show(string Str,double dTemp,int dNum,int xOffset,int
yOffset,color 文字颜色) {
string Signal;
Signal=Str+\
_writetext(Str,Signal,划线文字X位置+xOffset,划线文字Y位置+yOffset,文字颜色,划线字体大小); }
//----------------------------------
void _ShowStr(string Str,string StrTemp,int xOffset,int yOffset) {
string Signal;
Signal=Str+\
_writetext(Str,Signal,划线文字X位置+xOffset,划线文字Y位置+yOffset,文字颜色,划线字体大小);
}void _writetext(string Labelname,string data,int x,int y,color ColorValue,int FontSize) {
RefreshRates();
ObjectDelete(Labelname);
ObjectCreate(Labelname, OBJ_LABEL, 0, 0, 0);
ObjectSetText(Labelname, data, FontSize, \ColorValue);
ObjectSet(Labelname, OBJPROP_CORNER, 0);
ObjectSet(Labelname, OBJPROP_XDISTANCE, x);
ObjectSet(Labelname, OBJPROP_YDISTANCE, y); }
//========================================================================================
正在阅读:
外汇MT4编程:一种画线数值的编写方法06-30
英文经典老歌20首推荐(附中英歌词)10-20
在全市志愿服务活动工作会上的讲话12-04
电子设计自动化技术重点知识11-11
《欧洲人权公约》中的平等与非歧视原则07-08
大学物理计算题05-26
虹桥小学组织全体师生观看“新时代好少年”先进事迹活动简报,《03-27
艺术节学生会工作总结12-03
技术部管理办法06-15
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 数值
- 外汇
- 编写
- 编程
- 方法
- MT4
- 适合做手机铃声的首英文歌
- 大学生创业项目之家政培训服务创业计划书
- 渭水校区冬春季工作日通勤车时刻
- 北师大版四年级数学下册知识点概括(2014整理)
- 关于发展红色旅游的调研报告
- 券商互保:广发180亿增发VS国信100亿IPO
- 幼儿园美术教育 - 图文
- 经营性公墓建设项目立项申请报告 收藏版
- 失恋了该怎么办
- 江苏省专业技术人员信息化素质考试试题(4套)
- 三年级数学(下)提升措施
- 内蒙古呼和浩特市2018年中考物理试题及答案解析
- 基于Zigbee技术的煤矿瓦斯监测系统 - 图文
- 新视野大学英语4选词填空原文和翻译
- 10Kv架空线路防雷技术改造毕业论文
- 中考历史一轮复习中近史《第五单元人民解放战争的胜利》教案
- 档案管理员岗位工作绩效考核细则
- (2015)“微观经济学A”习题(1)
- 副镇长公选和任职后心得体会-word范文(2页)
- 西安市学区划分