Profit Generator

Author: Created in 2006, Open Source Project
Profit factor:
0.20
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
2 Views
0 Downloads
0 Favorites
Profit Generator
//+------------------------------------------------------------------+
//|                                             Profit Generator.mq4 |
//|                       No Copyright, created in 2006, Open Source |
//|                                         http://www.forex-tsd.com |
//|          Works best on Daily timeframes. Possibly H4 and Weekly. | 
//|        Freely receive, Freely give. Please post updated version. |
//+------------------------------------------------------------------+
#property copyright "Created in 2006, Open Source Project"
#property link      "http://www.forex-tsd.com"

extern int MaxTrades=1;
extern double lots=1.0;
extern int stoploss=30,takeprofit=40;
extern bool UseHourTrade = False;
extern int  FromHourTrade = 8;
extern int  ToHourTrade = 18;

int ID=983783;

void deinit() {
   Comment("");
}

int orderscnt(){
int cnt=0;
   for(int i =0;i<OrdersTotal();i++){
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
         if(OrderSymbol()==Symbol() && ID==OrderMagicNumber()){
            cnt++;
         }
      }
   }
   return(cnt);
}

int start()
  {
  if (UseHourTrade){
   if(!(Hour()>=FromHourTrade&&Hour()<=ToHourTrade)){
   Comment("Non-Trading Hours!");
   return(0);
   }
   }
  double sl,tp;
   
   
   if (Period() < 30) {Comment("change to M30 or higher pls"); return(0); }
   if (MathMod(Minute(),Period()) >= 0.5*Period()) return(0);

   if ((High[0]-Low[0])>10*Point && Open[0]<(High[0]+Low[0])/2 && Ask < Open[0]){
      if(orderscnt()<MaxTrades){
         if(stoploss==0){sl=0;}else{sl=Bid-stoploss*Point;}
         if(takeprofit==0){tp=0;}else{tp=Bid+takeprofit*Point;}
         OrderSend(Symbol(),OP_BUY,lots,Ask,2,sl,tp,"Profit Generator",ID,0,Blue); 
      }
   }
   if ((High[0]-Low[0])>10*Point && Open[0]>(High[0]+Low[0])/2 && Bid > Open[0]){
      if(orderscnt()<MaxTrades){
         if(stoploss==0){sl=0;}else{sl=Ask+stoploss*Point;}
         if(takeprofit==0){tp=0;}else{tp=Ask-takeprofit*Point;}
         OrderSend(Symbol(),OP_SELL,lots,Bid,2,sl,tp,"Profit Generator",ID,0,Red); 
      }
   }
   return(0);
  }

Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.08
Total Trades 379
Won Trades 138
Lost trades 241
Win Rate 36.41 %
Expected payoff -25.74
Gross Profit 901.10
Gross Loss -10655.43
Total Net Profit -9754.33
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.04
Total Trades 280
Won Trades 127
Lost trades 153
Win Rate 45.36 %
Expected payoff -35.14
Gross Profit 381.00
Gross Loss -10220.00
Total Net Profit -9839.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.24
Total Trades 409
Won Trades 160
Lost trades 249
Win Rate 39.12 %
Expected payoff -23.55
Gross Profit 3040.00
Gross Loss -12670.00
Total Net Profit -9630.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.45
Total Trades 719
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -13.67
Gross Profit 8127.00
Gross Loss -17953.00
Total Net Profit -9826.00
-100%
-50%
0%
50%
100%

Comments