<?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>MQLメモ | trading toolbox</title>
	<atom:link href="https://trading-toolbox.net/pages/category/mql_memo/feed" rel="self" type="application/rss+xml" />
	<link>https://trading-toolbox.net</link>
	<description></description>
	<lastBuildDate>Mon, 20 Aug 2018 16:07:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>MT4でGmailの送信サーバを使う方法（Googleのセキュリティ設定を変更する必要あり）</title>
		<link>https://trading-toolbox.net/pages/118.html</link>
					<comments>https://trading-toolbox.net/pages/118.html#respond</comments>
		
		<dc:creator><![CDATA[nisi617]]></dc:creator>
		<pubDate>Thu, 12 Nov 2015 11:08:56 +0000</pubDate>
				<category><![CDATA[MQLメモ]]></category>
		<guid isPermaLink="false">http://trading-toolbox.net/?p=118</guid>

					<description><![CDATA[MT4のE-メール設定でGmailを使用する方法については、既にネット上に幾つかの記事がありますが、 最近、Googleでは、セキュリティ設定で、安全性の低いアプリの使用を拒否する設定になっており、 MT4の設定が正しい [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>MT4のE-メール設定でGmailを使用する方法については、既にネット上に幾つかの記事がありますが、<br />
最近、Googleでは、セキュリティ設定で、<strong>安全性の低いアプリ</strong>の使用を拒否する設定になっており、<br />
MT4の設定が正しい場合でも、メールが送信できなくなっています。</p>
<p>これまでの設定で、突然MT4からメールが送信できなくなった場合は、<br />
以下の方法を試してみてください。</p>
<h3>Googleのセキュリティ設定で、安全性の低いアプリのアクセスを「オン」に設定する。</h3>
<p>以下のアドレスを開きます。<br />
<a rel="noopener" href="https://www.google.com/settings/u/2/security/lesssecureapps" target="_blank">https://www.google.com/settings/u/2/security/lesssecureapps</a></p>
<p><img decoding="async" src="https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-54.png" alt="img_2015-11-12_19-54" width="600" class="alignleft size-full wp-image-120" srcset="https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-54.png 830w, https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-54-600x237.png 600w, https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-54-300x119.png 300w" sizes="(max-width: 830px) 100vw, 830px" /><br />
<br style="clear:both;"></p>
<p>「オンにする」にチェックを入れてください。（設定が反映されるまで若干のタイムラグがあるようです）</p>
<p><b>オンにする＝安全性の低いアプリからアクセスできるようにする。</b></p>
<p>＜補足＞<br />
MT4のオプション設定方法</p>
<p><img fetchpriority="high" decoding="async" src="https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-45.png" alt="img_2015-11-12_19-45" width="672" height="433" class="alignleft size-full wp-image-121" srcset="https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-45.png 672w, https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-45-600x387.png 600w, https://trading-toolbox.net/wp-content/uploads/2015/11/img_2015-11-12_19-45-300x193.png 300w" sizes="(max-width: 672px) 100vw, 672px" /><br />
<br style="clear:both;"></p>
<p>上図のように、</p>
<p>・SMTPサーバー &#8212;&#8212;&#8211;> （ポート番号465を末尾に付ける）<br />
・SMTPログインID &#8212;&#8212;> Gmailのメールアドレス<br />
・SMTPパスワード &#8212;&#8212;> Gmailのパスワード<br />
・発信元 &#8212;&#8212;&#8212;&#8212;&#8211;> 送信メールアドレス（Gmailアドレス）<br />
・送信先 &#8212;&#8212;&#8212;&#8212;&#8211;> 送信先のメールアドレス（Gmailでなくてもよい）</p>
<p>を設定して下さい。テストボタンをクリックしてテストメールの送信が成功すれば設定はOKです。</p>
<p>なお、上記のように設定とすると、Googleのセキュリティ設定が甘くなってしまうので、発信元とするGmailアドレスは、捨てアドを用意して使用することをお勧めします。</p>
<p><font color=”#0000ff”>また、一旦、上記のように設定してもGoogleのセキュリティの規定の変更等により、再度、安全性の低いアプリのアクセスの設定が「オフ」にされてしまう場合があるようです。</p>
<p>もし、再びメールが送信できなくなった場合は、上記の設定をやり直してください。</font></p>
]]></content:encoded>
					
					<wfw:commentRss>https://trading-toolbox.net/pages/118.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MQLでの小数の取り扱いについて（NormalizeDoubleの働き）</title>
		<link>https://trading-toolbox.net/pages/89.html</link>
					<comments>https://trading-toolbox.net/pages/89.html#respond</comments>
		
		<dc:creator><![CDATA[nisi617]]></dc:creator>
		<pubDate>Fri, 23 Oct 2015 06:23:06 +0000</pubDate>
				<category><![CDATA[MQLメモ]]></category>
		<guid isPermaLink="false">http://trading-toolbox.net/?p=89</guid>

					<description><![CDATA[MQLで小数を扱う場合、NormalizeDoubleによる正規化をしないと、正しく判定されない場合があるので注意が必要です。 例えば0.01を10回足す下記のようなコードを書きます。 double val=0.0; f [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>MQLで小数を扱う場合、NormalizeDoubleによる正規化をしないと、正しく判定されない場合があるので注意が必要です。</strong></p>
<p>例えば0.01を10回足す下記のようなコードを書きます。</p>
<pre class="code source">double val=0.0;
for(int i=0; i&lt;10; i++){
   val+=0.01;
}

Print(val);
</pre>
<p>結果は「0.1」となるはずですが、<br />
以下のような値が出力されます。</p>
<pre class="result">&gt;&gt;0.09999999999999999</pre>
<p>これは0.1と等しい値として取り扱われるでしょうか？<br />
確かめてみましょう。</p>
<pre class="source">if(val==0.1){
      Print("the same");
}
else{
      Print("not the same");
}</pre>
<p>結果は、</p>
<pre class="result">&gt;&gt;not the same</pre>
<p>同じ値ではないと判定されてしまいます。</p>
<p>そこでNormalizeDoubleで正規化してみましょう。</p>
<pre class="code source">val=NormalizeDouble(var1,5);

Print(val);

if(val==0.1){
      Print("the same");
}
else{
      Print("not the same");
}</pre>
<p>結果は、</p>
<pre class="result">&gt;&gt;0.1
&gt;&gt;the same</pre>
<p>同じ値として判定されました！</p>
<p>上記の例のように、NormalizeDoubleによる正規化をしないと、正しく判定されない場合があるので注意が必要です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://trading-toolbox.net/pages/89.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MQL4メモ：文字列配列の初期値について</title>
		<link>https://trading-toolbox.net/pages/77.html</link>
					<comments>https://trading-toolbox.net/pages/77.html#respond</comments>
		
		<dc:creator><![CDATA[nisi617]]></dc:creator>
		<pubDate>Sun, 07 Jun 2015 15:18:47 +0000</pubDate>
				<category><![CDATA[MQLメモ]]></category>
		<category><![CDATA[mql4]]></category>
		<category><![CDATA[文字列配列]]></category>
		<guid isPermaLink="false">http://trading-toolbox.net/?p=77</guid>

					<description><![CDATA[数値配列の場合は、ArrayInitialize(object array[], double value)により初期値が設定できますが、 文字列配列ではできません。 文字列配列に値が入ってるかを確認する際などに、初期値 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>数値配列の場合は、<strong>ArrayInitialize(object array[], double value)</strong>により初期値が設定できますが、<br />
文字列配列ではできません。</p>
<p>文字列配列に値が入ってるかを確認する際などに、初期値を知っておく必要がありますが、<br />
宣言した直後の<strong>文字列配列には、初期値として何が入っているのでしょうか。</strong><br />
以下のように確かめてみました。</p>
<p><font color=”#0000ff”>//文字列配列を宣言<br />
string str_sample[100];</p>
<p>if(str_sample[0]==false){ Print(&#8220;A&#8221;); }<br />
if(str_sample[0]==true){ Print(&#8220;B&#8221;); }<br />
if(str_sample[0]==&#8221;&#8221;){ Print(&#8220;C&#8221;); }<br />
if(str_sample[0]==NULL){ Print(&#8220;D&#8221;); }<br />
if(str_sample[0]==EMPTY){ Print(&#8220;F&#8221;); }<br />
if(str_sample[0]==EMPTY_VALUE){ Print(&#8220;G&#8221;); }</font></p>
<p>とすると出力は</p>
<p><b>＞D</b></p>
<p>となり、文字列配列の初期値は<b>NULL</b>であることが分かります。</p>
<p>ちなみに、<br />
true/falseは数値（number）としても扱われ、</p>
<p><font color=”#0000ff”>Print((int)true);<br />
Print((int)false);</font></p>
<p>とすると、それぞれ</p>
<p><b>＞1<br />
＞0</b></p>
<p>となり、trueは<b>1</b>、falseは<b>0</b>と同値であることが分かります。</p>
<p>また、EMPTYとEMPTY_VALUEを確認すると、</p>
<p><font color=”#0000ff”>Print(EMPTY);<br />
Print(EMPTY_VALUE);</font></p>
<p><b>＞-1<br />
＞2147483647</b></p>
<p>EMPTYは<b>-1</b>、EMPTY_VALUEは<b>2147483647</b>となっています。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://trading-toolbox.net/pages/77.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MT4のビルド600(Build600)系バージョンアップに伴うShellExecuteAのエラーについて</title>
		<link>https://trading-toolbox.net/pages/33.html</link>
					<comments>https://trading-toolbox.net/pages/33.html#respond</comments>
		
		<dc:creator><![CDATA[nisi617]]></dc:creator>
		<pubDate>Thu, 03 Apr 2014 11:47:24 +0000</pubDate>
				<category><![CDATA[MQLメモ]]></category>
		<guid isPermaLink="false">http://trading-toolbox.net/?p=33</guid>

					<description><![CDATA[MT4がビルド600(Build600)系バージョンアップしたことによる互換性の問題で 従来のShellExecuteAファンクションがそのままでは使用できない不具合がありました。 たとえば以下のようなMT4から外部アプ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>MT4がビルド600(Build600)系バージョンアップしたことによる互換性の問題で</p>
<p>従来の<span class="marker-under"><strong>ShellExecuteA</strong>ファンクションがそのままでは使用できない不具合</span>がありました。<div style="text-align:center; margin:5px 0 12px 0;"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- fxtoolbox-post-start-link --><ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-2080266310477183"
     data-ad-slot="2399523470"
     data-ad-format="link"
     data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div><span id="more-33"></span></p>
<p>たとえば以下のようなMT4から外部アプリケーションを開くコードです。</p>
<p>従来の書き方だと、ヘッダ部分で</p>
<div class="blank-box sticky">
<em>#import &#8220;shell32.dll&#8221;<br />
int ShellExecuteA(int handle, int , string , string, string, int);<br />
#import</em></div>
<p>そしてstart内で</p>
<div class="blank-box sticky">
<em>int start(){</em><br />
int test = ShellExecuteA(0, 0, &#8220;C:\\Windows\\notepad.exe&#8221;, &#8220;&#8221;, &#8220;&#8221;, SW_SHOW);<br />
}</div>
<p>のようにすれば動きましたが、</p>
<p>バージョンアップ後は、<strong>ShellExecuteA</strong>を<strong><span style="color: ”#f00”;">ShellExecuteWに変更</span></strong>しないと動かないようです。（<font color="#ff0000">他はそのままでOK</font>）</p>
<p>元々ANSI（Shift_JIS）文字コードで引数を渡していた仕様が、<span class="marker">Build600ではUnicodeに変更された</span>ために起こる不具合のようです。</p>
<p>引数で日本語を使用していない場合でもエラーは発生します。</p>
<p><b>変更後のコード</b></p>
<div class="blank-box sticky">
<p><em>#import &#8220;shell32.dll&#8221;</em><br />
<em> int ShellExecuteW(int handle, int , string , string, string, int);</em><br />
<em> #import</em></p>
<p><em>int start(){</em></p>
<p><em>int test = ShellExecuteW(0, 0, &#8220;C:\\Windows\\notepad.exe&#8221;, &#8220;&#8221;, &#8220;&#8221;, SW_SHOW);</em></p>
<p><em>}</em></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://trading-toolbox.net/pages/33.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
