ti incollo un ea, su due messaggi perchè ha un errore ed è abbastanza lungo. ecco la pt1
//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                   NO Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
extern string INFO1="===== Volume ==============================";
extern double LotsSize=0.0;
extern string INFO_="----------------------------------------------";
extern double LotsPer1000=0.3;
extern double MinLots = 0.01;
extern double MaxLots = 60.0;
extern string INFO2="===== Protection ============================";
extern double def_MaxSpread=1.3;
extern string INFO3 = "===== Confirmation ==========================";
extern int BB_PARAM = 23;
extern int RSI_PARAM = 18;
extern double def_SL = 3.0;
extern string INFO4="===== More ===============================";
extern int MyMagicNumber=68000;
extern string Comment_="Price Action Scalping v1.68";

int Gi_180=0;
double G_pips_184= 0.0;
int G_digits_192 = 0;
double G_point_196=0.0;
int Gi_204;
double Gd_208;
double Gd_216;
double Gd_224;
double Gd_232;
double Gd_240;
double Gd_248;
double Gd_256;
int G_slippage_264=3;
bool Gi_268;
double Gd_272;
double Gda_280[30];
int Gi_284=0;
string Gs_dummy_288;
string Gs_unused_316 = "";
string Gs_unused_324 = "";
double Gd_336;
double Gd_344;
int G_time_352;
int Gi_356;
int G_datetime_360;
string Gs_364 = "000,000,000";
string Gs_372 = "000,000,255";
int Gi_380;
int Gi_384;
int Filter=185;
int StopLoss;
double Risk;
bool UseMM;
double MaxSpreadPlusCommission=10000.0;
int Limit=20;
int Distance = 21;
int MAPeriod = 3;
int MAMethod = 3;
string TimeFilter="----------Time Filter";
int StartHour=0;
int StartMinute=0;
int EndHour=23;
int EndMinute=59;
int Gi_388;
int Gi_392=40;
double G_timeframe_396=240.0;
bool Gi_404=TRUE;
color G_color_408 = DimGray;
string G_name_412 = "SpreadIndikatorObj";
double Gd_420;
color G_color_428 = Red;
color G_color_432 = DarkGray;
color G_color_436 = SpringGreen;
bool Gi_440=TRUE;
double G_ihigh_444;
double G_ilow_452;
double Gd_460;
int G_datetime_468;
// E37F0136AA3FFAF149B351F6A4C948E9
int init()
  {
   StopLoss=def_SL*10.0;
   def_MaxSpread=def_MaxSpread*10;
   if(LotsSize==0.0)
     {
      UseMM=TRUE;
     }
   else
     {
      UseMM=FALSE;
     }
   Risk=LotsPer1000*20;
   int timeframe_8;
   ArrayInitialize(Gda_280,0);
   G_digits_192= Digits;
   G_point_196 = Point;
   Print("Digits: "+G_digits_192+" Point: "+DoubleToStr(G_point_196,G_digits_192));
   double lotstep_0=MarketInfo(Symbol(),MODE_LOTSTEP);
   Gi_204 = MathLog(lotstep_0) / MathLog(0.1);
   Gd_208 = MathMax(MinLots, MarketInfo(Symbol(), MODE_MINLOT));
   Gd_216 = MathMin(MaxLots, MarketInfo(Symbol(), MODE_MAXLOT));
   Gd_224 = Risk / 100.0;
   Gd_232 = NormalizeDouble(MaxSpreadPlusCommission * G_point_196, G_digits_192 + 1);
   Gd_240 = NormalizeDouble(Limit * G_point_196, G_digits_192);
   Gd_248 = NormalizeDouble(Distance * G_point_196, G_digits_192);
   Gd_256 = NormalizeDouble(G_point_196 * Filter, G_digits_192);
   Gi_268 = FALSE;
   Gd_272 = NormalizeDouble(G_pips_184 * G_point_196, G_digits_192 + 1);
   if(!IsTesting())
     {
      f0_8();
      if(Gi_404)
        {
         timeframe_8=Period();
         switch(timeframe_8)
           {
            case PERIOD_M1:
               G_timeframe_396=5;
               break;
            case PERIOD_M5:
               G_timeframe_396=15;
               break;
            case PERIOD_M15:
               G_timeframe_396=30;
               break;
            case PERIOD_M30:
               G_timeframe_396=60;
               break;
            case PERIOD_H1:
               G_timeframe_396=240;
               break;
            case PERIOD_H4:
               G_timeframe_396=1440;
               break;
            case PERIOD_D1:
               G_timeframe_396=10080;
               break;
            case PERIOD_W1:
               G_timeframe_396=43200;
               break;
            case PERIOD_MN1:
               G_timeframe_396=43200;
           }
        }
      Gd_420=0.0001;
      f0_7();
      f0_2();
      f0_0();
      f0_3();
     }
   return (0);
  }
// 52D46093050F38C27267BCE42543EF60
int deinit()
  {
   if(!IsTesting())
     {
      for(int Li_0=1; Li_0<=Gi_392; Li_0++) ObjectDelete("Padding_rect"+Li_0);
      for(int count_4=0; count_4<10; count_4++)
        {
         ObjectDelete("BD"+count_4);
         ObjectDelete("SD"+count_4);
        }
      ObjectDelete("time");
      ObjectDelete(G_name_412);
     }
   Comment("");
   ObjectDelete("B3LLogo");
   ObjectDelete("B3LCopy");
   ObjectDelete("FiboUp");
   ObjectDelete("FiboDn");
   ObjectDelete("FiboIn");
   return (0);
  }
// EA2B2676C28C0DB26D39331A336C6B92
int start()
  {

//StopLoss = StopLoss + MarketInfo(Symbol(),MODE_SPREAD);
   int error_8;
   string Ls_12;
   int ticket_20;
   double price_24;
   bool bool_32;
   double Ld_36;
   double Ld_44;
   double price_60;
   double Ld_112;
   int Li_180;
   int cmd_188;
   double Ld_196;
   double Ld_204;
   double ihigh_68= iHigh(NULL,0,0);
   double ilow_76 = iLow(NULL,0,0);
// double ima_84 = iMA(NULL, 0, MAPeriod, Gi_180, MAMethod, PRICE_LOW, 0);
//  double ima_92 = iMA(NULL, 0, MAPeriod, Gi_180, MAMethod, PRICE_HIGH, 0);
   double ibands_84=iBands(Symbol(),Period(),BB_PARAM,2.0,0,PRICE_CLOSE,MODE_UPPER,0);
   double ibands_92=iBands(Symbol(),Period(),BB_PARAM,2.0,0,PRICE_CLOSE,MODE_LOWER,0);

   double irsi_96=iRSI(Symbol(),Period(),RSI_PARAM,PRICE_CLOSE,0);

   if(!Gi_268)
     {
      for(int pos_108=OrdersHistoryTotal()-1; pos_108>=0; pos_108--)
        {
         if(OrderSelect(pos_108,SELECT_BY_POS,MODE_HISTORY))
           {
            if(OrderProfit()!=0.0)
              {
               if(OrderClosePrice()!=OrderOpenPrice())
                 {
                  if(OrderSymbol()==Symbol())
                    {
                     Gi_268 = TRUE;
                     Ld_112 = MathAbs(OrderProfit() / (OrderClosePrice() - OrderOpenPrice()));
                     Gd_272 = (-OrderCommission()) / Ld_112;
                     break;
                    }
                 }
              }
           }
        }
     }

   double Ld_120=Ask-Bid;
   ArrayCopy(Gda_280,Gda_280,0,1,29);
   Gda_280[29]=Ld_120;
   if(Gi_284<30) Gi_284++;
   double Ld_128=0;
   pos_108=29;
   for(int count_136=0; count_136<Gi_284; count_136++)
     {
      Ld_128+=Gda_280[pos_108];
      pos_108--;
     }
   double Ld_140 = Ld_128 / Gi_284;
   double Ld_148 = NormalizeDouble(Ask + Gd_272, G_digits_192);
   double Ld_156 = NormalizeDouble(Bid - Gd_272, G_digits_192);
   double Ld_164 = NormalizeDouble(Ld_140 + Gd_272, G_digits_192 + 1);
   double Ld_172 = ihigh_68 - ilow_76;
   if(Ld_172>Gd_256)
     {
      if(Bid<ibands_92 && irsi_96<50.0) Li_180=-1;
      else
         if(Bid>ibands_84 && irsi_96>50.0) Li_180=1;
     }
   int count_184=0;
   for(pos_108=0; pos_108<OrdersTotal(); pos_108++)
     {
      if(OrderSelect(pos_108,SELECT_BY_POS,MODE_TRADES))
        {
         if(OrderMagicNumber()==MyMagicNumber)
           {
            cmd_188=OrderType();
            if(cmd_188==OP_BUYLIMIT || cmd_188==OP_SELLLIMIT) continue;
            if(OrderSymbol()==Symbol())
              {
               count_184++;
               switch(cmd_188)
                 {
                  case OP_BUY:
                     if(Distance<0) break;
                     Ld_44=NormalizeDouble(OrderStopLoss(),G_digits_192);
                     price_60=NormalizeDouble(Bid-Gd_248,G_digits_192);
                     if(!((Ld_44==0.0 || price_60>Ld_44))) break;
                     bool_32=OrderModify(OrderTicket(),OrderOpenPrice(),price_60,OrderTakeProfit(),0,Lime);
                     if(!(!bool_32)) break;
                     error_8=GetLastError();
                     Print("BUY Modify Error Code: "+error_8+" Message: "+Ls_12+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+DoubleToStr(price_60,G_digits_192)+
                           " Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
                     break;
                  case OP_SELL:
                     if(Distance<0) break;
                     Ld_44=NormalizeDouble(OrderStopLoss(),G_digits_192);
                     price_60=NormalizeDouble(Ask+Gd_248,G_digits_192);
                     if(!((Ld_44==0.0 || price_60<Ld_44))) break;
                     bool_32=OrderModify(OrderTicket(),OrderOpenPrice(),price_60,OrderTakeProfit(),0,Orange);
                     if(!(!bool_32)) break;
                     error_8=GetLastError();
                     Print("SELL Modify Error Code: "+error_8+" Message: "+Ls_12+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+DoubleToStr(price_60,G_digits_192)+
                           " Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
                     break;
                  case OP_BUYSTOP:
                     Ld_36=NormalizeDouble(OrderOpenPrice(),G_digits_192);
                     price_24=NormalizeDouble(Ask+Gd_240,G_digits_192);
                     if(!((price_24<Ld_36))) break;
                     price_60= NormalizeDouble(price_24 -(StopLoss+MarketInfo(Symbol(),MODE_SPREAD)) * Point,G_digits_192);
                     bool_32 = OrderModify(OrderTicket(),price_24,price_60,OrderTakeProfit(),0,Lime);
                     if(!(!bool_32)) break;
                     error_8=GetLastError();
                     Print("BUYSTOP1 Modify Error Code: "+error_8+" Message: "+Ls_12+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+DoubleToStr(price_60,G_digits_192)+
                           " Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
                     break;
                  case OP_SELLSTOP:
                     Ld_36=NormalizeDouble(OrderOpenPrice(),G_digits_192);
                     price_24=NormalizeDouble(Bid-Gd_240,G_digits_192);
                     if(!((price_24>Ld_36))) break;
                     price_60= NormalizeDouble(price_24+(StopLoss+MarketInfo(Symbol(),MODE_SPREAD)) * Point,G_digits_192);
                     bool_32 = OrderModify(OrderTicket(),price_24,price_60,OrderTakeProfit(),0,Orange);
                     if(!(!bool_32)) break;
                     error_8=GetLastError();
                     Print("SELLSTOP1 Modify Error Code: "+error_8+" Message: "+Ls_12+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+DoubleToStr(price_60,G_digits_192)+
                           " Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
                 }
              }
           }
        }
     }
   if(count_184==0 && Li_180!=0 && Ld_164<=Gd_232 && f0_4())
     {
      Ld_196=AccountBalance()*AccountLeverage()*Gd_224;
      if(!UseMM) Ld_196=LotsSize;
      Ld_204 = NormalizeDouble(Ld_196 / MarketInfo(Symbol(), MODE_LOTSIZE), Gi_204);
      Ld_204 = MathMax(Gd_208, Ld_204);
      Ld_204 = MathMin(Gd_216, Ld_204);
      if(Li_180<0)
        {
         price_24 = NormalizeDouble(Ask + Gd_240, G_digits_192);
         price_60 = NormalizeDouble(price_24 - (StopLoss+ MarketInfo(Symbol(),MODE_SPREAD)) * Point, G_digits_192);

         if(MarketInfo(Symbol(),MODE_SPREAD)<def_MaxSpread) ticket_20=OrderSend(Symbol(),OP_BUYSTOP,Ld_204,price_24,G_slippage_264,price_60,0,Comment_,MyMagicNumber,0,Lime);
         if(ticket_20<=0)
           {
            error_8=GetLastError();
            Print("BUYSTOP2 Send Error Code: "+error_8+" Message: "+Ls_12+" LT: "+DoubleToStr(Ld_204,Gi_204)+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+
                  DoubleToStr(price_60,G_digits_192)+" Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
           }
           } else {
         price_24 = NormalizeDouble(Bid - Gd_240, G_digits_192);
         price_60 = NormalizeDouble(price_24+(StopLoss+MarketInfo(Symbol(),MODE_SPREAD)) * Point,G_digits_192);
         if(MarketInfo(Symbol(),MODE_SPREAD)<def_MaxSpread) ticket_20=OrderSend(Symbol(),OP_SELLSTOP,Ld_204,price_24,G_slippage_264,price_60,0,Comment_,MyMagicNumber,0,Orange);
         if(ticket_20<=0)
           {
            error_8=GetLastError();
            Print("SELLSTOP2 Send Error Code: "+error_8+" Message: "+Ls_12+" LT: "+DoubleToStr(Ld_204,Gi_204)+" OP: "+DoubleToStr(price_24,G_digits_192)+" SL: "+
                  DoubleToStr(price_60,G_digits_192)+" Bid: "+DoubleToStr(Bid,G_digits_192)+" Ask: "+DoubleToStr(Ask,G_digits_192));
           }
        }
     }
   string Ls_212="AvgSpread:"+DoubleToStr(Ld_140,G_digits_192)+"  Commission rate:"+DoubleToStr(Gd_272,G_digits_192+1)+"  Real avg. spread:"+DoubleToStr(Ld_164,
                                          G_digits_192+1);
   if(Ld_164>Gd_232)
     {
      Ls_212=Ls_212
             +"\n"
             +"The EA can not run with this spread ( "+DoubleToStr(Ld_164,G_digits_192+1)+" > "+DoubleToStr(Gd_232,G_digits_192+1)+" )";
     }
   if(count_184!=0 || Li_180!=0)
     {
     }
   if(!IsTesting())
     {
      f0_2();
      f0_7();
      f0_0();
      f0_3();
      f0_8();
     }
   return (0);
  }