How can I plot net arrows and support and resistance code?

 
//... (o código anterior permanece inalterado)

int início() {
   //... (o código anterior permanece inalterado)

   //Verifica as condições de compra e venda
   for (int i = CountPeriods-1; i >= 0; i--) {
      time1 = iTime(NULL, ponto final, i);
      
      //... (calcular P, R1, R2, R3, S1, S2, S3, H1, H2, H3, H4, L1, L2, L3, L4 e Range como antes)
      
      tempo2 = tempo1 + período*60;
      
      //... (traçar linhas para DCP, DR1, DR2, DR3, DS1, DS2, DS3, DH1, DH2, DH3, DH4, DL1, DL2, DL3, DL4 como antes)
      
      double closePrice = iClose(NULL, período, i);
      
      // Condição de compra: fechamento acima do nível do pivô
      if (closePrice > P && i <ContPeriods - 1) {
         ObjectCreate(0, "BuyArrow" + IntegerToString(i), OBJ_ARROW, 0, P, i + 1, P);
         ObjectSet(0, "BuyArrow" + IntegerToString(i), OBJPROP_COLOR, Verde);
         ObjectSet(0, "BuyArrow" + IntegerToString(i), OBJPROP_ARROWCODE, 241);
      }
      
      // Condição de venda: fechamento abaixo do nível do pivô
      if (closePrice <P && i <ContPeriods - 1) {
         ObjectCreate(0, "SellArrow" + IntegerToString(i), OBJ_ARROW, 0, P, i + 1, P);
         ObjectSet(0, "SellArrow" + IntegerToString(i), OBJPROP_COLOR, Vermelho);
         ObjectSet(0, "SellArrow" + IntegerToString(i), OBJPROP_ARROWCODE, 242);
      }
   }
}

 
Write in English in this part of the forum please.
 
You can use the built-in drawing functions. Hope this helps.
int OnStart()
{
   // ... (previous code - as is)

   // Check buy and sell conditions
   for (int i = CountPeriods - 1; i >= 0; i--)
   {
      datetime time1 = iTime(NULL, 0, i);

      // ... (calculate P, R1, R2, R3, S1, S2, S3, H1, H2, H3, H4, L1, L2, L3, L4, and Range as before)

      datetime time2 = time1 + PeriodSeconds() * 60;

      // ... (draw lines for DCP, DR1, DR2, DR3, DS1, DS2, DS3, DH1, DH2, DH3, DH4, DL1, DL2, DL3, DL4 as before)

      double closePrice = iClose(NULL, 0, i);

      // Buy condition: closing price above pivot level
      if (closePrice > P && i < CountPeriods - 1)
      {
         ObjectCreate(0, "BuyArrow" + IntegerToString(i), OBJ_ARROW, 0, time2, P);
         ObjectSetInteger(0, "BuyArrow" + IntegerToString(i), OBJPROP_COLOR, clrGreen);
         ObjectSetInteger(0, "BuyArrow" + IntegerToString(i), OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
      }

      // Sell condition: closing price below pivot level
      if (closePrice < P && i < CountPeriods - 1)
      {
         ObjectCreate(0, "SellArrow" + IntegerToString(i), OBJ_ARROW, 0, time2, P);
         ObjectSetInteger(0, "SellArrow" + IntegerToString(i), OBJPROP_COLOR, clrRed);
         ObjectSetInteger(0, "SellArrow" + IntegerToString(i), OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
      }
   }

   return(INIT_SUCCEEDED);
}


 
Jailton André:
//... (o código anterior permanece inalterado)

int início() {
   //... (o código anterior permanece inalterado)

   //Verifica as condições de compra e venda
   for (int i = CountPeriods-1; i >= 0; i--) {
      time1 = iTime(NULL, ponto final, i);
      
      //... (calcular P, R1, R2, R3, S1, S2, S3, H1, H2, H3, H4, L1, L2, L3, L4 e Range como antes)
      
      tempo2 = tempo1 + período*60;
      
      //... (traçar linhas para DCP, DR1, DR2, DR3, DS1, DS2, DS3, DH1, DH2, DH3, DH4, DL1, DL2, DL3, DL4 como antes)
      
      double closePrice = iClose(NULL, período, i);
      
      // Condição de compra: fechamento acima do nível do pivô
      if (closePrice > P && i <ContPeriods - 1) {
         ObjectCreate(0, "BuyArrow" + IntegerToString(i), OBJ_ARROW, 0, P, i + 1, P);
         ObjectSet(0, "BuyArrow" + IntegerToString(i), OBJPROP_COLOR, Verde);
         ObjectSet(0, "BuyArrow" + IntegerToString(i), OBJPROP_ARROWCODE, 241);
      }
      
      // Condição de venda: fechamento abaixo do nível do pivô
      if (closePrice <P && i <ContPeriods - 1) {
         ObjectCreate(0, "SellArrow" + IntegerToString(i), OBJ_ARROW, 0, P, i + 1, P);
         ObjectSet(0, "SellArrow" + IntegerToString(i), OBJPROP_COLOR, Vermelho);
         ObjectSet(0, "SellArrow" + IntegerToString(i), OBJPROP_ARROWCODE, 242);
      }
   }
}

Usamos el idioma inglés aquí en el foro, por favor publique su código en inglés. La solución que está buscando son las funciones integradas para su indicador, puede usarlas como plantilla y completar los espacios en blanco a medida que avanza. English: We use english language here in the forum, please post your code in english. The solution you are looking for is the built in functions for your indicator, you can use them as a template and fill in the blanks as you go. Do not use Chat GPT or online generators. The code has many mistakes, it is not hand written