Divergence Colour Bar

 

Hi,

I am very much new to metatrader coding can experts out here help me to design metrader indicator based on metastock code on bar. Metastock formula are mention below

Bullish divergence bar(blue colour)

L < Ref(L,-1) AND Ref(L,-1)< Ref(L,-2) AND L ((HIGH + LOW)/2)

{L = CURRENT LOW , REF(L,-1) = PREVIOUS LOW, REF(L,-2) =Previous Low of REF(L,-1)}

Bearish divergence bar(red colour)

H > Ref(H,-1) AND Ref(H,-1) > Ref(H,-2)AND H > Ref(H,-2) AND CLOSE < ((HIGH + LOW)/2)

Kindly help

Thank u all

Regards

krishna

Files:
divergence.jpg  83 kb
Reason: