I am trying to calculate the angle of a few lines. I got the calculations correct but for some reason I get divide by zero errors can anyone tell me why
here is the code....
here is the code....
PHP Code
HighStartPoint = iHigh(Symbol(),0,VectorPer);
PreviousBarHigh = iHigh(Symbol(),0,SIGNALCANDLE+1);
HighestPoint = High[iHighest(Symbol(),0,MODE_HIGH,VectorPer,SIGNALCANDLE+1)];
HighestAngle = MathArctan(MathTan(((HighStartPoint-HighestPoint)/(WindowPriceMax()- WindowPriceMin()))/((VectorPer-SIGNALCANDLE+1)/WindowBarsPerChart())))*180/3.14;
PreviousHighBarAngle = MathArctan(MathTan(((HighStartPoint-PreviousBarHigh)/(WindowPriceMax()- WindowPriceMin()))/((VectorPer-SIGNALCANDLE+1)/WindowBarsPerChart())))*180/3.14;
pHighStartPoint = iHigh(Symbol(),0,VectorPer+1);
pPreviousBarHigh = iHigh(Symbol(),0,SIGNALCANDLE+2);
pHighestPoint = High[iHighest(Symbol(),0,MODE_HIGH,VectorPer+1,SIGNALCANDLE+2)];
pHighestAngle = MathArctan(MathTan(((pHighStartPoint-pHighestPoint)/(WindowPriceMax()- WindowPriceMin()))/((VectorPer+1-SIGNALCANDLE+2)/WindowBarsPerChart())))*180/3.14;
pPreviousHighBarAngle = MathArctan(MathTan(((pHighStartPoint-pPreviousBarHigh)/(WindowPriceMax()- WindowPriceMin()))/((VectorPer+1-SIGNALCANDLE+2)/WindowBarsPerChart())))*180/3.14;
Keep it simple stoopid....