Troubles with division

 

Hi! 

I Have a double number (1.0) and I try to divide by a double variable that is the rest of another two variables.

Any one of this variables is a the number of a senkou Span A and Senkou Span B indicator ( From Ichimoku).

When I show the numbers using comment, all goes well. But when I try to divide

 

  double SenkouSpanA= iIchimoku(NULL,0,TenkansenPeriod,KijunsenPeriod,SenkouSpanPeriod,MODE_SENKOUSPANA,i);

  double SenkouSpanB= iIchimoku(NULL,0,TenkansenPeriod,KijunsenPeriod,SenkouSpanPeriod,MODE_SENKOUSPANB,i);

  double Intervalo= SenkouSpanA-SenkouSpanB;

  double Uno=1.0;

  double divintervalo= Uno /Intervalo;


This change the value of the rest, and doesn't do the division at all. 

I don't know what happen.


Do you know what could happen?


Thanks in Advance!

 

Could it be a division by 0? Have you checked the Expert-log?

Do you display all your variables on the chart with comment?

To see better the values of the variables devide each of your S.SpanA and S.SpanB by _Points.