This is an oscillator made of candlesticks informations. It were described by Perry Kaufman himself. This simply calculates the momentum of the closes above the opens versus the closes below the opens. The theory is that as prices move up, closing prices will be higher than opening prices and vice-versa for down. If this oscillator is above 70 then the whites
(Candle-sticks) dominate and below 30 the blacks are dominant.
// Parameters :
// lookback = 14
// smoothP = 3
Bup = 0
Bdn = 0
FOR i = 0 TO lookback DO
B = Close[i]-Open[i]
if(B>0) THEN
Bup = Bup + 1
ELSE
Bdn = Bdn + 1
ENDIF
NEXT
BM = (Bup/(Bup+Bdn))*100
MABM = average[smoothP](BM)
RETURN MABM as "Body momentum", 30 as "black dominant" , 70 as "white dominant"