MT4指标编程入门(九):MT4自定义指标的结构

2024-06-16 4464
外_汇_邦 WaiHuiBang.com   MT4自定义指标一般由四个部分构成:   文件头部  参数、变量和数组的定义  初始化函数init()  主函数start()  文件头部,也称为预处理程序  预处理程序以“#”开头,行尾无语句结束符“;”  常用的预处理程序有:  1、#propertyindicator_chart_window  把指标显示在主图。如:均线、SRA等类指标用到此语句  2、#propertyindicator_separate_window  把指标显示在副图。如:MACD、RSI、威廉等类指标用到此语句  3、#propertyindicator_buffers3  显示3根指标线  4、#propertyindicator_color1Red  第1根指标线的颜色为Red  5、#propertyindicator_width11  第1根指标线的粗细分别为1  6、#propertyindicator_level10.00  在0.00值位置横划1条虚线  参数、变量和数组的定义  全局性的参数、变量、数组在此定义,局部变量可在start()函数中定义  初始化函数init()  init()在自定义指标加载时运行一次。  初始化函数的功能是“设置”。如果自定义指标需要划线,则必然用到此函数  主函数start()  当数据有变动时,start()就被触发。数据变动一次,start()就运行一次。  自定义指标的编程主要依靠此函数进行。  start()函数的作用主要是取值和给指标线赋值,报警也在此函数内发起。  另外,还有一个反初始化函数deinit()  deinit()在自定义卸载时运行一次,可用以去除指标加载时init()所做的初始化操作。 外_汇_邦 WaiHuiBang.com
Sign In via X Google Sign In via Google
This page link:http://www.fxcue.com/12284.html
Tips:This page came from Internet, which is not standing for FXCUE opinions of this website.
Statement:Contact us if the content violates the law or your rights

Please sign in

关注我们的公众号

微信公众号