|
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
|