<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — EA should work on fix Lot or dynamic lot]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/7270/" />
	<updated>2018-06-13T13:32:57Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/7270/ea-should-work-on-fix-lot-or-dynamic-lot/</id>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/50870/#p50870" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[deadlef]]></name>
				<uri>https://forexsb.com/forum/user/9894/</uri>
			</author>
			<updated>2018-06-13T13:32:57Z</updated>
			<id>https://forexsb.com/forum/post/50870/#p50870</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/50861/#p50861" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[shalem2014]]></name>
				<uri>https://forexsb.com/forum/user/10615/</uri>
			</author>
			<updated>2018-06-12T16:17:07Z</updated>
			<id>https://forexsb.com/forum/post/50861/#p50861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/50251/#p50251" />
			<content type="html"><![CDATA[<p>when will it gonna be available. or have someone a good ready function code?</p>]]></content>
			<author>
				<name><![CDATA[deadlef]]></name>
				<uri>https://forexsb.com/forum/user/9894/</uri>
			</author>
			<updated>2018-04-19T19:07:19Z</updated>
			<id>https://forexsb.com/forum/post/50251/#p50251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49740/#p49740" />
			<content type="html"><![CDATA[<p>It will be in EA Studio first.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2018-03-22T10:28:29Z</updated>
			<id>https://forexsb.com/forum/post/49740/#p49740</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49738/#p49738" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[electronics]]></name>
				<uri>https://forexsb.com/forum/user/9866/</uri>
			</author>
			<updated>2018-03-22T10:03:50Z</updated>
			<id>https://forexsb.com/forum/post/49738/#p49738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49648/#p49648" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2018-03-19T09:26:39Z</updated>
			<id>https://forexsb.com/forum/post/49648/#p49648</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[EA should work on fix Lot or dynamic lot]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/49627/#p49627" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[deadlef]]></name>
				<uri>https://forexsb.com/forum/user/9894/</uri>
			</author>
			<updated>2018-03-18T17:00:11Z</updated>
			<id>https://forexsb.com/forum/post/49627/#p49627</id>
		</entry>
</feed>
