SHE_Lucky





//+------------------------------------------------------------------+
//|                                                    SHE_Lucky.mq4 |
//|                              Copyright © 2006, strategy.alfamoon |
//|                                     http://expertmillionaire.ru/ |
//+------------------------------------------------------------------+

double a, b; 
bool first=true; 
extern int Shift = 3; 
extern double Lot=0.1;
extern int Limit = 10;
extern int Take = 3;
extern int NumOrd=1;
extern int TP = 10;
extern int SL=15;
 
int z;
//---------------------------------------------------------------------------- 
int start(){ 
  if (first) {a=Ask; b=Bid; first=false; return(0);} 
  z=MarketInfo(Symbol(),MODE_STOPLEVEL);
  if (OrdersTotal()<NumOrd)
  {
  if (Ask-a>=Shift*Point) 
    {OrderSend(Symbol(),OP_SELL,Lot,Bid,1,Bid+SL*Point,Bid-TP*Point,"",0,0,Red);} 
  if (b-Bid>=Shift*Point) 
    {OrderSend(Symbol(),OP_BUY,Lot,Ask,1,Ask-SL*Point,Ask+TP*Point,"",0,0,Blue);} 
   }
  a=Ask;  
  b=Bid; 
  ModifyAll();
  CloseAll(); 
return(0);} 
//----------------------------------------------------------------------------- 
void CloseAll() { 
  for (int cnt = OrdersTotal()-1 ; cnt >= 0; cnt--) { 
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); 
    if (OrderSymbol() == Symbol()) { 
   /*   if ((OrderProfit()>Take)) {
        if(OrderType()==OP_BUY)  OrderClose(OrderTicket(),OrderLots(),Bid,2,CLR_NONE); 
        if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,2,CLR_NONE); 
      } 
      else */
      { 
        if((OrderType()==OP_BUY)  && (((OrderOpenPrice()-Ask)/Point) > Limit)) 
          OrderClose(OrderTicket(),OrderLots(),Bid,3,Green); 
        if((OrderType()==OP_SELL) && (((Bid-OrderOpenPrice())/Point) > Limit)) 
          OrderClose(OrderTicket(),OrderLots(),Ask,3,Green); 
      } 
    } 
  } 
} 
//----------------------------------------------------------------------------- 
void ModifyAll() { 
  for (int cnt = OrdersTotal()-1 ; cnt >= 0; cnt--) { 
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); 
    if (OrderSymbol() == Symbol() && OrderTakeProfit()==0) { 
      { 
        if((OrderType()==OP_BUY)  && (((OrderOpenPrice()-Ask)/Point) >= z-Take)) 
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+Take*Point,0,Gold); 
        if((OrderType()==OP_SELL) && (((Bid-OrderOpenPrice())/Point) >= z-Take)) 
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()-Take*Point,0,Gold); 
      } 
    } 
  } 
} 
//-------------------------------------------------------------------------- 
double GetLots() { 
  return (NormalizeDouble(AccountFreeMargin()/10000,1)); 
  //return (1); 
} 
//------------------------------------------------------------------------- 






Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:



Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders
It automatically opens orders when conditions are reached

It Closes Orders by itself
It can change open orders parameters, due to possible stepping strategy

Other Features:

BackTest : EURUSD on H1

From 2009-12-01 to 2010-01-17 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-04-01 to 2010-04-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-05-01 to 2010-05-31 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-06-01 to 2010-06-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-02-27 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCAD on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCHF on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDJPY on H1

From 2009-11-01 to 2009-11-30 Profit Factor:0.00 Total Net Profit:0.00

Request Backtest for SHE_Lucky


From : (yyyy/mm/dd) To: (yyyy/mm/dd)

Pair: Period: