<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script]]></title>
		<link>https://forexsb.com/forum/topic/9870/bug-swap-type-misinterpretation-in-metatrader-5-data-export-script/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/9870/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script.]]></description>
		<lastBuildDate>Tue, 24 Dec 2024 07:32:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script]]></title>
			<link>https://forexsb.com/forum/post/82208/#p82208</link>
			<description><![CDATA[<p>I&#039;ll check this case.</p><p>Thank you for the report!</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Tue, 24 Dec 2024 07:32:02 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/82208/#p82208</guid>
		</item>
		<item>
			<title><![CDATA[Re: Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script]]></title>
			<link>https://forexsb.com/forum/post/81581/#p81581</link>
			<description><![CDATA[<p>A function like this could be used to fix the issue:</p><div class="codebox"><pre><code>int MapSwapModeToMT4(int mt5SwapMode) 
{
   switch (mt5SwapMode) 
   {
      case SYMBOL_SWAP_MODE_POINTS:
         return 0; // Same as MT4 &#039;in points&#039;
      case SYMBOL_SWAP_MODE_CURRENCY_SYMBOL:
         return 1; // Same as MT4 &#039;in the symbol base currency&#039;
      case SYMBOL_SWAP_MODE_INTEREST_CURRENT:
         return 2; // Matches &#039;by interest&#039; conceptually
      case SYMBOL_SWAP_MODE_CURRENCY_MARGIN:
         return 3; // Same as MT4 &#039;in the margin currency&#039;
      // Any other cases unique to MT5
      default:
         return 0; // Default to 0 if no MT4 equivalent
   }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (geektrader)]]></author>
			<pubDate>Tue, 29 Oct 2024 03:29:44 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/81581/#p81581</guid>
		</item>
		<item>
			<title><![CDATA[Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script]]></title>
			<link>https://forexsb.com/forum/post/81580/#p81580</link>
			<description><![CDATA[<p>Hey Mr. Popov,</p><p>I&#039;ve stumbled upon a little hiccup in the Data Export script for Metatrader 5 (Data Export.mq5). </p><p>Here&#039;s the scoop: it seems like there&#039;s a bug where the script misinterprets the swap type. For those familiar, the enumeration of swap types in Metatrader 4 is quite different from that in Metatrader 5.</p><p>In Metatrader 4, the values are as follows:<br />- 0 - in points<br />- 1 - in the symbol&#039;s base currency<br />- 2 - by interest<br />- 3 - in the margin currency</p><p>You can check it out here: <a href="https://book.mql4.com/appendix/marketinfo">https://book.mql4.com/appendix/marketinfo</a></p><p>Expert Advisor Studio aligns with this interpretation in its Symbol settings too. </p><p>Now, in Metatrader 5, the swap types are enumerated differently:<br />- 0 - Swaps disabled (no swaps)<br />- 1 - Swaps are charged in points<br />- 2 - Swaps are charged in money in the base currency of the symbol<br />- 3 - Swaps are charged in money in the margin currency of the symbol<br />- 4 - Swaps are charged in money, in client deposit currency<br />....<br />And so on... For the full list, visit: <a href="https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_swap_mode">https://www.mql5.com/en/docs/constants/ … _swap_mode</a></p><p>This disparity leads to incorrect swap modes being exported in the Metatrader 5 Data Export script. Given these differences in enumeration, the Data Export script for MQ5 should ideally incorporate mappings to align swap types correctly with those in Metatrader 4 and Expert Advisor Studio.</p><p>Thanks for looking into this, and as always, happy trading, everyone!</p><p>Cheers!</p>]]></description>
			<author><![CDATA[null@example.com (geektrader)]]></author>
			<pubDate>Tue, 29 Oct 2024 03:13:13 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/81580/#p81580</guid>
		</item>
	</channel>
</rss>
