<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>阿狼的MT4编程外汇博客 &#187; MT4编程</title>
	<atom:link href="http://www.dqyau.net/tag/mt4%e7%bc%96%e7%a8%8b/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dqyau.net</link>
	<description>专注于MT4编程技术的外汇博客</description>
	<lastBuildDate>Tue, 04 May 2010 01:22:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>EA开发大师 v0.1版本发布</title>
		<link>http://www.dqyau.net/503.html</link>
		<comments>http://www.dqyau.net/503.html#comments</comments>
		<pubDate>Tue, 09 Jun 2009 04:30:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[ea开发大师]]></category>
		<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=503</guid>
		<description><![CDATA[* EA开发大师是一套能根据用户设定条件，自动生成EA源代码的“傻瓜式”EA开发软件，即使不懂MT4编程技术的，也可通过此款软件快捷高效地开发出心目中的理想EA。
* 目前EA开发大师为测试阶段，免费提供给所有用户使用。v0.1版本暂时只开发两个EA模型，后续版本会陆续开放新的EA模型，敬请关注本页面以获取最新版本的EA开发大师。
 
EA开发大师产品页面
]]></description>
		<wfw:commentRss>http://www.dqyau.net/503.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>即将发布的软件：EA大师</title>
		<link>http://www.dqyau.net/435.html</link>
		<comments>http://www.dqyau.net/435.html#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:11:14 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[ea大师]]></category>
		<category><![CDATA[ea编程]]></category>
		<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=435</guid>
		<description><![CDATA[EAd大师是我基于MQLib开发的一款EA开发软件，也就是我在群里俗称的“ea傻瓜机”，能根据设定的条件、参数自动生成ea代码，预计在5月份发布测试版本。

]]></description>
		<wfw:commentRss>http://www.dqyau.net/435.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MQLib开发专家试用版本发布</title>
		<link>http://www.dqyau.net/433.html</link>
		<comments>http://www.dqyau.net/433.html#comments</comments>
		<pubDate>Mon, 16 Mar 2009 07:00:26 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[指标]]></category>
		<category><![CDATA[MQLib]]></category>
		<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=433</guid>
		<description><![CDATA[我把MQLib开发专家的第一个试用版本发布出来了，有兴趣的朋友可以试用一下。由于时间关系，文档还在编写之中，同时因为MQLib尚未完善，所以目前限制了只能用于模拟帐号上。有兴趣的朋友请到MQLib官方网站下载：http://www.mqlib.com/chs/。
]]></description>
		<wfw:commentRss>http://www.dqyau.net/433.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何判断平台是5位/3位还是4位/2位的报价？</title>
		<link>http://www.dqyau.net/381.html</link>
		<comments>http://www.dqyau.net/381.html#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:07:17 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[5位报价]]></category>
		<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=381</guid>
		<description><![CDATA[有个学员在QQ上咨询了我这个问题，其实判断也很简单：在MT4提供的系统变量里，有个叫做Digits的int类型变量，其作用是返回当前货币对的小数位。那么，我们就可以这样来判断：

&#160;
if &#40;Digits==5 &#124;&#124; Digits==3&#41;   //是5位/3位报价
&#123;
...          //进行相应操作
&#125;
else if &#40;Digits==4 &#124;&#124; Digits==2&#41;  //是4位/2位报价
&#123;
...         //进行相应操作
&#125;

]]></description>
		<wfw:commentRss>http://www.dqyau.net/381.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EA下单中的有效期如何写</title>
		<link>http://www.dqyau.net/350.html</link>
		<comments>http://www.dqyau.net/350.html#comments</comments>
		<pubDate>Thu, 19 Feb 2009 06:43:47 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[experiation]]></category>
		<category><![CDATA[MT4]]></category>
		<category><![CDATA[有效期]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=350</guid>
		<description><![CDATA[最近群里有些朋友在询问EA下单时有效期expiration参数应怎么填写。其实也很简单，这个参数是以秒为单位的。下单时用当前的时间（服务器时间或本地时间）加上你计划的期限（以秒计算）即可，例如：

OrderSend&#40;…….,TimeCurrent&#40;&#41;+Period&#40;&#41;*60,..&#41;;

假如当前的图表是天图的话，那么这张挂单就会在24小时后失效（看不明白的先复习一下Period函数的作用）。
]]></description>
		<wfw:commentRss>http://www.dqyau.net/350.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>瑞士军刀：MarketInfo函数</title>
		<link>http://www.dqyau.net/332.html</link>
		<comments>http://www.dqyau.net/332.html#comments</comments>
		<pubDate>Mon, 09 Feb 2009 03:31:40 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[指标]]></category>
		<category><![CDATA[MarketInfo]]></category>
		<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=332</guid>
		<description><![CDATA[MT4编程中，有几个函数非常重要，而MarketInfo就是其中的一个。
大家都知道，瑞士军刀以其功能繁多而著称于世，同样，MarketInfo在MT4编程中也担当着类似的角色。通过使用MarketInfo函数，可以获得很多非常有用的信息。我们先来看看MarketInfo函数的原型定义：

double MarketInfo&#40;string symbol, int type&#41;;

我们可以看到，MarketInfo有两个参数，第一个顾名思义，就是货币对名称，指我们希望获得信息的货币对名称；第二个是一个叫做type的int类型参数，这个 参数就是关键了。举个例子，假如我们想获取GBPUSD的点差，可以这样获取：

MarketInfo&#40;“GBPUSD”, MODE_SPREAD&#41;;

又如我们想确定某个货币对在MT4中是否允许被交易，可以这样写：

MarketInfo&#40;“NZDJPY”, MODE_TRADEALLOWED&#41;;

假如返回值是1，表示允许，返回0则表示禁止交易此货币对。
]]></description>
		<wfw:commentRss>http://www.dqyau.net/332.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>善用MT4中的全局变量GlobalVariable</title>
		<link>http://www.dqyau.net/296.html</link>
		<comments>http://www.dqyau.net/296.html#comments</comments>
		<pubDate>Sat, 08 Nov 2008 12:09:13 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[EA]]></category>
		<category><![CDATA[GlobalVariable]]></category>
		<category><![CDATA[MT4]]></category>
		<category><![CDATA[全局变量]]></category>
		<category><![CDATA[指标]]></category>
		<category><![CDATA[脚本]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=296</guid>
		<description><![CDATA[全局变量在MT4编程中有两层含义，一是编程领域中常规的全局变量含义，即独立于所有函数之外定义的变量，生命周期覆盖整个程序；还有一个就是MT4中独有的：在同一MT4客户端内，所有的指标、脚本和EA都可共享同一全局变量：
GlobalVariable，这个概念类似于编程领域中的共享内存区域；下面简单介绍一下其用法。
首先是必须用到的三个函数：GlobalVariableSet()、GlobalVariableGet()、GlobalVariableDel()。顾名思义，这三个函数的作用分别是设置、获取和删除GlobalVariable。在任何一个指标、脚本和EA中，可用GlobalVariableSet来设置一个GlobalVariable，如：

GlobalVariableSet&#40;“test”, 1.2345&#41;;

这就设置好了，把这个指标挂到任何一张图表之上后，在同一个MT4客户端下运行的任何指标、脚本和EA都能读取到这个GlobalVariable了，读取方法：

GlobalVariableGet&#40;“Test”&#41;;

最后，如果我们不需要这个GlobalVariable了，就可以这样把它删除了：

GlobalVariableDel&#40;“Test”&#41;;

需要注意：一是GlobalVariable只能是double类型的数据，不能把string、数组之类的赋给它，否则编译的时候虽然不会报错，但其实是无效的；二是GlobalVariable的生命周期是名符其实的“全局”，在设置了一个GlobalVariable后，如果不用GlobalVariableDel来删除它，它将会一直存在，无论设置它的指标、脚本和EA是否已被删除，甚至MT4关闭后也会存在，下次重新启动MT4时这个GlobalVariable仍然是可用的！善用这点，在设计交易程序的时候可说是如虎添翼，呵呵！
]]></description>
		<wfw:commentRss>http://www.dqyau.net/296.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何生成任意周期的数据图表</title>
		<link>http://www.dqyau.net/217.html</link>
		<comments>http://www.dqyau.net/217.html#comments</comments>
		<pubDate>Tue, 14 Oct 2008 00:56:46 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[EA]]></category>
		<category><![CDATA[mq4]]></category>
		<category><![CDATA[mql]]></category>
		<category><![CDATA[MT4]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[外汇]]></category>
		<category><![CDATA[智能交易]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=217</guid>
		<description><![CDATA[虽然MT4内已经设置了多种周期的浏览方式，如M5、M15、M30等，但有些朋友喜欢看一些“非主流”的周期的图表，MT4内置的周期格式就已不能满足需求，这时就要通过别的途径来生成其它周期的数据图表。
在MT4中的“导航器”(Ctrl+N调出)，打开“脚本”一栏，大家可以看到有个叫做“period_converter”的脚本，顾名思义，这个就是用来生成任意周期的数据图表的脚本，而且这个是mt4内置的，非常方便。下面和大家分享一下这个脚本的用法。
假如我现在看EURUSD的2分钟图表，但MT4只有1分钟周期的图表，该怎么做？我们可以利用M1的数据来生成m2的图表，方法如下：首先打开EURUSD的M1图表：


然后双击刚才介绍的“period_converter”脚本，会弹出一个参数设置窗口：

我们看到只有1个参数ExtPeriodMultiplier，它的数值是以分钟为单位的，也就是说你想生成什么周期的图表，就填入这里行了，上面我们的目的是生成2分钟的图表，所以这里填“2”，如果我想生成20分钟的图表呢？自然就是填“20”了，如果想生成2小时的图表呢？也很简单：2X60=120，填入“120”就对了。
填入希望转换的周期，确定后，似乎什么都没发生？不然，其实MT4已经在后台为你生成了所需的图表，这时我们通过“文件”菜单，“打开离线历史数据”：

在弹出的窗口里面，我们可以找到我们需要的2分钟周期图表了：

双击“EURUSD,M2”，就会打开以2分钟为周期的图表：

需要注意的是，这是离线的历史数据，也就是说通过这种方式生成的任意周期图表，并不会自动更新。如需其自动更新，就需要用到一些较为复杂的技巧了，有兴趣的朋友可联系我进行更为深入的探讨。
]]></description>
		<wfw:commentRss>http://www.dqyau.net/217.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EA与止损</title>
		<link>http://www.dqyau.net/215.html</link>
		<comments>http://www.dqyau.net/215.html#comments</comments>
		<pubDate>Mon, 13 Oct 2008 08:44:43 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[EA]]></category>
		<category><![CDATA[MT4使用]]></category>
		<category><![CDATA[mq4]]></category>
		<category><![CDATA[mql]]></category>
		<category><![CDATA[MT4]]></category>
		<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[外汇]]></category>
		<category><![CDATA[智能交易]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=215</guid>
		<description><![CDATA[相信从事外汇交易一段时间的朋友，都可能遇到过价格突然刚好打到你预设的止损，即使别的平台都没有到达过这个价位的“怪异”情形，呵呵。那么我们处于弱者方的交易者，怎样去尽量避免这种情况呢？假如你是用MT4平台的话，就可以不给头寸设置止损，转而用EA来判断、执行止损，因为EA是运行在客户端的，平台商无法看到你的EA代码，自然也无从而知你的止损所在了。
]]></description>
		<wfw:commentRss>http://www.dqyau.net/215.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何在每根新Bar出来时才进行判断或交易</title>
		<link>http://www.dqyau.net/207.html</link>
		<comments>http://www.dqyau.net/207.html#comments</comments>
		<pubDate>Mon, 13 Oct 2008 03:15:48 +0000</pubDate>
		<dc:creator>阿狼</dc:creator>
				<category><![CDATA[MT4编程]]></category>
		<category><![CDATA[EA]]></category>
		<category><![CDATA[mq4]]></category>
		<category><![CDATA[mql]]></category>
		<category><![CDATA[MT4]]></category>
		<category><![CDATA[MT4 EA mq4 mql MT4编程 外汇 智能交易]]></category>
		<category><![CDATA[外汇]]></category>
		<category><![CDATA[智能交易]]></category>

		<guid isPermaLink="false">http://www.dqyau.net/?p=207</guid>
		<description><![CDATA[这是初学MT4编程的朋友问得比较多的一个问题。大家知道，start函数是在每次价格变动时都会被调用的，那么写在start函数内的各种条件判断和交易操作都会同时被执行，如何避免这种情况的发生呢？答案就是在进行各种条件判断或交易操作前，先判断当前的bar是否为一根新的bar（即在该bar的周期内没有进行过判断或交易）。
首先，我们定义一个全局变量：（如不清楚全局变量的含义，可翻查一下相关资料。这里补充说明一下，在MQL语言中，其实datetime类型就是int类型，所以写成如下格式其实也是可以的：然后，我们可以在start函数中进行是否为新bar的判断：



正如前面所说，MQL里面的时间类型其实就是int类型，所以可以进行大小的判断，在MT4中，随着时间的流逝，Time[]数组中的数值是从左往右不断增大的，Time[0]代表当前时间，也是Time[]数组中最大的数值。

]]></description>
		<wfw:commentRss>http://www.dqyau.net/207.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
