Help with iAlligator indicator

 

All,

I need some help with the coding iAlligator indicator

   double jaw= iAlligator( NULL,0,J_Period,J_Shift,T_Period,T_Shift,L_Period,L_Shift,MODE_SMMA,PRICE_CLOSE,MODE_GATORJAW,1);

   double teeth= iAlligator( NULL,0,J_Period,J_Shift,T_Period,T_Shift,L_Period,L_Shift,MODE_SMMA,PRICE_CLOSE,MODE_GATORTEETH,1);

I need to know the very first time the jaw and teeth crossed. 

If I say if teeth > jaw, this doesn't give me the exact candle that the jaw crossed teeth.

I need to know the exact time the jaw and teeth crossed. If they crossed 10 candles back and and if teeth > jaw, I don't want to do anything.

I hope I explained it clear as mud :)



 
don per:

If I say if teeth > jaw, this doesn't give me the exact candle that the jaw crossed teeth.

you are checking the condition (teeth > jaw) , for bar #1, the last closed bar. that is just comparing the values, you're not looking for a cross.
a cross between A and B lines at the moment of T is like this : A was below B before T, and A is above B after T. (or vice versa)

if you need the moment of last cross , you need to check the cross condition between any two bar, starting from the current bar, going back in time.

 
Code2219 or probably 2319:

you are checking the condition (teeth > jaw) , for bar #1, the last closed bar. that is just comparing the values, you're not looking for a cross.
a cross between A and B lines at the moment of T is like this : A was below B before T, and A is above B after T. (or vice versa)

if you need the moment of last cross , you need to check the cross condition between any two bar, starting from the current bar, going back in time.

Thanks a lot for the help. Much appreciated.