I get the same Problem(Open parenthesis expected) in the if(impulseSize <= Point * 10) Line and I tried everthing but the same Problem occurs the whole time. Can somebody Help me?

 
 #property script_show_inputs


struct Swing
{
   int    index;
   double price;
};

input int    ZigDepth        = 4;
input int    ZigDeviation    = 1;
input int    ZigBackstep     = 1;
input double FibLowPct       = 61.8;
input double FibHighPct      = 100.0;
input int    NextBarsToCheck = 200;
input int    MaxHistoryBars  = 2000;
input bool   DrawOnChart     = true;

void OnStart()
{
   int handle = iCustom(_Symbol, _Period, "ZigZag", ZigDepth, ZigDeviation, ZigBackstep);
   if(handle == INVALID_HANDLE)
   {
      Print("Fehler: ZigZag handle konnte nicht erstellt werden.");
      return;
   }

   int bars_total = MathMin(Bars(_Symbol, _Period), MaxHistoryBars);
   if(bars_total < 10)
   {
      Print("Zu wenige Bars: ", bars_total);
      IndicatorRelease(handle);
      return;
   }

   double zz[];
   ArraySetAsSeries(zz, true);
   if(CopyBuffer(handle, 0, 0, bars_total, zz) <= 0)
   {
      Print("Error by copy");
      IndicatorRelease(handle);
      return;
   }

   Swing swings[];
   ArrayResize(swings, 0);
   for(int barIdx = bars_total - 1; barIdx >= 0; barIdx--)
   {
      if(zz[barIdx] != 0.0)
      {
         int newSize = ArraySize(swings) + 1;
         ArrayResize(swings, newSize);
         swings[newSize-1].index = barIdx;
         swings[newSize-1].price = zz[barIdx];
      }
   }

   int swingCount = ArraySize(swings);
   if(swingCount < 3)
   {
      Print("Not found enough Swing Points: ", swingCount);
      IndicatorRelease(handle);
      return;
   }

   int foundCases = 0;
   string out = "";
   out += StringFormat("ZigZag Fib-Analyse (%s %s)\n", _Symbol, EnumToString(_Period));
   out += StringFormat("Fib-square: %.2f%% - %.2f%% | NextBars: %d\n\n", FibLowPct, FibHighPct, NextBarsToCheck);

   for(int swingIdx = 2; swingIdx < swingCount; swingIdx++)
   {
      int idxA = swings[swingIdx-2].index;
      int idxB = swings[swingIdx-1].index;
      int idxC = swings[swingIdx].index;

      double priceA = swings[swingIdx-2].price;
      double priceB = swings[swingIdx-1].price;
      double priceC = swings[swingIdx].price;

      double impulseSize = MathAbs(priceB - priceA);
      if(impulseSize <= Point * 10)
      {
         continue;
      }

      double correctionSize = MathAbs(priceC - priceB);
      double corrPct = (correctionSize / impulseSize) * 100.0;

      if(corrPct >= FibLowPct && corrPct <= FibHighPct)
      {
         foundCases++;
         int upCount = 0;
         int downCount = 0;
         int available = 0;

         for(int k = 1; k <= NextBarsToCheck; k++)
         {
            int barIndex = idxC - k;
            if(barIndex < 0) break;
            available++;

            double openP = iOpen(_Symbol, _Period, barIndex);
            double closeP = iClose(_Symbol, _Period, barIndex);

            if(closeP > openP) upCount++;
            else if(closeP < openP) downCount++;
         }

         string dir = (priceB > priceA) ? "Impuls-Up" : "Impuls-Down";
         string line = StringFormat("Case %d: %s | Corr=%.2f%% | Up=%d Down=%d (avail=%d)",
                                    foundCases, dir, corrPct, upCount, downCount, available);

         if(StringLen(out) + StringLen(line) < 1500)
            out += line + "\n";
         else
            out += "... weitere Fälle ausgelassen\n";

         if(DrawOnChart)
         {
            string txt = StringFormat("Case %d\n%s\nCorr: %.2f%%\nUp:%d Down:%d", foundCases, dir, corrPct, upCount, downCount);
            datetime t = iTime(_Symbol, _Period, idxC);
            string name = "ZZCase_" + IntegerToString(foundCases) + "_" + IntegerToString(idxC);
            if(ObjectFind(0, name) != -1) ObjectDelete(0, name);
            if(ObjectCreate(0, name, OBJ_LABEL, 0, t, priceC))
            {
               ObjectSetString(0, name, OBJPROP_TEXT, txt);
               ObjectSetInteger(0, name, OBJPROP_COLOR, clrWhite);
               ObjectSetInteger(0, name, OBJPROP_FONTSIZE, 9);
               ObjectSetInteger(0, name, OBJPROP_SELECTABLE, false);
               ObjectSetInteger(0, name, OBJPROP_HIDDEN, false);
            }
         }
      }
   }

   if(foundCases == 0)
   {
      out += "No Errors found in the Fib.\n";
      Print("No Errors found in the Fib.");
   }
   else
   {
      out += StringFormat("\nReady found Cases: %d\n", foundCases);
      PrintFormat("Ready found Casese: %d", foundCases);
   }

   Comment(out);
   IndicatorRelease(handle);
} 
 

Please  use the CODE button (Alt-S) when inserting code.

Code button in editor

 
  1. Use the code button.
  2. Point is not a predefined variable.
 
Oh, I did not think of that thanks, it works now!