1. Function oldest long profit and oldest short profit / 2. count profit history buy / sell

MQL4 Danışmanlık

İş tamamlandı

Tamamlanma süresi: 2 dakika
Geliştirici tarafından geri bildirim
Great customer. highly recommended!
Müşteri tarafından geri bildirim
good Job and fast.

Şartname


1.

i would like the funkction to integrate it in my EA.

the Profit of the oldest open/pending Long-position

the Profit of the oldest open/pending short-position


something like that (that is for all positions)....:

//+------------------------------------------------------------------+
double countprofitBS(int mode,int order_type)
  {
   double profit=0;
   if(OrdersTotal()>0)
     {
      for(i=OrdersTotal()-1;i>=0;i--)
        {
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && OrderType()==order_type && OrderMagicNumber()==magic)
           {
            if(mode==0)profit=profit+(OrderClosePrice()-OrderOpenPrice())/pt;
            if(mode==1)profit=profit+OrderProfit()+OrderCommission()+OrderSwap();
           }
        }
     }
   return(profit);
  }


2.

and the function for Count Profit for buy / and sell positions

countprofit sell

Countprofit buy

something simaler like that:

// mode 0 = pips, mode 1 = dollars

double countprofit(int mode)
  {
   double profit=0;
   if(OrdersTotal()>0)
     {
      for(i=OrdersTotal()-1;i>=0;i--)
        {
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==magic)
           {
            if(mode==0)profit=profit+(OrderClosePrice()-OrderOpenPrice())/pt;
            if(mode==1)profit=profit+OrderProfit()+OrderCommission()+OrderSwap();
           }
         if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==magic)
           {
            if(mode==0)profit=profit+(OrderOpenPrice()-OrderClosePrice())/pt;
            if(mode==1)profit=profit+OrderProfit()+OrderCommission()+OrderSwap();
           }
        }
      if(OrdersHistoryTotal()>0)
        {
         for(i=OrdersHistoryTotal()-1;i>=0;i--)
           {
            OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
            if(OrderOpenTime()<timex)break;
            if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==magic)
              {
               if(mode==0)profit=profit+(OrderClosePrice()-OrderOpenPrice())/pt;
               if(mode==1)profit=profit+OrderProfit()+OrderCommission()+OrderSwap();
              }
            if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==magic)
              {
               if(mode==0)profit=profit+(OrderOpenPrice()-OrderClosePrice())/pt;
               if(mode==1)profit=profit+OrderProfit()+OrderCommission()+OrderSwap();
              }
           }
        }
     }
   return(profit);
  }
  


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(213)
Projeler
246
45%
Arabuluculuk
42
10% / 57%
Süresi dolmuş
5
2%
Serbest
2
Geliştirici 2
Derecelendirme
(590)
Projeler
789
71%
Arabuluculuk
9
33% / 33%
Süresi dolmuş
22
3%
Serbest
Yayınlandı: 8 kod
3
Geliştirici 3
Derecelendirme
(365)
Projeler
412
36%
Arabuluculuk
35
26% / 57%
Süresi dolmuş
63
15%
Serbest
4
Geliştirici 4
Derecelendirme
(499)
Projeler
744
56%
Arabuluculuk
48
31% / 31%
Süresi dolmuş
120
16%
Serbest
Yayınlandı: 1 kod
5
Geliştirici 5
Derecelendirme
(574)
Projeler
945
47%
Arabuluculuk
309
58% / 27%
Süresi dolmuş
125
13%
Serbest
6
Geliştirici 6
Derecelendirme
(94)
Projeler
148
59%
Arabuluculuk
16
38% / 13%
Süresi dolmuş
25
17%
Serbest
Yayınlandı: 1 kod
7
Geliştirici 7
Derecelendirme
(885)
Projeler
1410
67%
Arabuluculuk
123
32% / 41%
Süresi dolmuş
217
15%
Serbest
Yayınlandı: 1 kod
8
Geliştirici 8
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(206)
Projeler
333
35%
Arabuluculuk
66
12% / 58%
Süresi dolmuş
87
26%
Serbest
10
Geliştirici 10
Derecelendirme
(33)
Projeler
35
40%
Arabuluculuk
11
9% / 91%
Süresi dolmuş
4
11%
Serbest
Yayınlandı: 4 kod
11
Geliştirici 11
Derecelendirme
(4)
Projeler
6
0%
Arabuluculuk
2
0% / 50%
Süresi dolmuş
4
67%
Serbest

Proje bilgisi

Bütçe
30+ USD