Any syntax errors? [SOLVED]

 
 //Indicator Buffer 11 Cross_Top_Line TP2

               if(High[i] >Buffer2[i]&& High[i+1]<Buffer2[i+1])
                 {
                  Buffer11[i] = Buffer1[i];
                  ObjectSetText("TP2Result",NormalizeDouble(Buffer1[i],MarketInfo(Symbol(),MODE_DIGITS)),9,"Arial",clrHoneydew);
                  ObjectSetText("PointsTargetTP2",MathRound((Buffer2[i]-Buffer1[i])*100000)+"p",10,"Arial Black",BottomLineColor);
                  ObjectSetText("%TargetTP2",StringConcatenate("  TP2:  ",NormalizeDouble(iATR(_Symbol,_Period,6,i)/(Buffer2[i]-Buffer1[i])*100,2),"%"),9,"Arial",TPSELLColor);         
                 }
               else
                 {
                  Buffer11[i] = EMPTY_VALUE;
                 }

Hello partners. I am trying to add a graphic object, and when I add the following line, the indicator stops working.

There are no errors, simply adding it to the chart clears the indicator. If I remove that line, everything is fine. Do you see any errors that I miss right now?

Thank you very much as always!


Cordially, Enrique Enguix

 
Enrique Enguix Vino:

Hello partners. I am trying to add a graphic object, and when I add the following line, the indicator stops working.

There are no errors, simply adding it to the chart clears the indicator. If I remove that line, everything is fine. Do you see any errors that I miss right now?

  1. No following line posted — I assume the one highlighted above.
  2. No syntax errors — because it compiles.
  3. Look in the journal tab and see the divide by zero runtime error.
 
William Roeder:
  1. No following line posted — I assume the one highlighted above.
  2. No syntax errors — because it compiles.
  3. Look in the journal tab and see the divide by zero runtime error.

Thank you very much for your answer. Indeed the error is where you indicated in point 3, although I am not able to solve it. It is also a good starting point to find a solution, thank you very much