Experts: MA Reverse

 

MA Reverse:

A simple EA. It plays in the opposite direction on the specified difference between Bid and MA. It is considerably risky but it has own advantage.

Author: Константин Гранд

 

That's a heavy drawdown.

 

very impressive results. on each timeframe even M1 EURUSD

I tried to modify the script in order to secure the EA but I can't.

I there a specific blocking system, or do I do something wrong ?

Congratulation for this very interesting idea.

Lionel

lionel.houba(at)wanadoo.fr

 

Thanks for sharing this expert advisor. I've made a modified version to allow more optimization.

 
You will find here-above your EA with some other parameter in order to test it safely and above big drawdown.
Unfortunatly it looses in efficiency.
nevertheless the idea is interesting and I will follow your way
Lionel
//----The goal of this EA is to catch a market returnment after a strong market reaction
//----analysing the delta between the MA and the bar 
//----
//---- input parameters 
extern double lotsize         = 0.1;
extern double MAXORDERS       = 1;
int ticket;
extern double take_profit     = 0.003;
extern double stop_loss       = 0.1;
extern double hour_start      = 0;
extern double hour_end        = 24;
extern double moving_period  = 14;
int count;
extern double delta_MA        = 0.004;
extern double ATR_value       = 0.0004;
return;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
double MA; 
//----defining MA :
MA=iMA(NULL,0,moving_period,0,MODE_SMA,PRICE_CLOSE,0);
//----SELL conditions
if (Bid==MA)
count=0;
if (Bid-MA>0)
count+=1;
if (
(count==150 && Bid-MA > delta_MA)
//---- limitation of the number of open positions  
   &&(OrdersTotal() < MAXORDERS)
   
//---- volatility (ATR) is enough
&& (iATR(NULL,0,12,0)>ATR_value)   
)
OrderSend(Symbol(),OP_SELL,lotsize,Bid,3,Open[0]+stop_loss,Open[0]-take_profit,"",0,0,Green);
//---BUY conditions-------------------------------------------------------
if (count>0 && Bid-MA<0)
count=0;
if (count<0 && Bid-MA>0)
count=0;
if (Bid-MA<0)
count-=1;
if (
(count==-150 && Bid-MA < -delta_MA)
//---- limitation of the number of open positions  
   &&(OrdersTotal() < MAXORDERS)
   
//---- volatility (ATR) is enough
&& (iATR(NULL,0,12,0)>ATR_value)   
)
OrderSend (Symbol(),OP_BUY,lotsize,Ask,3,Open[0]-stop_loss,Open[0]+take_profit,"",0,0,Red);
   return(0);
  }
//+------------------------------------------------------------------+
 

I have a question...


the count-variable is actually counting ticks, and thus the expert produces wildly variable results depending on the modelling method - i.e. the result on every tick is very different from a control points only test. In fact, on every tick it shows much less trading activity and no losses at all...


Did you (or anybody) every try to count bars or units of time instead of ticks...?

Reason: