alguém me ajuda nessa logica

 
//+------------------------------------------------------------------+
bool teste(){

  double bid= SymbolInfoDouble(_Symbol,SYMBOL_BID);
//---
if(PositionsTotal()==0){
   for(int i = ObjectsTotal(0,0,OBJ_TREND)-1;i>=0; i--) {
   string name=ObjectName(0,i,0,OBJ_TREND);
   
   if(StringFind(name,"Current_Resistance")>-1) {
   double price = ObjectGetDouble(0,name,OBJPROP_PRICE);
   color clr = (color)ObjectGetInteger(0,name,OBJPROP_COLOR);
   if(clr==clrBlue) {
   
   if(bid>price&& lastbid<=price) {
double entry = SymbolInfoDouble(_Symbol,SYMBOL_BID);

entry= NormalizeDouble(entry,_Digits);

double stop = entry + slline*_Point;
   stop =NormalizeDouble(stop,_Digits);
   
double take = entry - tpline*_Point;
   take= NormalizeDouble(take,_Digits);
   
   trader.Sell(lot,_Symbol,entry,stop,take);
  }}

}}
   lastbid=bid;
 }return true;
}
//+------------------------------------------------------------------+
bool teste2(){

  double bid= SymbolInfoDouble(_Symbol,SYMBOL_ASK);
//---
if(PositionsTotal()==0){
   for(int i = ObjectsTotal(0,0,OBJ_TREND)-1;i>=0; i--) {
   string name=ObjectName(0,i,0,OBJ_TREND);
   
   if(StringFind(name,"Current_Support")>-1) {
   double price = ObjectGetDouble(0,name,OBJPROP_PRICE);
   color clr = (color)ObjectGetInteger(0,name,OBJPROP_COLOR);
   if(clr==clrRed) {
   
   if(bid<price&& lastbid>=price) {
double entry = SymbolInfoDouble(_Symbol,SYMBOL_ASK);

entry= NormalizeDouble(entry,_Digits);

double stop = entry - slline*_Point;
   stop =NormalizeDouble(stop,_Digits);
   
double take = entry + tpline*_Point;
   take= NormalizeDouble(take,_Digits);
   
   trader.Buy(lot,_Symbol,entry,stop,take);
  }}

}}
   lastbid=bid;
 }return true;
}
eu estou me baseando as entradas no objeto trend no gráfico, fiz essas funções mais só aciona uma, seria o loop que tenho que mexer , pra buscar mais de um objeto? são dois OBJ_TREND suporte compra e resistência venda.
Documentação sobre MQL5: Constantes, Enumeradores e Estruturas / Constantes de Objetos / Tipos de Objeto
Documentação sobre MQL5: Constantes, Enumeradores e Estruturas / Constantes de Objetos / Tipos de Objeto
  • www.mql5.com
Tipos de Objeto - Constantes de Objetos - Constantes, Enumeradores e Estruturas - Referência MQL5 - Referência sobre algorítimo/automatização de negociação na linguagem para MetaTrader 5