Author: Yuriy Tokman
Profit factor:
0.27
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself
Indicators Used
Moving average indicatorRelative strength index
1 Views
0 Downloads
0 Favorites
Exp_Sidus
//+------------------------------------------------------------------+
//|                                                    Exp_Sidus.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

extern double TP = 80;
extern double SL = 20;
extern double Lots = 0.1;
extern int shif =1;

 int period_MA1 =5;
 int period_MA2 =12;
 int ma_method =0;//0-4
 int applied_price = 0;//0-6
 int period_RSI = 21;
 int applied_RSI = 0;//0-6

datetime LastTime=0;

int start()
  {
//----
   int cnt, ticket, total;
   
   total=OrdersTotal();
   if(total<1) 
     {
      if(GetSignal()==1 && Time[shif]!= LastTime)
        {
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-SL*Point,Ask+TP*Point,"",28081975,0,Green);
         if(ticket>0)LastTime = Time[shif];
         return(0); 
        }
      if(GetSignal()==-1 && Time[shif]!= LastTime)
        {
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+SL*Point,Bid-TP*Point,"",28081975,0,Red);
         if(ticket>0)LastTime = Time[shif];
         return(0); 
        }
      return(0);
     }      
//----
   for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_BUY)
           {
            if(GetSignal()==-1)
                {
                 OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
                 return(0);
                }
           }
         else 
           {
            if(GetSignal()==1)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
               return(0);
              }
           }
        }
     }   
//----
   return(0);
  }
//+------------------------------------------------------------------+

double GetSignal()
 { 
  double FastEMA=iMA(NULL,0,period_MA1,0,ma_method,applied_price,shif);
  double SlowEMA=iMA(NULL,0,period_MA2,0,ma_method,applied_price,shif);
  double PrevFastEMA=iMA(NULL,0,period_MA1,0,ma_method,applied_price,shif+1);
  double PrevSlowEMA=iMA(NULL,0,period_MA2,0,ma_method,applied_price,shif+1);  
  double rsi= iRSI(NULL,0,period_RSI,applied_RSI,shif);  
 
  int vSig=0;
  if(PrevFastEMA<=PrevSlowEMA && FastEMA>SlowEMA && rsi>50 )vSig = 1;
  else
  if(PrevFastEMA>=PrevSlowEMA && FastEMA<SlowEMA && rsi<50 )vSig =-1;
  return(vSig); 
 }

Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.34
Total Trades 87
Won Trades 12
Lost trades 75
Win Rate 13.79 %
Expected payoff -1.54
Gross Profit 68.72
Gross Loss -202.84
Total Net Profit -134.12
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.21
Total Trades 96
Won Trades 12
Lost trades 84
Win Rate 12.50 %
Expected payoff -3.81
Gross Profit 96.00
Gross Loss -462.00
Total Net Profit -366.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.26
Total Trades 95
Won Trades 9
Lost trades 86
Win Rate 9.47 %
Expected payoff -2.14
Gross Profit 72.00
Gross Loss -275.20
Total Net Profit -203.20
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.25
Total Trades 100
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -3.14
Gross Profit 104.00
Gross Loss -417.60
Total Net Profit -313.60
-100%
-50%
0%
50%
100%

Comments