aiutami ad analizzare questo EA
#property copyright "Ultimate cash";
#property version "1.01";
#property strict

#import "kernel32.dll"

int CreateFileW(string,int,int,int,int,int,int);
int GetFileSize(int,int);
int SetFilePointer(int,int,int&,int);
int ReadFile(int,uchar&[],int,int&[],int);
int CloseHandle(int);

#import

extern int MagicID = 260289;
extern double FixedLot = 0.01;
extern int AutoLot = 1; 
extern double StopLoss = 2000;
extern double TakeProfit = 250;
extern double MaxOrders = 5;
extern double WPR_Period = 150;

extern bool WPR_Filter = true;


union Price
{
   public:
      uchar m_0[8];
      double m_52;
};


double pointValue;
int slippage;
string Is_00050;
int Gi_00000;
long Il_00090;
int Gi_00001;
long Gl_00002;
bool Gb_00002;
int Ii_0004C;
int Gi_00002;
int Gi_00004;
double Gd_00005;
int Gi_00006;
double Gd_00008;
int Gi_00009;
int Gi_0000A;
double Gd_0000E;
int Gi_0000F;
int Gi_00016;
int Gi_00017;
int Gi_00018;
int ordersNumber;
int Gi_0001A;
int buyOrdersCounter;
int Gi_0001C;
int sellOrdersCounter;
int Gi_0001E;
double lotSize;
double minLot;
double maxLot;
int openOrder;
string Is_00060;
uchar Gc_00002;
uchar Gc_00004;
int Gi_00005;
uchar Gc_00006;
uchar Gc_00008;
uchar Gc_0000A;
uchar Gc_0000C;
uchar Gc_0000E;
uchar Gc_00010;
int Gi_00021;
double priceHistory[][2];

Price Input_Price_00000070;

bool order_check;

int init()
{
   string orderComment;
   int currentHistoryIndex;
   string Ls_FFFF0;
  
   slippage = 3; 
   Ii_0004C = 0;
   pointValue = 0;
   openOrder = 0;
   Il_00090 = 0;
      
   if (IsDllsAllowed() != true) { 
   Alert("Make Sure DLL Import is Allowed");
   ExpertRemove();
   currentHistoryIndex = 1;
   return currentHistoryIndex;
   } 

   pointValue = _Point;
   if (_Digits == 5 || _Digits == 3) { 
   
   pointValue = (pointValue * 1);
   slippage = slippage * 10;
   } 
   ChartSetInteger(0, 17, 0, 0);
   ChartSetInteger(0, 0, 1);
   Ls_FFFF0 = AccountInfoString(3);
   if (Ls_FFFF0 == "") { 
   Ls_FFFF0 = "default";
   } 
   orderComment = TerminalInfoString(3);
   orderComment = orderComment + "\\history\\";
   orderComment = orderComment + Ls_FFFF0;
   orderComment = orderComment + "\\";
   orderComment = orderComment + _Symbol;
   orderComment = orderComment + "240";
   orderComment = orderComment + ".hst";
   Is_00050 = orderComment;
   func_1020(orderComment);
   currentHistoryIndex = 0;
   
   return currentHistoryIndex;
}

void OnTick()
{
   string orderComment;
   string buySignalMessage;
   string sellSignalMessage;
   int currentHistoryIndex;
   int openOrderIndex;
   double williamPRange;
   double awesomeOscillator;
   double Ld_FFFE0;
   double Ld_FFFD8;
   double stopLoss;
   double takeProfit;

   if (Il_00090 == Time[0]) return; 
   Il_00090 = Time[0];
   ChartRedraw(0);
   Gl_00002 = iVolume(_Symbol, 15, 0);
   if (Gl_00002 > iVolume(_Symbol, 15, 1)) return; 
   Gb_00002 = !Ii_0004C;
   Gi_00002 = Gb_00002;
   if (Gi_00002 > 0) return; 
   currentHistoryIndex = -1;
   openOrderIndex = 0;
   Gi_00002 = Ii_0004C - 1;
   if (Gi_00002 > 0) { 
   do { 
   if ((priceHistory[openOrderIndex, 0] >= Time[0])) break; 
   currentHistoryIndex = openOrderIndex + 1;
   openOrderIndex = openOrderIndex + 1;
   Gi_00004 = Ii_0004C - 1;
   } while (openOrderIndex < Gi_00004); 
   } 

//   HideTestIndicators(true);
   williamPRange = iWPR(_Symbol, 0, WPR_Period, 0);
   awesomeOscillator = iAO(_Symbol, 0, 0);
//   HideTestIndicators(false);

   Ld_FFFE0 = NormalizeDouble(priceHistory[currentHistoryIndex, 1], _Digits);
   ObjectDelete("level");
   Gd_00005 = Ld_FFFE0;
   orderComment = "level";
   if ((Ld_FFFE0 > iOpen(_Symbol, 1, 0))) { 
   buySignalMessage = "BUY 123 = " + DoubleToString(Ld_FFFE0, _Digits);
   Comment(buySignalMessage);
   } 
   if ((Gd_00005 < iOpen(_Symbol, 1, 0))) { 
   sellSignalMessage = "SELL 123 = " + DoubleToString(Gd_00005, _Digits);
   Comment(sellSignalMessage);
   } 
   if (ObjectFind(orderComment) != -1) { 
   ObjectMove(orderComment, 0, iTime(_Symbol, 1, 0), Gd_00005);
   } 
   else { 
   ObjectCreate(0, orderComment, OBJ_HLINE, 0, 0, Gd_00005, 0, 0, 0, 0);
   ObjectSet(orderComment, OBJPROP_COLOR, 16776960);
   ObjectSet(orderComment, OBJPROP_STYLE, 0);
   ObjectSet(orderComment, OBJPROP_WIDTH, 2);
   ObjectSet(orderComment, OBJPROP_BACK, 1);
   } 

   if ((priceHistory[currentHistoryIndex, 1] > Open[0])) { 
   Comment("BUY 456 - ", priceHistory[currentHistoryIndex, 1]);
   } 
   if ((priceHistory[currentHistoryIndex, 1] < Open[0])) { 
   Comment("SELL 456 - ", priceHistory[currentHistoryIndex, 1]);
   } 
/*
   if ((priceHistory[currentHistoryIndex, 1] > Open[0])) { 
   Comment("BUY Ultimate - ", priceHistory[currentHistoryIndex, 1]);
   } 
   if ((priceHistory[currentHistoryIndex, 1] < Open[0])) { 
   Comment("SELL Ultimate - ", priceHistory[currentHistoryIndex, 1]);
   } 
*/
   Ld_FFFD8 = MarketInfo(_Symbol, MODE_SPREAD);
   MarketInfo(_Symbol, MODE_SPREAD);
/*
   Gi_00016 = 0;
   Gi_00017 = OrdersTotal() - 1;
   Gi_00018 = Gi_00017;
   if (Gi_00017 >= 0) { 
   do { 
   order_check = OrderSelect(Gi_00018, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_BUY) { 
   Gi_00016 = Gi_00016 + 1;
   } 
   Gi_00018 = Gi_00018 - 1;
   } while (Gi_00018 >= 0); 
   } 
   if (Gi_00016 >= MaxOrders) return; 
   Gi_00017 = 0;
   ordersNumber = OrdersTotal() - 1;
   Gi_0001A = ordersNumber;
   if (ordersNumber >= 0) { 
   do { 
   order_check = OrderSelect(Gi_0001A, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_SELL) { 
   Gi_00017 = Gi_00017 + 1;
   } 
   Gi_0001A = Gi_0001A - 1;
   } while (Gi_0001A >= 0); 
   } 
   if (Gi_00017 >= MaxOrders) return; 
*/

/////////////////// CONTATORE ORDINI BUY /////////////////////////

ordersNumber = 0;
buyOrdersCounter = OrdersTotal() - 1;
//   Gi_0001C = buyOrdersCounter;
if (buyOrdersCounter >= 0) { 
   do { 
      order_check = OrderSelect(buyOrdersCounter, 0, 0);
      if (OrderMagicNumber() == MagicID && 
          OrderSymbol() == _Symbol && 
          OrderType() == OP_BUY) { 
          ordersNumber = ordersNumber + 1;
      } 
      buyOrdersCounter = buyOrdersCounter - 1;
   } while (buyOrdersCounter >= 0); 
} 
if (ordersNumber >= MaxOrders) return; 
if ((WPR_Filter) && (((iWPR(_Symbol, 0, WPR_Period, 0) - 10) >= -1))) return; 

/*
ordersNumber = 0;
buyOrdersCounter = OrdersTotal() - 1;

if (buyOrdersCounter >= 0) { 
    do { 
        order_check = OrderSelect(buyOrdersCounter, SELECT_BY_POS, MODE_TRADES);        
        if (OrderMagicNumber() == MagicID &&
            OrderSymbol() == _Symbol &&
            OrderType() == OP_BUY) { 
            ordersNumber++;
        } 
        buyOrdersCounter--;
    } while (buyOrdersCounter >= 0); 
}
if (ordersNumber >= MaxOrders) {
    return; 
}
if ((WPR_Filter) && (((iWPR(_Symbol, 0, WPR_Period, 0) - 10) >= -1))) return; 

/*
// Inizializza il contatore degli ordini di acquisto a zero.
ordersNumber = 0;

// Ottiene l’indice dell’ultimo ordine nell’elenco degli ordini aperti (gli indici partono da 0).
buyOrdersCounter = OrdersTotal() - 1;

// Verifica se c’è almeno un ordine aperto.
if (buyOrdersCounter >= 0) { 
    // Esegue un ciclo per tutti gli ordini aperti, dal più recente al più vecchio.
    do { 
        // Seleziona l’ordine corrente basato sulla sua posizione nell’elenco per permetterne l’ispezione.
        order_check = OrderSelect(buyOrdersCounter, SELECT_BY_POS, MODE_TRADES);
        
        // Controlla se l’ordine attualmente selezionato soddisfa tutti i seguenti criteri:
        // 1. L’ordine è stato piazzato da questo EA (verificato dal Magic Number).
        // 2. L’ordine è sul simbolo (_Symbol) corrente su cui l’EA è in esecuzione.
        // 3. L’ordine è un ordine di acquisto (OP_BUY).
        if (OrderMagicNumber() == MagicID &&
            OrderSymbol() == _Symbol &&
            OrderType() == OP_BUY) { 
            // Se l’ordine soddisfa i criteri, incrementa il contatore degli ordini di acquisto.
            ordersNumber++;
        } 

        // Passa all’ordine precedente nell’elenco.
        buyOrdersCounter–;
    } while (buyOrdersCounter >= 0); // Continua finché ci sono ordini da verificare.
}

// Dopo avere controllato tutti gli ordini, verifica se il numero di ordini di acquisto ha raggiunto il limite massimo consentito.
if (ordersNumber >= MaxOrders) {
    // Se il numero massimo di ordini è stato raggiunto o superato, esce dalla funzione senza eseguire ulteriori azioni.
    return; 
}
*/

/////////////////// CONTATORE ORDINI SELL /////////////////////////

   ordersNumber = 0;
   sellOrdersCounter = OrdersTotal() - 1;
//   Gi_0001E = sellOrdersCounter;
   if (sellOrdersCounter >= 0) { 
   do { 
   order_check = OrderSelect(sellOrdersCounter, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_SELL) { 
   ordersNumber = ordersNumber + 1;
   } 
   sellOrdersCounter = sellOrdersCounter - 1;
   } while (sellOrdersCounter >= 0); 
   } 
   if (ordersNumber >= MaxOrders) return; 
   if ((WPR_Filter) && (((iWPR(_Symbol, 0, WPR_Period, 0) - 90) <= -99))) return; 

/////////////////////////////////////////////////////   

//   if ((priceHistory[currentHistoryIndex, 1] <= Open[0])) return; 
    
   if ((priceHistory[currentHistoryIndex, 1] > Open[0]) && buyConditions()) { 
//   lotSize = (StopLoss * pointValue);
   stopLoss = NormalizeDouble((Ask - (StopLoss * pointValue)), _Digits);
   takeProfit = NormalizeDouble(((TakeProfit * pointValue) + Ask), _Digits);
//   lotSize = 0;
   minLot = MarketInfo(_Symbol, MODE_MINLOT);
   maxLot = MarketInfo(_Symbol, MODE_MAXLOT);

   if (AutoLot != 0) {
   lotSize = NormalizeDouble((((AccountBalance() * AutoLot) / 10) / 10000), 2);
   if ((lotSize < minLot)) { 
   lotSize = minLot;
   } 
   if ((lotSize > maxLot)) {
   lotSize = maxLot;
   }}
   else{
   lotSize = FixedLot;
   }
   if ((AccountFreeMarginCheck(_Symbol, 1, lotSize) <= 0)) return; 

   openOrder = OrderSend(_Symbol, 0, lotSize, Ask, slippage, stopLoss, takeProfit, "Ultimate EA - Buy", MagicID, 0, 32768);
   closeSellOrders();
   } 


//   if ((priceHistory[currentHistoryIndex, 1] >= Open[0])) return; 
//   if (!sellConditions()) return; 
   if ((priceHistory[currentHistoryIndex, 1] < Open[0]) && sellConditions()) { 

   stopLoss = NormalizeDouble(((StopLoss * pointValue) + Bid), _Digits);
//   lotSize = (TakeProfit * pointValue);
   takeProfit = NormalizeDouble((Bid - (TakeProfit * pointValue)), _Digits);
//   lotSize = 0;
   minLot = MarketInfo(_Symbol, MODE_MINLOT);
   maxLot = MarketInfo(_Symbol, MODE_MAXLOT);

   if (AutoLot != 0) {
   lotSize = NormalizeDouble((((AccountBalance() * AutoLot) / 10) / 10000), 2);
   if ((lotSize < minLot)) { 
      lotSize = minLot;
   } 
   if ((lotSize > maxLot)) {
      lotSize = maxLot;
   }}
   else{
      lotSize = FixedLot;
   }
   if ((AccountFreeMarginCheck(_Symbol, 1, lotSize) <= 0)) return; 
   
   openOrder = OrderSend(_Symbol, 1, lotSize, Bid, slippage, stopLoss, takeProfit, "Ultimate EA - Sell", MagicID, 0, 32768);
   closeBuyOrders();
   
}
}



void OnDeinit(const int reason)
{
   ObjectsDeleteAll(-1, -1);
   ChartRedraw(0);
}



void func_1020(string Fa_s_00)
{
   string orderComment;
   int currentHistoryIndex;
   string Ls_FFFF0;
   int Li_FFFEC;
   int Li_FFFE8;
   int Li_FFFE4 = 0;
   int Li_FFF78;
   int Li_FFF3C;
   double Ld_FFF30;

   currentHistoryIndex = 0;
   Li_FFFEC = 0;
   Li_FFFE8 = 0;
   char Lc_FFF7C[];
   Li_FFF78 = 0;
   int Li_FFF74[1];
   Li_FFF3C = 0;
   Ld_FFF30 = 0;
   Ls_FFFF0 = "";
   orderComment = Fa_s_00;
   Gi_00000 = CreateFileW(orderComment, -2147483648, 3, 0, 3, 0, 0);
   Li_FFFEC = Gi_00000;
   if (Gi_00000 == -1) { 
   Comment("");
   ArrayFree(Li_FFF74);
   ArrayFree(Lc_FFF7C);
   return;
   } 
   Li_FFFE8 = GetFileSize(Li_FFFEC, 0);
   if (Li_FFFE8 <= 0) { 
   ArrayFree(Li_FFF74);
   ArrayFree(Lc_FFF7C);
   return ;
   } 
   Gi_00000 = Li_FFFE8 - 148;
   Gi_00000 = Gi_00000 / 60;
   if (Gi_00000 == Ii_0004C) { 
   ArrayFree(Li_FFF74);
   ArrayFree(Lc_FFF7C);
   return ;
   } 
   SetFilePointer(Li_FFFEC, 148, Li_FFFE4, 0);
   Gi_00000 = Li_FFFE8 - 148;
   Ii_0004C = Gi_00000 / 60;
   ArrayResize(priceHistory, Ii_0004C, 0);
   Li_FFF78 = 60;
   ArrayResize(Lc_FFF7C, 60, 0);
   Li_FFF3C = 0;
   if (Ii_0004C > 0) { 
   do { 
   ReadFile(Li_FFFEC, Lc_FFF7C, Li_FFF78, Li_FFF74, 0);
   if (Li_FFF74[0] == Li_FFF78) { 
   Gc_00002 = Lc_FFF7C[0];
   Gc_00004 = Lc_FFF7C[1];
   Gc_00006 = Lc_FFF7C[2];
   Gc_00008 = Lc_FFF7C[3];
   Gc_0000A = Lc_FFF7C[4];
   Gc_0000C = Lc_FFF7C[5];
   Gc_0000E = Lc_FFF7C[6];
   Gc_00010 = Lc_FFF7C[7];
   Is_00060 = StringFormat("0x%02x%02x%02x%02x%02x%02x%02x%02x", Gc_00010, Gc_0000E, Gc_0000C, Gc_0000A, Gc_00008, Gc_00006, Gc_00004, Gc_00002);
   Input_Price_00000070.m_0[0] = Lc_FFF7C[32];
   Input_Price_00000070.m_0[1] = Lc_FFF7C[33];
   Input_Price_00000070.m_0[2] = Lc_FFF7C[34];
   Input_Price_00000070.m_0[3] = Lc_FFF7C[35];
   Input_Price_00000070.m_0[4] = Lc_FFF7C[36];
   Input_Price_00000070.m_0[5] = Lc_FFF7C[37];
   Input_Price_00000070.m_0[6] = Lc_FFF7C[38];
   Input_Price_00000070.m_0[7] = Lc_FFF7C[39];
   Ld_FFF30 = Input_Price_00000070.m_52;
   priceHistory[currentHistoryIndex, 0] = StringToDouble(Is_00060);
   priceHistory[currentHistoryIndex, 1] = Ld_FFF30;
   currentHistoryIndex = currentHistoryIndex + 1;
   orderComment = TimeToString(StringToTime(Is_00060), 3);
   orderComment = orderComment + " ";
   orderComment = orderComment + DoubleToString(Ld_FFF30, 8);
   Ls_FFFF0 = orderComment;
   } 
   else { 
   CloseHandle(Li_FFFEC);
   ArrayFree(Li_FFF74);
   ArrayFree(Lc_FFF7C);
   return ;
   } 
   Li_FFF3C = Li_FFF3C + 1;
   } while (Li_FFF3C < Ii_0004C); 
   } 
/*   
   CloseHandle(Li_FFFEC);
   Gi_0001A = currentHistoryIndex - 1;
   orderComment = DoubleToString(priceHistory[Gi_0001A, 0], 3);
   orderComment = orderComment + " ";
   sellOrdersCounter = Gi_0001A;
   orderComment = orderComment + DoubleToString(priceHistory[Gi_0001A, 1], 8);
   orderComment = orderComment + " ";
   Gi_0001E = currentHistoryIndex - 2;
   orderComment = orderComment + DoubleToString(priceHistory[Gi_0001E, 1], 3);
   orderComment = orderComment + " ";
   Gi_00021 = Gi_0001E;
   orderComment = orderComment + DoubleToString(priceHistory[Gi_0001E, 1], 8);
   Ls_FFFF0 = orderComment;
   Is_00060 = orderComment;
   ArrayFree(Li_FFF74);
   ArrayFree(Lc_FFF7C);
*/ 
}

void closeBuyOrders()
{
   bool orderCloseSuccess;
   int openOrderIndex;

   orderCloseSuccess = false;

   Gi_00000 = 0;
   Gi_00001 = OrdersTotal() - 1;
   Gi_00002 = Gi_00001;
   if (Gi_00001 >= 0) { 
   do { 
   order_check = OrderSelect(Gi_00002, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_BUY) { 
   Gi_00000 = Gi_00000 + 1;
   } 
   Gi_00002 = Gi_00002 - 1;
   } while (Gi_00002 >= 0); 
   } 
   if (Gi_00000 <= 0) return; 

   do { 
   openOrderIndex = OrdersTotal() - 1;
   if (openOrderIndex >= 0) { 
   do { 
   if (OrderSelect(openOrderIndex, 0, 0) && OrderSymbol() == _Symbol && OrderMagicNumber() == MagicID && OrderType() == OP_BUY) { 
   orderCloseSuccess = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), slippage, 16776960);
   } 
   openOrderIndex = openOrderIndex - 1;
   } while (openOrderIndex >= 0); 
   } 

   Gi_00004 = 0;
   Gi_00005 = OrdersTotal() - 1;
   Gi_00006 = Gi_00005;
   if (Gi_00005 >= 0) { 
   do { 
   order_check = OrderSelect(Gi_00006, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_BUY) { 
   Gi_00004 = Gi_00004 + 1;
   } 
   Gi_00006 = Gi_00006 - 1;
   } while (Gi_00006 >= 0); 
   }
    
   } while (Gi_00004 > 0); 
   
}

void closeSellOrders()
{
   bool orderCloseSuccess;
   int openOrderIndex;

   orderCloseSuccess = false;
   Gi_00000 = 0;
   Gi_00001 = OrdersTotal() - 1;
   Gi_00002 = Gi_00001;
   if (Gi_00001 >= 0) { 
   do { 
   order_check = OrderSelect(Gi_00002, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_SELL) { 
   Gi_00000 = Gi_00000 + 1;
   } 
   Gi_00002 = Gi_00002 - 1;
   } while (Gi_00002 >= 0); 
   } 
   if (Gi_00000 <= 0) return; 
   do { 
   openOrderIndex = OrdersTotal() - 1;
   if (openOrderIndex >= 0) { 
   do { 
   if (OrderSelect(openOrderIndex, 0, 0) && OrderSymbol() == _Symbol && OrderMagicNumber() == MagicID && OrderType() == OP_SELL) { 
   orderCloseSuccess = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), slippage, 16776960);
   } 
   openOrderIndex = openOrderIndex - 1;
   } while (openOrderIndex >= 0); 
   } 
   Gi_00004 = 0;
   Gi_00005 = OrdersTotal() - 1;
   Gi_00006 = Gi_00005;
   if (Gi_00005 >= 0) { 
   do { 
   order_check = OrderSelect(Gi_00006, 0, 0);
   if (OrderMagicNumber() == MagicID && OrderSymbol() == _Symbol && OrderType() == OP_SELL) { 
   Gi_00004 = Gi_00004 + 1;
   } 
   Gi_00006 = Gi_00006 - 1;
   } while (Gi_00006 >= 0); 
   } 
   } while (Gi_00004 > 0); 
   
}

bool buyConditions()
{
   double williamPRange;
   double awesomeOscillator;
   double Ld_FFFE0;
   double Ld_FFFD8;
   double stopLoss;
   double takeProfit;
   double Ld_FFFB0;
   double Ld_FFFA8;
   double Ld_FFFA0;
   double Ld_FFF98;
   double Ld_FFF90;
   bool orderCloseSuccess;

   williamPRange = 0;
   awesomeOscillator = 0;
   Ld_FFFE0 = 0;
   Ld_FFFD8 = 0;
   stopLoss = 0;
   takeProfit = 0;
   stopLoss = 0;
   takeProfit = 0;
   Ld_FFFB0 = 0;
   Ld_FFFA8 = 0;
   Ld_FFFA0 = 0;
   Ld_FFF98 = 0;
   williamPRange = Open[1];
   awesomeOscillator = Close[1];
   Ld_FFFE0 = High[0];
   Ld_FFFD8 = Low[1];
   takeProfit = Open[2];
   stopLoss = Close[2];
   stopLoss = High[2];
   takeProfit = Low[2];
   Ld_FFFB0 = (Ld_FFFE0 - Ld_FFFD8);
   Ld_FFFA8 = (stopLoss - takeProfit);
   Gd_00008 = (Ld_FFFB0 * 0.4);
   Ld_FFFA0 = (Ld_FFFE0 - Gd_00008);
   Ld_FFF98 = Ld_FFFA0;
   Gd_00008 = 0;
   double Ld_FFF70[4];
   Gi_00009 = 0;
   Gi_0000A = 1;
   do { 
   if (TimeDayOfWeek(Time[Gi_0000A]) != 0) { 
   Gd_00008 = ((High[Gi_0000A] - Low[Gi_0000A]) + Gd_00008);
   Gi_00009 = Gi_00009 + 1;
   } 
   Gi_0000A = Gi_0000A + 1;
   } while (Gi_00009 < 4); 
   Gd_0000E = (Gd_00008 / 4);
   ArrayFree(Ld_FFF70);
   Ld_FFF90 = Gd_0000E;

   if ((awesomeOscillator <= Ld_FFF98)) return false; 
   if ((williamPRange <= Ld_FFFA0)) return false; 
   if ((Ld_FFFB0 <= (Gd_0000E * 0.5))) return false; 
   if ((((Ld_FFFB0 * 0.25) + Ld_FFFD8) >= takeProfit)) return false; 

   Gi_0000F = ArrayMinimum(Low, 3, 3);
   if ((Low[Gi_0000F] <= Low[1])) return false; 
   orderCloseSuccess = true;
   return orderCloseSuccess;
   
   orderCloseSuccess = false;
   
   return orderCloseSuccess;
}

bool sellConditions()
{
   double williamPRange;
   double awesomeOscillator;
   double Ld_FFFE0;
   double Ld_FFFD8;
   double stopLoss;
   double takeProfit;
   double Ld_FFFB0;
   double Ld_FFFA8;
   double Ld_FFFA0;
   double Ld_FFF98;
   double Ld_FFF90;
   bool orderCloseSuccess;

   williamPRange = 0;
   awesomeOscillator = 0;
   Ld_FFFE0 = 0;
   Ld_FFFD8 = 0;
   stopLoss = 0;
   takeProfit = 0;
   stopLoss = 0;
   takeProfit = 0;
   Ld_FFFB0 = 0;
   Ld_FFFA8 = 0;
   Ld_FFFA0 = 0;
   Ld_FFF98 = 0;
   williamPRange = Open[1];
   awesomeOscillator = Close[1];
   Ld_FFFE0 = High[1];
   Ld_FFFD8 = Low[1];
   takeProfit = Open[2];
   stopLoss = Close[2];
   stopLoss = High[2];
   takeProfit = Low[2];
   Ld_FFFB0 = (Ld_FFFE0 - Ld_FFFD8);
   Ld_FFFA8 = (stopLoss - takeProfit);
   Ld_FFFA0 = ((Ld_FFFB0 * 0.4) + Ld_FFFD8);
   Ld_FFF98 = Ld_FFFA0;
   Gd_00008 = 0;
   double Ld_FFF70[4];
   Gi_00009 = 0;
   Gi_0000A = 1;
   do { 
   if (TimeDayOfWeek(Time[Gi_0000A]) != 0) { 
   Gd_00008 = ((High[Gi_0000A] - Low[Gi_0000A]) + Gd_00008);
   Gi_00009 = Gi_00009 + 1;
   } 
   Gi_0000A = Gi_0000A + 1;
   } while (Gi_00009 < 4); 
   Gd_0000E = (Gd_00008 / 4);
   ArrayFree(Ld_FFF70);
   Ld_FFF90 = Gd_0000E;

   if ((awesomeOscillator >= Ld_FFF98)) return false; 
   if ((williamPRange >= Ld_FFFA0)) return false; 
   if ((Ld_FFFB0 <= (Gd_0000E * 0.5))) return false; 
   if (((Ld_FFFE0 - (Ld_FFFB0 * 0.25)) <= stopLoss)) return false; 

   Gi_0000F = ArrayMaximum(High, 3, 3);
   if ((High[Gi_0000F] >= High[1])) return false; 
   orderCloseSuccess = true;
   return orderCloseSuccess;
   
   orderCloseSuccess = false;
   
   return orderCloseSuccess;
}



Da qualche parte ci sono dei buy limit e sell limit?