<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — compounding]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/9383/" />
	<updated>2023-07-18T12:40:17Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/9383/compounding/</id>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/75745/#p75745" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>I don&#039;t know what compounding is. I searched it and found that &quot;it makes you rich faster&quot;.</p><p>I&#039;m not sure what exactly it means. Is it a form of scaling the entry amount?</p><p>We don&#039;t have such a feature in EA Studio.<br />Normally, the Account doesn&#039;t rise with a temp that needs automated scaling.</p></blockquote></div><br /><p>Yess it&#039;s scaling the entry amount. I would love to have that feature added.</p>]]></content>
			<author>
				<name><![CDATA[philsta]]></name>
				<uri>https://forexsb.com/forum/user/14645/</uri>
			</author>
			<updated>2023-07-18T12:40:17Z</updated>
			<id>https://forexsb.com/forum/post/75745/#p75745</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73966/#p73966" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>geektrader wrote:</cite><blockquote><p>He means position sizing based on account balance. Search the Forum, there are already implementations by others there.</p></blockquote></div><p> Exactly <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[crifalo]]></name>
				<uri>https://forexsb.com/forum/user/11809/</uri>
			</author>
			<updated>2023-03-13T10:29:27Z</updated>
			<id>https://forexsb.com/forum/post/73966/#p73966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73937/#p73937" />
			<content type="html"><![CDATA[<p>Thanks for sharing kitomc. </p><p>Could you perhaps post the full code for one of your portfolios? For a newbie in MT Coding like me, it&#039;s awesome to have something as a reference.</p>]]></content>
			<author>
				<name><![CDATA[Scifo]]></name>
				<uri>https://forexsb.com/forum/user/14277/</uri>
			</author>
			<updated>2023-03-11T14:30:28Z</updated>
			<id>https://forexsb.com/forum/post/73937/#p73937</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73934/#p73934" />
			<content type="html"><![CDATA[<p>I put this code to a portfolio with an RDD of 100 and limited to a spread of 5 and the results were extraordinary, even hard to believe hahahah.</p>]]></content>
			<author>
				<name><![CDATA[kitomc]]></name>
				<uri>https://forexsb.com/forum/user/14141/</uri>
			</author>
			<updated>2023-03-11T01:18:32Z</updated>
			<id>https://forexsb.com/forum/post/73934/#p73934</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73933/#p73933" />
			<content type="html"><![CDATA[<p>i found this code<br />the first is to compound interest and the second is to limit the spread</p><div class="codebox"><pre><code>---esto va debajo del magic number------
extern bool compuesto     = true;
double capitalToCompuesto ;




---Esto va debajo del for en OrderSend------

if(compuesto &amp;&amp; capitalToCompuesto &gt; 0) amount = Entry_Amount*(AccountEquity()/ capitalToCompuesto);





---Esto va en el init---
capitalToCompuesto  = AccountEquity();</code></pre></div><br /><p>2</p><div class="codebox"><pre><code>Input parameters section:

input int           Maximum_Spread_Points = 5;


----Esto va en OpenPosition Function ------


  if (!IsWithinMaxSpread())
        return;


-----Esto va debajo de todo el codigo es una funcion para el spread -----MT4-----

bool IsWithinMaxSpread()
{
    bool WithinMaxSpread = true;

    if (Maximum_Spread_Points &gt; 0)
    {
        double spread = NormalizeDouble(((Ask - Bid) / _Point), 0);
        //Need NormalizeDouble here because of rounding errors in MT4 that otherwise occur (confirmed in several backtests).

        if (spread &gt; Maximum_Spread_Points)
        {
            Print(&quot;El spread actual es de &quot;, DoubleToString(spread, 0), &quot; puntos, es mas alto del permitido que es &quot;, DoubleToString(Maximum_Spread_Points, 0), &quot; puntos. No realizara este trade!&quot;);
            WithinMaxSpread = false;
        }
    }

    return(WithinMaxSpread);
}
-------Funcion en MT5---------

bool IsWithinMaxSpread()
{
    bool WithinMaxSpread = true;

    if (Maximum_Spread_Points &gt; 0)
{
    double spread = NormalizeDouble(((SymbolInfoDouble(_Symbol, SYMBOL_ASK) - SymbolInfoDouble(_Symbol, SYMBOL_BID)) / _Point), 0);
    // Es necesario utilizar NormalizeDouble aquí debido a errores de redondeo en MT4 que de otra manera ocurren (confirmado en varios backtests).

    if (spread &gt; Maximum_Spread_Points)
    {
        Print(&quot;El spread actual es de &quot;, DoubleToString(spread, 0), &quot; puntos, es más alto del permitido que es &quot;, DoubleToString(Maximum_Spread_Points, 0), &quot; puntos. No se realizará este trade!&quot;);
        WithinMaxSpread = false;
    }
}

return WithinMaxSpread;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kitomc]]></name>
				<uri>https://forexsb.com/forum/user/14141/</uri>
			</author>
			<updated>2023-03-11T01:17:01Z</updated>
			<id>https://forexsb.com/forum/post/73933/#p73933</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73931/#p73931" />
			<content type="html"><![CDATA[<p>He means position sizing based on account balance. Search the Forum, there are already implementations by others there.</p>]]></content>
			<author>
				<name><![CDATA[geektrader]]></name>
				<uri>https://forexsb.com/forum/user/1841/</uri>
			</author>
			<updated>2023-03-10T21:07:53Z</updated>
			<id>https://forexsb.com/forum/post/73931/#p73931</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73925/#p73925" />
			<content type="html"><![CDATA[<p>I don&#039;t know what compounding is. I searched it and found that &quot;it makes you rich faster&quot;.</p><p>I&#039;m not sure what exactly it means. Is it a form of scaling the entry amount?</p><p>We don&#039;t have such a feature in EA Studio.<br />Normally, the Account doesn&#039;t rise with a temp that needs automated scaling.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2023-03-10T16:47:15Z</updated>
			<id>https://forexsb.com/forum/post/73925/#p73925</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[compounding]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/73900/#p73900" />
			<content type="html"><![CDATA[<p>Hi,<br />Do you know how I can add compounding in mql5 code in portfolio?<br />Best regards</p>]]></content>
			<author>
				<name><![CDATA[crifalo]]></name>
				<uri>https://forexsb.com/forum/user/11809/</uri>
			</author>
			<updated>2023-03-09T20:57:57Z</updated>
			<id>https://forexsb.com/forum/post/73900/#p73900</id>
		</entry>
</feed>
