Profit factor:
0.09
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Bulls Power indicator Bears Power indicator
12 Views
0 Downloads
0 Favorites
sistem5
//+------------------------------------------------------------------+
//|                                                   ÌîÿÑèñòåìà.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. | 
//|                                        http://www.metaquotes.net | 
//+------------------------------------------------------------------+
//---- input parameters
extern double Lots = 0.1;
extern int TakeProfit = 4;
extern int StopLoss = 100;
extern bool Trading = true;
extern string t1 = "01:59";
extern string t2 = "08:29";
extern string t3 = "15:29";
extern string t4 = "24:00";
extern int p1=13;
extern int p2=14;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int start()
{
  double pos1pre,pos2cur;
  int cnt,ticket,total,TotalOpenOrders;
  int mode,TP;
  string apos1,apos;
  double pp131,pp132,pp141,pp142,pb131,pb132,pb141,pb142;
  string aa131,aa132,aa141,aa142,ab131,ab132,ab141,ab142,aa;
  string   s_open;
  datetime t1_open,t2_open,t3_open,t4_open,TimeOpen;
  int min_stop=MarketInfo(Symbol(),MODE_STOPLEVEL);

  pos1pre = iBullsPower(NULL, 0, p1,PRICE_WEIGHTED,3);
  pos2cur = iBullsPower(NULL, 0, p1,PRICE_WEIGHTED,4);
// 3 4 1662 80 80
// 3 5 1058 80 60

  apos1 = DoubleToStr(pos1pre*10000,2) + "  ";
  apos1 = apos1 + " | " + DoubleToStr(pos2cur*10000,2) + "  ";
  apos1 = apos1 + " | " + DoubleToStr((pos1pre - pos2cur)*10000,2) + "  ";

// áûëî 1 0 à ñòàëî 3 4
  pp131 = iBullsPower(NULL, 0,p1,PRICE_WEIGHTED,3); pp132 = iBullsPower(NULL, 0,p1,PRICE_WEIGHTED,4);
  pp141 = iBullsPower(NULL, 0,p2,PRICE_WEIGHTED,3); pp142 = iBullsPower(NULL, 0,p2,PRICE_WEIGHTED,4);
  pb131 = iBearsPower(NULL, 0,p1,PRICE_WEIGHTED,3); pb132 = iBearsPower(NULL, 0,p1,PRICE_WEIGHTED,4);
  pb141 = iBearsPower(NULL, 0,p2,PRICE_WEIGHTED,3); pb142 = iBearsPower(NULL, 0,p2,PRICE_WEIGHTED,4);

  aa = " íåò      "; if (pp131 > pp132 && pp132 !=0 ) {aa = " YES SELL  " + DoubleToStr((pp131-pp132)*10000,2) + "  ";}
  aa131 = "Áûêè ï13 ñèãíàë Sell = " + aa ;
  aa = " íåò      "; if (pp131 < pp132 && pp132 < 0)  {aa = " YES BUY!  " + DoubleToStr((pp131-pp132)*10000,2) + "  ";}
  aa132 = " ñèãíàë Buy = " + aa ;

  aa = " íåò      "; if (pp141 > pp142 && pp132 !=0 ) {aa = " YES SELL  " + DoubleToStr((pp141-pp142)*10000,2) + "  ";}
  aa141 = "Áûêè ï14 ñèãíàë Sell = " + aa ;
  aa = " íåò      "; if (pp141 < pp142 && pp142 < 0)  {aa = " YES BUY! " + DoubleToStr((pp141-pp142)*10000,2) + "  ";}
  aa142 = " ñèãíàë Buy = " + aa ;

  aa = " íåò      "; if (pb131 > pb132 && pb132 !=0) {aa = " YES SELL  " + DoubleToStr((pb131-pb132)*10000,2) + "  ";}
  ab131 = "Ìåäâ ï13 ñèãíàë Sell = " + aa ;
  aa = " íåò      "; if (pb131 < pb132 && pb132 < 0) {aa = " YES BUY!  " + DoubleToStr((pb131-pb132)*10000,2) + "  ";}
  ab132 = " ñèãíàë Buy = " + aa ;
  aa = " íåò      "; if (pb141 > pb142 && pb142 !=0) { aa = " YES SELL  " + DoubleToStr((pb141-pb142)*10000,2) + "  ";}
  ab141 = "Ìåäâ ï14 ñèãíàë Sell = " + aa ;
  aa = " íåò      "; if (pb141 < pb142 && pp142 < 0) {aa = " YES BUY!  " + DoubleToStr((pb141-pb142)*10000,2) + "  ";}
  ab142 = " ñèãíàë Buy = " + aa ;

  Comment(apos1,"\n",aa131,aa132,"\n",aa141,aa142,"\n",ab131,ab132,"\n",ab141,ab142,"\n");

// ñ÷èòàåì êîëâî îòêðûòûõ îðäåðîâ    

  total=OrdersTotal();
  TotalOpenOrders = 0;
  for(cnt=0; cnt<total; cnt++)
  {
    if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) == true) 
    {
      if (OrderSymbol()==Symbol())
      {
        if(OrderType()==OP_BUY || OrderType()==OP_SELL) TotalOpenOrders = TotalOpenOrders+1;
        if(OrderType()==OP_BUY)
        {
          if(TakeProfit<=min_stop && Bid>=OrderOpenPrice()+TakeProfit*Point)
          { OrderClose(OrderTicket(),OrderLots(),Bid,3); }
        }
        if(OrderType()==OP_SELL)
        {
          if(TakeProfit<=min_stop && Ask<=OrderOpenPrice()-TakeProfit*Point)
          { OrderClose(OrderTicket(),OrderLots(),Ask,3); }
        }
      }
    }
  }

  if(!Trading) return(0);

  if(TimeOpen>=60 || TimeOpen<0) TimeOpen=0;

  TP=TakeProfit;
  if(TakeProfit<=min_stop) TP=min_stop+3;

  t1_open=0; t2_open=0; t3_open=0; t4_open=0; TimeOpen=0;
  s_open=Year()+"."+Month()+"."+Day();
  if(t1!="00:00") { t1_open=StrToTime(s_open+" "+t1); if(CurTime()>=t1_open) TimeOpen=t1_open; }
  if(t2!="00:00") { t2_open=StrToTime(s_open+" "+t2); if(CurTime()>=t2_open) TimeOpen=t2_open; }
  if(t3!="00:00") { t3_open=StrToTime(s_open+" "+t3); if(CurTime()>=t3_open) TimeOpen=t3_open; }
  if(t4!="00:00") { t4_open=StrToTime(s_open+" "+t4); if(CurTime()>=t4_open) TimeOpen=t4_open; }

  if(TotalOpenOrders<1)
  {
    if(pos1pre>pos2cur && pos2cur!=0)
    {
      if(TimeOpen!=0)
        OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TP*Point,NULL,0,0,Red);
    }

    if(pos1pre<pos2cur && pos2cur<0)
    {
      if(TimeOpen!=0)
        OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TP*Point,NULL,0,0,Aqua);
    }
  }

  return(0);
}
//**************************************************************************************************


Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.05
Total Trades 2972
Won Trades 1674
Lost trades 1298
Win Rate 56.33 %
Expected payoff -2.94
Gross Profit 476.60
Gross Loss -9213.91
Total Net Profit -8737.31
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.07
Total Trades 1911
Won Trades 1208
Lost trades 703
Win Rate 63.21 %
Expected payoff -3.42
Gross Profit 483.20
Gross Loss -7021.70
Total Net Profit -6538.50
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.23
Total Trades 8675
Won Trades 7387
Lost trades 1288
Win Rate 85.15 %
Expected payoff -1.14
Gross Profit 2954.80
Gross Loss -12874.80
Total Net Profit -9920.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.01
Total Trades 1336
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -7.48
Gross Profit 129.60
Gross Loss -10117.70
Total Net Profit -9988.10
-100%
-50%
0%
50%
100%

Comments