[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Formula to identify a divergence with an indicator



PureBytes Links

Trading Reference Links

I would like to make an explorer with Metastock getting divergence between a
chart price and an indicator, like MACD.

I would like to detect all securities where this divergence appeared in the
last 3 days.

I wonder how to do this in Metastock.

My problems are  :

1) How to identify the latest valley on price (number of bars since)

2) How to identify the valley before the latest one on price (number of bars
since).

3) Then I would apply the ROC % on both price and indicators and deduce
diffrent cases to see if there is a positive or negative divergence of more
than x %.

Has anybody done this before and has a formula for this ?

Thank you

Laurent Gittler