<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Daily Profit Calculation]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/9643/" />
	<updated>2024-07-08T20:37:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/9643/daily-profit-calculation/</id>
		<entry>
			<title type="html"><![CDATA[Re: Daily Profit Calculation]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80503/#p80503" />
			<content type="html"><![CDATA[<p>Great it is very necessary</p><div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>&gt; When i use 2-3-4 Portfolio EAs at once he calculates the daily profit of alle EAs or only for the one EA?</p><p>I&#039;ll work on the Portfolio MQL very soon. I&#039;ll provide better statistics and also possibility to enable / Disable particular strategies.</p><p>For the stats, we will have total portfolio stats and stats for each particular strategy in the MT chart.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[kitomc]]></name>
				<uri>https://forexsb.com/forum/user/14141/</uri>
			</author>
			<updated>2024-07-08T20:37:03Z</updated>
			<id>https://forexsb.com/forum/post/80503/#p80503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Daily Profit Calculation]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/80492/#p80492" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Popov wrote:</cite><blockquote><p>&gt; When i use 2-3-4 Portfolio EAs at once he calculates the daily profit of alle EAs or only for the one EA?</p><p>I&#039;ll work on the Portfolio MQL very soon. I&#039;ll provide better statistics and also possibility to enable / Disable particular strategies.</p><p>For the stats, we will have total portfolio stats and stats for each particular strategy in the MT chart.</p></blockquote></div><p>When will it be ready ?</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2024-07-06T07:19:35Z</updated>
			<id>https://forexsb.com/forum/post/80492/#p80492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Daily Profit Calculation]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/78287/#p78287" />
			<content type="html"><![CDATA[<p>&gt; When i use 2-3-4 Portfolio EAs at once he calculates the daily profit of alle EAs or only for the one EA?</p><p>I&#039;ll work on the Portfolio MQL very soon. I&#039;ll provide better statistics and also possibility to enable / Disable particular strategies.</p><p>For the stats, we will have total portfolio stats and stats for each particular strategy in the MT chart.</p>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2024-01-13T08:16:59Z</updated>
			<id>https://forexsb.com/forum/post/78287/#p78287</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Daily Profit Calculation]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/78284/#p78284" />
			<content type="html"><![CDATA[<p>Hi,<br />@Popov is the current Daily Profit calculation depends on the MT4 account? When i use 2-3-4 Portfolio EAs at once he calculates the daily profit of alle EAs or only for the one EA?</p><p>Cause when i look in code i think there is missing something in code that for only the magicnumber it have to calculate or i am wrong?</p><div class="codebox"><pre><code>double CalculateDailyProfit()
  {
    const datetime t0 = TimeCurrent();
    const datetime t1 = t0 - 60*60*24;

    double dailyProfit = 0.0;

    const int totalOrders = OrdersTotal();
    for(int i=0; i &lt; totalOrders; i+=1) {
        if(OrderSelect(i, SELECT_BY_POS)) {
            if((OrderCloseTime() &gt; t1 &amp;&amp; OrderCloseTime() &lt;= t0) ||
               OrderCloseTime() == 0) {
                if(OrderType() &lt;= OP_SELL) {
                    dailyProfit += OrderProfit();
                    dailyProfit -= OrderSwap();
                    dailyProfit -= OrderCommission();
                }
            }
        }
    }

    return dailyProfit;
  }</code></pre></div><br /><p>didnt it have to be such code than</p><div class="codebox"><pre><code>double CalculateDailyProfit()
  {
[b]    int minMagic = GetMagicNumber(0);
    int maxMagic = GetMagicNumber(strategiesCount);[/b]  

    const datetime t0 = TimeCurrent();
    const datetime t1 = t0 - 60*60*24;

    double dailyProfit = 0.0;

    const int totalOrders = OrdersTotal();
    for(int i=0; i &lt; totalOrders; i+=1) {
        if(OrderSelect(i, SELECT_BY_POS)) {

[b]         int magicNumber = OrderMagicNumber();
         if (magicNumber &gt;= minMagic &amp;&amp; magicNumber &lt;= maxMagic)[/b]

            if((OrderCloseTime() &gt; t1 &amp;&amp; OrderCloseTime() &lt;= t0) ||
               OrderCloseTime() == 0) {
                if(OrderType() &lt;= OP_SELL) {
                    dailyProfit += OrderProfit();
                    dailyProfit -= OrderSwap();
                    dailyProfit -= OrderCommission();
                }
            }
        }
    }

    return dailyProfit;
  }</code></pre></div><p>So this code only read daily profit of the magicnumber of the ea and only this close.</p>]]></content>
			<author>
				<name><![CDATA[Roughey]]></name>
				<uri>https://forexsb.com/forum/user/10939/</uri>
			</author>
			<updated>2024-01-13T07:52:52Z</updated>
			<id>https://forexsb.com/forum/post/78284/#p78284</id>
		</entry>
</feed>
