Ten Stochs Wave Filter EA v1[1].1

Author: Copyright � 2008, TradingSytemForex
Profit factor:
0.80
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reachedIt can change open orders parameters, due to possible stepping strategy
Indicators Used
Stochastic oscillator
11 Views
0 Downloads
0 Favorites
Ten Stochs Wave Filter EA v1[1].1
//+------------------------------------------------------------------+
//|                                           Ten Stochs Wave EA.mq4 |
//|                              Copyright © 2008, TradingSytemForex |
//|                                http://www.tradingsystemforex.com |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, TradingSytemForex"
#property link "http://www.tradingsystemforex.com"

#define OrSt "Ten Stochs Wave EA"

extern string STO="---------------- Stochs";
extern double First_Stoch_KP=1;
extern double Stoch_Slowing=2;
extern double Stoch_HLevel=80;
extern double Stoch_LLevel=20;
extern string LM="---------------- Lot Management";
extern double Lots=0.1;
extern bool MM=true; //money management
extern double Risk=2; //risk in percentage
extern string TSTB="---------------- TP SL TS BE";
bool RealSL_Enabled=false;
int RealSL=5; //stop loss under 15 pîps
bool RealTP_Enabled=false;
int RealTP=10; //take profit under 10 pîps
extern int SL=180; //stop loss
extern int TP=1000; //take profit
extern int TS=0; //trailing stop
extern int TS_Step=1; //trailing stop step
extern int BE=0; //breakeven
extern string EXT="---------------- Extras";
extern bool Reverse=false;
bool Add_Positions=false; //positions cumulated
int MaxOrders=100; //maximum number of orders
extern int Magic=0;

int Slip=3;static int TL=0;double MML=0;

// expert start function
int start(){int j=0,limit=1;double BV=0,SV=0;BV=0;SV=0;double STOM1,STOM2,STOM3,STOM4,STOM5,STOM6,STOM7,STOM8,STOM9,STOM10,STOM1b,STOM2b,STOM3b,STOM4b,STOM5b,STOM6b,STOM7b,STOM8b,STOM9b,STOM10b,STO1b,STO1;
  if(CntO(OP_BUY,Magic)>0) TL=1;if(CntO(OP_SELL,Magic)>0) TL=-1;for(int i=1;i<=limit;i++){
  
  STOM1=iStochastic(NULL,0,First_Stoch_KP,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM1b=iStochastic(NULL,0,First_Stoch_KP,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM2=iStochastic(NULL,0,First_Stoch_KP+1,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM2b=iStochastic(NULL,0,First_Stoch_KP+1,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM3=iStochastic(NULL,0,First_Stoch_KP+2,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM3b=iStochastic(NULL,0,First_Stoch_KP+2,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM4=iStochastic(NULL,0,First_Stoch_KP+3,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM4b=iStochastic(NULL,0,First_Stoch_KP+3,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM5=iStochastic(NULL,0,First_Stoch_KP+4,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM5b=iStochastic(NULL,0,First_Stoch_KP+4,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM6=iStochastic(NULL,0,First_Stoch_KP+5,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM6b=iStochastic(NULL,0,First_Stoch_KP+5,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM7=iStochastic(NULL,0,First_Stoch_KP+6,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM7b=iStochastic(NULL,0,First_Stoch_KP+6,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM8=iStochastic(NULL,0,First_Stoch_KP+7,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM8b=iStochastic(NULL,0,First_Stoch_KP+7,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM9=iStochastic(NULL,0,First_Stoch_KP+8,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM9b=iStochastic(NULL,0,First_Stoch_KP+8,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  STOM10=iStochastic(NULL,0,First_Stoch_KP+9,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i);STOM10b=iStochastic(NULL,0,First_Stoch_KP+9,Stoch_Slowing,3,MODE_SMA,0,MODE_MAIN,i+1);
  
  STO1b=(STOM1b+STOM2b+STOM3b+STOM4b+STOM5b+STOM6b+STOM7b+STOM8b+STOM9b+STOM10b);
  STO1=(STOM1+STOM2+STOM3+STOM4+STOM5+STOM6+STOM7+STOM8+STOM9+STOM10);

  if(STO1<STO1b&&STO1>Stoch_HLevel){if(Reverse) BV=1; else SV=1; break;}
  if(STO1>STO1b&&STO1<Stoch_LLevel){if(Reverse) SV=1; else BV=1; break;}}

// expert money management
if(MM){if(Risk<0.1 || Risk>100) {Comment("Invalid Risk Value."); return(0);}
   else {MML=MathFloor((AccountFreeMargin() *AccountLeverage()*Risk*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*MarketInfo(Symbol(),MODE_MINLOT )))*MarketInfo(Symbol(),MODE_MINLOT );}}
if(MM==false){MML=Lots;}

// expert init positions
int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0; cnt<OrdersTotal();cnt++) {OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if((OrderType()==OP_SELL || OrderType()==OP_BUY) && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) OP=OP+1;}
if(OP>=1){OS=0; OB=0;}OB=0;OS=0;CB=0;CS=0;

// expert conditions to open position
if(SV>0){OS=1;OB=0;}if(BV>0){OB=1;OS=0;}

// expert conditions to close position
if((SV>0) || (RealSL_Enabled && (OrderOpenPrice()-Bid)/Point>=RealSL)||(RealTP_Enabled && (Ask-OrderOpenPrice())/Point>=RealTP)){CB=1;}
if((BV>0) || (RealSL_Enabled && (Ask-OrderOpenPrice())/Point>=RealSL)||(RealTP_Enabled && (OrderOpenPrice()-Bid)/Point>=RealTP)){CS=1;}
for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
	if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,Slip,Red); return(0);}}
	if(OrderType()==OP_SELL && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){
	if(CS==1){OrderClose(OrderTicket(),OrderLots(),Ask,Slip,Red);return(0);}}}double SLI=0,TPI=0;int TK=0;

// expert open position value
if((AddP() && Add_Positions && OP<=MaxOrders) || (OP==0 && !Add_Positions)) {
	if(OS==1){if (TP==0) TPI=0; else TPI=Bid-TP*Point;if (SL==0) SLI=0; else SLI=Bid+SL*Point;TK=OrderSend(Symbol(),OP_SELL,MML,Bid,Slip,SLI,TPI,OrSt,Magic,0,Red);OS=0;return(0);}	
	if(OB==1){if(TP==0) TPI=0; else TPI=Ask+TP*Point;if(SL==0) SLI=0; else SLI=Ask-SL*Point;TK=OrderSend(Symbol(),OP_BUY,MML,Ask,Slip,SLI,TPI,OrSt,Magic,0,Lime);OB=0; return(0);}}
for(j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_BY_POS, MODE_TRADES)){if (OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)) {TrP();}}}return(0);}

// expert number of orders
int CntO(int Type,int Magic){int _CntO;_CntO=0;
for(int j=0;j<OrdersTotal();j++){OrderSelect(j, SELECT_BY_POS, MODE_TRADES);if(OrderSymbol()==Symbol()) {if((OrderType()==Type && (OrderMagicNumber()==Magic) || Magic==0)) _CntO++;}}return(_CntO);}

// expert trailing stop
void TrP(){double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);if (OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(),MODE_BID);

//expert breakeven
    if(BE>0){if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp);}}}
    if(TS>0){if((pb-OrderOpenPrice())>TS*pp){if(OrderStopLoss()<pb-(TS+TS_Step-1)*pp){ModSL(pb-TS*pp);return;}}}}
  if(OrderType()==OP_SELL){pa=MarketInfo(OrderSymbol(),MODE_ASK);if(BE>0){if((OrderOpenPrice()-pa)>BE*pp){if((OrderOpenPrice()-OrderStopLoss())<0){ModSL(OrderOpenPrice()-0*pp);}}}
  if (TS>0){if (OrderOpenPrice()-pa>TS*pp){if (OrderStopLoss()>pa+(TS+TS_Step-1)*pp || OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}

//expert stoploss
void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldSL,OrderTakeProfit(),0,CLR_NONE);}

//expert add positions function
bool AddP(){int _num=0; int _ot=0;
for (int j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_BY_POS)==true && OrderSymbol()==Symbol() && OrderType()<3 && ((OrderMagicNumber()==Magic) || Magic==0)) {	
	 _num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();}}
if(_num==0) return(true);if(_num>0 && ((Time[0]-_ot))>0) return(true);else return(false);}

Profitability Reports

NZD/USD Oct 2024 - Jan 2025
2.12
Total Trades 34
Won Trades 10
Lost trades 24
Win Rate 29.41 %
Expected payoff 9.08
Gross Profit 584.16
Gross Loss -275.40
Total Net Profit 308.76
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
1.94
Total Trades 44
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 7.42
Gross Profit 671.98
Gross Loss -345.60
Total Net Profit 326.38
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
1.63
Total Trades 92
Won Trades 21
Lost trades 71
Win Rate 22.83 %
Expected payoff 2.63
Gross Profit 625.53
Gross Loss -383.40
Total Net Profit 242.13
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
1.40
Total Trades 159
Won Trades 33
Lost trades 126
Win Rate 20.75 %
Expected payoff 2.92
Gross Profit 1637.24
Gross Loss -1172.82
Total Net Profit 464.42
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.19
Total Trades 33
Won Trades 6
Lost trades 27
Win Rate 18.18 %
Expected payoff 1.67
Gross Profit 346.62
Gross Loss -291.60
Total Net Profit 55.02
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
1.16
Total Trades 242
Won Trades 42
Lost trades 200
Win Rate 17.36 %
Expected payoff 0.33
Gross Profit 585.66
Gross Loss -506.75
Total Net Profit 78.91
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
1.05
Total Trades 32
Won Trades 5
Lost trades 27
Win Rate 15.63 %
Expected payoff 0.43
Gross Profit 300.00
Gross Loss -286.38
Total Net Profit 13.62
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
0.97
Total Trades 596
Won Trades 89
Lost trades 507
Win Rate 14.93 %
Expected payoff -0.06
Gross Profit 1198.09
Gross Loss -1234.45
Total Net Profit -36.36
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.95
Total Trades 88
Won Trades 13
Lost trades 75
Win Rate 14.77 %
Expected payoff -0.15
Gross Profit 280.00
Gross Loss -293.58
Total Net Profit -13.58
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.94
Total Trades 106
Won Trades 16
Lost trades 90
Win Rate 15.09 %
Expected payoff -0.22
Gross Profit 340.00
Gross Loss -363.44
Total Net Profit -23.44
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.88
Total Trades 50
Won Trades 8
Lost trades 42
Win Rate 16.00 %
Expected payoff -0.98
Gross Profit 352.44
Gross Loss -401.28
Total Net Profit -48.84
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.87
Total Trades 165
Won Trades 23
Lost trades 142
Win Rate 13.94 %
Expected payoff -0.13
Gross Profit 147.45
Gross Loss -168.67
Total Net Profit -21.22
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.84
Total Trades 52
Won Trades 7
Lost trades 45
Win Rate 13.46 %
Expected payoff -1.25
Gross Profit 350.93
Gross Loss -415.74
Total Net Profit -64.81
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.82
Total Trades 195
Won Trades 26
Lost trades 169
Win Rate 13.33 %
Expected payoff -0.37
Gross Profit 340.16
Gross Loss -412.54
Total Net Profit -72.38
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.72
Total Trades 41
Won Trades 5
Lost trades 36
Win Rate 12.20 %
Expected payoff -2.59
Gross Profit 269.95
Gross Loss -376.20
Total Net Profit -106.25
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.72
Total Trades 186
Won Trades 22
Lost trades 164
Win Rate 11.83 %
Expected payoff -0.61
Gross Profit 286.47
Gross Loss -400.39
Total Net Profit -113.92
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.67
Total Trades 801
Won Trades 89
Lost trades 712
Win Rate 11.11 %
Expected payoff -0.39
Gross Profit 638.13
Gross Loss -952.64
Total Net Profit -314.51
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.65
Total Trades 35
Won Trades 4
Lost trades 31
Win Rate 11.43 %
Expected payoff -3.26
Gross Profit 210.05
Gross Loss -324.00
Total Net Profit -113.95
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.63
Total Trades 60
Won Trades 6
Lost trades 54
Win Rate 10.00 %
Expected payoff -0.85
Gross Profit 87.41
Gross Loss -138.55
Total Net Profit -51.14
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.57
Total Trades 146
Won Trades 14
Lost trades 132
Win Rate 9.59 %
Expected payoff -4.34
Gross Profit 850.00
Gross Loss -1483.50
Total Net Profit -633.50
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.56
Total Trades 156
Won Trades 15
Lost trades 141
Win Rate 9.62 %
Expected payoff -1.02
Gross Profit 207.23
Gross Loss -366.99
Total Net Profit -159.76
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.56
Total Trades 56
Won Trades 5
Lost trades 51
Win Rate 8.93 %
Expected payoff -1.04
Gross Profit 72.91
Gross Loss -131.05
Total Net Profit -58.14
-100%
-50%
0%
50%
100%
GBP/USD Jan 2025 - Jul 2025
0.55
Total Trades 318
Won Trades 30
Lost trades 288
Win Rate 9.43 %
Expected payoff -1.81
Gross Profit 713.88
Gross Loss -1290.60
Total Net Profit -576.72
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.35
Total Trades 798
Won Trades 48
Lost trades 750
Win Rate 6.02 %
Expected payoff -1.32
Gross Profit 571.70
Gross Loss -1626.20
Total Net Profit -1054.50
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.26
Total Trades 509
Won Trades 23
Lost trades 486
Win Rate 4.52 %
Expected payoff -0.83
Gross Profit 145.54
Gross Loss -569.70
Total Net Profit -424.16
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.15
Total Trades 462
Won Trades 13
Lost trades 449
Win Rate 2.81 %
Expected payoff -1.84
Gross Profit 150.99
Gross Loss -999.93
Total Net Profit -848.94
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
0.06
Total Trades 2431
Won Trades 30
Lost trades 2401
Win Rate 1.23 %
Expected payoff -2.73
Gross Profit 440.00
Gross Loss -7086.07
Total Net Profit -6646.07
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.03
Total Trades 1156
Won Trades 10
Lost trades 1146
Win Rate 0.87 %
Expected payoff -3.67
Gross Profit 126.50
Gross Loss -4365.00
Total Net Profit -4238.50
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.03
Total Trades 1221
Won Trades 11
Lost trades 1210
Win Rate 0.90 %
Expected payoff -3.56
Gross Profit 124.94
Gross Loss -4465.80
Total Net Profit -4340.86
-100%
-50%
0%
50%
100%

Comments