View Single Post
  #28 (permalink)  
Old 06-18-2007, 12:34 PM
dvarrin dvarrin is offline
Senior Member
 
Join Date: May 2007
Posts: 150
dvarrin is on a distinguished road
Hi,

Is anybody interested in the coding of a divergence indicator ?

I would like to have an indicator which analyses the price and an indicator like MACD or Stochastic and returns 1 if bullish divergence, 0 if nothing and -1if bearish divergence (for example). I want to detect the case when the price is making a new high/low, but the indicator is not.

Also, as soon as the indicator has gone to the other side (for example if Stochastic was overbought and showed a bearish divergence, and then went down crossing 50 or reached the oversold level) the divergence indicator should not say that there is still a bearish divergence.

How could I code it? Using zigzag?

What are the value returned by a zigzag indicator at a given time? Does it return the last pick/though value?

Cheers,
Daniel
Reply With Quote