import numpy as np
import pandas as pd

def boll(prz:'arr', N = 20, offset = 2, shft = True):
    df = pd.DataFrame()
    df['prz'] = prz
    df['mid'] = df.prz.rolling(N).mean().shift(int(shft))
    df['std'] = df.prz.rolling(N).std().shift(int(shft))
    df['upper'] = df['mid'] + offset * df['std']
    df['lower'] = df['mid'] - offset * df['std']
    return {c:df[c].values for c in df}

def don(prz:'arr', N = 20, shft = True):    
    df = pd.DataFrame()
    df['prz'] = prz
    df['upper'] = df.prz.rolling(N).max().shift(int(shft))
    df['lower'] = df.prz.rolling(N).min().shift(int(shft))
    df['mid'] = (df.upper + df.lower)/2
    return {c:df[c].values for c in df}

def ma(prz:'arr', *args, shft = True):    
    s = pd.Series(prz)
    d = {'ma{}'.format(i): s.rolling(i).mean().shift(int(shft)).values for i in args}
    d['prz'] = prz
    return d