<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — EA should work on fix Lot or dynamic lot]]></title>
		<link>https://forexsb.com/forum/topic/7270/ea-should-work-on-fix-lot-or-dynamic-lot/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/7270/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in EA should work on fix Lot or dynamic lot.]]></description>
		<lastBuildDate>Wed, 13 Jun 2018 13:32:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/50870/#p50870</link>
			<description><![CDATA[<div class="quotebox"><cite>shalem2014 wrote:</cite><blockquote><p>It&#039;s pretty easy to modify the EA yourself to use variable lots.</p><p>In the public declarations section at the top, add the following line right below the declaration for <strong>Entry_Amount</strong>:<br /></p><div class="codebox"><pre><code>static input bool Auto_Lot = false; // Auto lot size</code></pre></div><p>Scroll down to the <strong>OpenPosition</strong> function, and add this code at the bottom of the declarations section (where it says &quot;<em>color&nbsp; arrowColor =</em>&quot;):<br /></p><div class="codebox"><pre><code>      double Order_Size = Entry_Amount * (AccountBalance() / 10000);
      if (Auto_Lot == false) Order_Size = Entry_Amount;</code></pre></div><p>And then go through the rest of that function, replacing every instance of <strong>Entry_Amount</strong> with <strong>Order_Size</strong> (should be three instances).</p></blockquote></div><br /><p>i have done it now like this.</p><div class="codebox"><pre><code>//+------------------------------------------------------------------+
//|LOTCALCULATION                                                    |
//+------------------------------------------------------------------+
double NormalizeEntrySize(double size) {
   double minlot  = MarketInfo(_Symbol, MODE_MINLOT);
   double lotstep = MarketInfo(_Symbol, MODE_LOTSTEP);

   if (size &lt;= minlot)
       return (minlot);

   int steps = (int) MathRound((size - minlot) / lotstep);
   size = minlot + steps * lotstep;

   if (size &gt;= Maximum_Lots)
       size = Maximum_Lots;
       
   size = NormalizeDouble(size, digits);   

   return (size);
}   </code></pre></div><p>and in OpenPosition</p><p>added this</p><div class="codebox"><pre><code>  int margin=(int) MarketInfo(_Symbol,MODE_MARGINREQUIRED);
  double Entry_Amount=(Entry_Percent/100)*AccountEquity()/margin;
  Entry_Amount = NormalizeEntrySize(Entry_Amount);

  if(useFixedLot==true)
  Entry_Amount = Entry_Lots;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (deadlef)]]></author>
			<pubDate>Wed, 13 Jun 2018 13:32:57 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/50870/#p50870</guid>
		</item>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/50861/#p50861</link>
			<description><![CDATA[<p>It&#039;s pretty easy to modify the EA yourself to use variable lots.</p><p>In the public declarations section at the top, add the following line right below the declaration for <strong>Entry_Amount</strong>:<br /></p><div class="codebox"><pre><code>static input bool Auto_Lot = false; // Auto lot size</code></pre></div><p>Scroll down to the <strong>OpenPosition</strong> function, and add this code at the bottom of the declarations section (where it says &quot;<em>color&nbsp; arrowColor =</em>&quot;):<br /></p><div class="codebox"><pre><code>      double Order_Size = Entry_Amount * (AccountBalance() / 10000);
      if (Auto_Lot == false) Order_Size = Entry_Amount;</code></pre></div><p>And then go through the rest of that function, replacing every instance of <strong>Entry_Amount</strong> with <strong>Order_Size</strong> (should be three instances).</p>]]></description>
			<author><![CDATA[null@example.com (shalem2014)]]></author>
			<pubDate>Tue, 12 Jun 2018 16:17:07 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/50861/#p50861</guid>
		</item>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/50251/#p50251</link>
			<description><![CDATA[<p>when will it gonna be available. or have someone a good ready function code?</p>]]></description>
			<author><![CDATA[null@example.com (deadlef)]]></author>
			<pubDate>Thu, 19 Apr 2018 19:07:19 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/50251/#p50251</guid>
		</item>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/49740/#p49740</link>
			<description><![CDATA[<p>It will be in EA Studio first.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Thu, 22 Mar 2018 10:28:29 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/49740/#p49740</guid>
		</item>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/49738/#p49738</link>
			<description><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>I have such option in my ToDo list. However, now I&#039;m overloaded with other tasks, so it will take some time to to add it.<br />I&#039;m currently working on Walk - Forward analysis module and hope to release it within next two weeks.</p></blockquote></div><p>Hi, Popov</p><p>Walk - Forward Analysis module that you mention to, where the module is in EA Studio or FSB Pro or both of them?</p>]]></description>
			<author><![CDATA[null@example.com (electronics)]]></author>
			<pubDate>Thu, 22 Mar 2018 10:03:50 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/49738/#p49738</guid>
		</item>
		<item>
			<title><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/49648/#p49648</link>
			<description><![CDATA[<p>I have such option in my ToDo list. However, now I&#039;m overloaded with other tasks, so it will take some time to to add it.<br />I&#039;m currently working on Walk - Forward analysis module and hope to release it within next two weeks.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Mon, 19 Mar 2018 09:26:39 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/49648/#p49648</guid>
		</item>
		<item>
			<title><![CDATA[EA should work on fix Lot or dynamic lot]]></title>
			<link>https://forexsb.com/forum/post/49627/#p49627</link>
			<description><![CDATA[<p>Hi,</p><p>if i want to change an EA that i can decide in settings if it work with fixed lot size or dynamic percentage lot</p><p>How can i solve that</p>]]></description>
			<author><![CDATA[null@example.com (deadlef)]]></author>
			<pubDate>Sun, 18 Mar 2018 17:00:11 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/49627/#p49627</guid>
		</item>
	</channel>
</rss>
