Very simple script.
Code:
# Miesal Indicator
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/Tdp90Pee/
declare lower;
input length = 10;
input src = close;
def Mi = sum(if(src > src[1], +1, if(src < src[1], -1, 0)), length);
plot line = Mi;
line.AssignValueColor(if line >= 0 then color.green else color.red);