Exemplo n.º 1
0
def get_basic_renko(stock_df, period):
    "function to convert ohlc data into renko bricks"
    df = stock_df.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:,[0,1,2,3,4,5]]
    df.columns = ["date","open","high","low","close","volume"]
    df2 = Renko(df)
    # completely not sure about this renko brick calculation
    atr_df = get_ATR_column_for_stock(stock_df, 120, False)
    df2.brick_size = max(0.5, round(atr_df["ATR"][-1],0))
    print(f'brick size: {df2.brick_size}')
    renko_df = df2.get_ohlc_data()
    renko_df["bar_num"] = np.where(renko_df["uptrend"]==True,1,np.where(renko_df["uptrend"]==False,-1,0))
    for i in range(1,len(renko_df["bar_num"])):
        if renko_df["bar_num"][i]>0 and renko_df["bar_num"][i-1]>0:
            renko_df["bar_num"][i]+=renko_df["bar_num"][i-1]
        elif renko_df["bar_num"][i]<0 and renko_df["bar_num"][i-1]<0:
            renko_df["bar_num"][i]+=renko_df["bar_num"][i-1]
    renko_df.drop_duplicates(subset="date",keep="last",inplace=True)
    renko_df.columns = ["Date","open","high","low","close","uptrend","bar_num"]
    df_to_merge = stock_df.copy()
    df_to_merge["Date"] = df_to_merge.index
    df_to_merge = df_to_merge.merge(renko_df.loc[:,["Date","bar_num"]],how="outer",on="Date")
    df_to_merge.set_index('Date', inplace=True)
    df_to_merge["bar_num"].fillna(method='ffill',inplace=True)
    return df_to_merge['bar_num']
Exemplo n.º 2
0
 def renko_DF(DF):
   "function to convert ohlc data into renko bricks"
   try:
       print("Nishant")
       df = DF.copy()
       df.reset_index(inplace=True)
       df = df.iloc[:,[0,1,2,3,4,5]]
       df.columns = ["date","open","high","low","close","volume"]
       
       df2 = Renko(df)
       
       # TODO: Investigate what brick size is good
       df2.brick_size = max(5, round(Indicator.ATR(DF, 14)["ATR"][-1], 0))
       print("Brick size: ", df2.brick_size)
       renko_df = df2.get_ohlc_data()
       renko_df["bar_num"] = np.where(renko_df["uptrend"] == True, 1, np.where(renko_df["uptrend"] == False, -1, 0))
       for i in range(1,len(renko_df["bar_num"])):
         if renko_df["bar_num"][i] > 0 and renko_df["bar_num"][i-1] > 0:
           renko_df["bar_num"][i] += renko_df["bar_num"][i-1]
         elif renko_df["bar_num"][i] < 0 and renko_df["bar_num"][i-1] < 0:
           renko_df["bar_num"][i] += renko_df["bar_num"][i-1]
       renko_df.drop_duplicates(subset="date",keep="last", inplace=True)
       return renko_df
   except :
       print("Failed to get renko")
Exemplo n.º 3
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:, [0, 1, 2, 3, 4, 5]]
    df.columns = ["date", "open", "high", "low", "close", "volume"]
    df2 = Renko(df)
    df2.brick_size = max(0.5, round(ATR(DF, 120)["ATR"][-1], 0))
    df2.chart_type = Renko.PERIOD_CLOSE
    renko_df = df2.get_ohlc_data()
    renko_df["bar_num"] = np.where(
        renko_df["uptrend"] == True, 1,
        np.where(renko_df["uptrend"] == False, -1, 0)
    )  #Add a column where put 1 and -1 instead of the True/False we had in the uptrend column
    for i in range(
            1, len(renko_df["bar_num"])
    ):  #Counts the amount of blocks generated in a trend Ex.: If we have 1,1,1,1,-1,-1,1,1... --> 1,2,3,4,-1,-2,1,2...
        if renko_df["bar_num"][i] > 0 and renko_df["bar_num"][i - 1] > 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
        elif renko_df["bar_num"][i] < 0 and renko_df["bar_num"][i - 1] < 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
    renko_df.drop_duplicates(
        subset="date", keep="last", inplace=True
    )  #Some of the indexes are repeated (for example if there is a spike in a 5 min period and 2 ranko blocks are generated). Drop the duplicate indexes (same 5 min period), but keep the last
    return renko_df
Exemplo n.º 4
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:, [0, 1, 2, 3, 4, 5]]
    df.columns = ["date", "open", "high", "low", "close", "volume"]
    df2 = Renko(df)
    df2.brick_size = max(0.5, round(ATR(DF, 120)["ATR"][-1], 0))  #120 days ATR
    renko_df = df2.get_ohlc_data()
    #button, if its uptrend then 1, if downtrend then -1
    renko_df["bar_num"] = np.where(
        renko_df["uptrend"] == True, 1,
        np.where(renko_df["uptrend"] == False, -1, 0))
    #adding the bar_num to the prev number if they are in the same direction
    #if bar_num[i] = 1 && bar_num[i-1] = 1, add them
    #if they are negative subtract, -1 -- 1 = 0
    for i in range(1, len(renko_df["bar_num"])):
        if renko_df["bar_num"][i] > 0 and renko_df["bar_num"][i - 1] > 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
        elif renko_df["bar_num"][i] < 0 and renko_df["bar_num"][i - 1] < 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
    renko_df.drop_duplicates(subset="date", keep="last", inplace=True)
    #this removes all the duplicate values, if there are duplicate roll indicies,
    #and keep the prev number (for spikes)
    return renko_df
def renko_df(df_raw, ATR):
    df_raw = df_raw[-500:]
    df_raw.reset_index(inplace=True)

    renko = Renko(df_raw[['date', 'open', 'high', 'low', 'close', 'volume']])

    renko.brick_size = ATR

    df = renko.get_ohlc_data()
    df = df.copy()
    df['bar_num'] = np.where(df['uptrend'] == True, 1,
                             np.where(df['uptrend'] == False, -1, 0))

    for i in range(1, len(df["bar_num"])):
        if df["bar_num"][i] > 0 and df["bar_num"][i - 1] > 0:
            df["bar_num"][i] += df["bar_num"][i - 1]
        elif df["bar_num"][i] < 0 and df["bar_num"][i - 1] < 0:
            df["bar_num"][i] += df["bar_num"][i - 1]
    df.drop_duplicates(subset="date", keep="last", inplace=True)
    df_raw = df_raw.merge(df.loc[:, ["date", "bar_num"]],
                          how="outer",
                          on="date")
    df_raw["bar_num"].fillna(method='ffill', inplace=True)
    df_raw['OBV'] = ta.OBV(df_raw['close'], df_raw['volume'])
    df_raw["obv_slope"] = slope(df_raw['OBV'], 5)
    return df_raw
Exemplo n.º 6
0
def renko(df_original):
    df = df_original.copy()
    df.reset_index(inplace=True) # convert index to column
    df.drop(['Close'], axis=1)
    df.columns  = ['date', 'open', 'high', 'low', 'close', 'volume'] # change column names
    renko_df = Renko(df)
    renko_df.brick_size = int(round(atr(df_original, 14)['atr'][-1], 0))
    return renko_df.get_ohlc_data()
Exemplo n.º 7
0
def Renko_trend(DF, n):
    df8 = DF.copy()
    df8 = df8.reset_index()
    df8 = df8.iloc[:, [0, 1, 2, 3, 4]]
    df8.columns = ['date', 'open', 'high', 'low', 'close']
    renko_df = Renko(df8)
    x = statistics.mean(((ATR(ohclv_data, 200)).iloc[:, -1].dropna()))
    renko_df.brick_size = x
    df8 = renko_df.get_ohlc_data()
    return df8
Exemplo n.º 8
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:,[0,1,2,3,5,6]]
    df.rename(columns = {"Date" : "date", "High" : "high","Low" : "low", "Open" : "open","Adj Close" : "close", "Volume" : "volume"}, inplace = True)
    df2 = Renko(df)
    df2.brick_size = round(ATR(DF,120)["ATR"][-1],0)
    renko_df = df2.get_ohlc_data() #if using older version of the library please use get_bricks() instead
    return renko_df
Exemplo n.º 9
0
def renko_DF(DF):
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:,[0,1,2,3,5,6]]
    df.rename(columns = {"Date" : "date", "High" : "high","Low" : "low", "Open" :
                         "open","Adj Close" : "close", "Volume" : "volume"}, 
              inplace = True)
    df2 = Renko(df)
    df2.brick_size = round(ATR(DF,120)["ATR"][-1],0)
    renko_df = df2.get_ohlc_data() 
    return renko_df
Exemplo n.º 10
0
def renko_df(dataframe):
    """function to convert ohlc data into renko bricks"""
    df_ = dataframe.copy()
    df_.reset_index(inplace=True)
    df_ = df_.iloc[:, [0, 1, 2, 3, 5, 6]]
    df_.rename(columns={"Date": "date", "High": "high", "Low": "low", "Open": "open", "Adj Close": "close",
                        "Volume": "volume"}, inplace=True)
    df2 = Renko(df_)
    df2.brick_size = round(atr(dataframe, 120)["ATR"][-1], 0)
    # renko_df = df2.get_bricks() # if get_bricks() does not work try using get_ohlc_data() instead
    RENKO_df = df2.get_ohlc_data()
    return RENKO_df
Exemplo n.º 11
0
def renko_DF(df_):
    """ converts ohlc data into renko bricks
    must include the following columns: 'date' 'open' 'high' 'low' 'close'
    """
    df = copy.deepcopy(df_)
    if 'adj_close' in df.columns:
        df['close'] = df['adj_close']

    df.reset_index(inplace=True)
    df2 = Renko(df)
    df2.brick_size = round(ATR(df_, 120)['ATR'][-1], 0)

    renko_df = df2.get_ohlc_data()
    return renko_df
 def __setIndicator(self, a_df: pandas.DataFrame):
     """function to convert ohlc data into renko bricks"""
     df: pandas.DataFrame = a_df.copy()
     df.reset_index(inplace=True)
     df = df.iloc[:, [0, 1, 2, 3, 5, 6]]
     df.rename(columns={"Date": "date", "High": "high", "Low": "low", "Open": "open", "Adj Close": "close",
                        "Volume": "volume"}, inplace=True)
     ren = Renko(df)
     ren.brick_size = round(self.__getAvgTrueRange(a_df.copy(), 120)["AvgTrueRate"][-1], 0)
     # if get_bricks() does not work try using get_ohlc_data() instead
     # df2.get_bricks() error => using get_ohlc_data()
     # renkoDataFrame = df2.get_bricks()
     renDf: pandas.DataFrame = ren.get_ohlc_data()
     self.IndicatorDf = renDf
Exemplo n.º 13
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:, [0, 1, 2, 3, 6, 5]]
    df.columns = ["date", "open", "high", "low", "close", "volume"]
    df2 = Renko(df)
    df2.brick_size = round(
        ATR(DF, 120)["ATR"][-1], 0
    )  #We just want the last number of the column. We use ATR as the brick size in here but it can also be fix.
    df2.chart_type = Renko.PERIOD_CLOSE  #Renko box calcuation based on periodic close
    #df2.chart_type = Renko.PRICE_MOVEMENT #Renko box calcuation based on price movement
    renko_df = df2.get_ohlc_data(
    )  #Adds a column to df called "uptrend" with boolean values depending on whether the ranko chart goes up or down
    return renko_df
Exemplo n.º 14
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:,[0,1,2,3,4,5]]
    df.columns = ["date","open","high","low","close","volume"]
    df2 = Renko(df)
    df2.brick_size = max(0.5,round(ATR(DF,120)["ATR"][-1],0))
    renko_df = df2.get_ohlc_data()
    renko_df["bar_num"] = np.where(renko_df["uptrend"]==True,1,np.where(renko_df["uptrend"]==False,-1,0))
    for i in range(1,len(renko_df["bar_num"])):
        if renko_df["bar_num"][i]>0 and renko_df["bar_num"][i-1]>0:
            renko_df["bar_num"][i]+=renko_df["bar_num"][i-1]
        elif renko_df["bar_num"][i]<0 and renko_df["bar_num"][i-1]<0:
            renko_df["bar_num"][i]+=renko_df["bar_num"][i-1]
    renko_df.drop_duplicates(subset="date",keep="last",inplace=True)
    return renko_df
Exemplo n.º 15
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()
    df.reset_index(inplace=True)
    df2 = Renko(df)
    atr_df = ATR(DF, 120)
    #print(atr_df["ATR"])
    df2.brick_size = max(0.5, round(atr_df["ATR"].iloc[-1], 0))
    renko_df = df2.get_ohlc_data()
    renko_df["bar_num"] = np.where(
        renko_df["uptrend"] == True, 1,
        np.where(renko_df["uptrend"] == False, -1, 0))
    for i in range(1, len(renko_df["bar_num"])):
        if renko_df["bar_num"][i] > 0 and renko_df["bar_num"][i - 1] > 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
        elif renko_df["bar_num"][i] < 0 and renko_df["bar_num"][i - 1] < 0:
            renko_df["bar_num"][i] += renko_df["bar_num"][i - 1]
    renko_df.drop_duplicates(subset="date", keep="last", inplace=True)
    return renko_df
Exemplo n.º 16
0
def renko_DF(DF):
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:, [0, 1, 2, 3, 4, 5]]  #different from 40mycode
    df.columns = ['date', 'open', 'high', 'low', 'close', 'volume']
    df2 = Renko(df)
    df2.brick_size = round(ATR(DF, 120)['ATR'][-1],
                           4)  #different from 40mycode
    renko_df = df2.get_ohlc_data()
    renko_df['bar_num'] = np.where(
        renko_df['uptrend'] == True, 1,
        np.where(renko_df['uptrend'] == False, -1, 0))
    for i in range(1, len(renko_df['bar_num'])):
        if renko_df['bar_num'][i] > 0 and renko_df['bar_num'][i - 1] > 0:
            renko_df['bar_num'][i] += renko_df['bar_num'][i - 1]
        elif renko_df['bar_num'][i] < 0 and renko_df['bar_num'][i - 1] < 0:
            renko_df['bar_num'][i] += renko_df['bar_num'][i - 1]
    renko_df.drop_duplicates(subset='date', keep='last', inplace=True)
    return renko_df
Exemplo n.º 17
0
def renko_dataframe(DF):
    df = DF.copy()

    df.reset_index(inplace=True)
    #make index as a seperate column, convert index to column
    #adding this allows the date to be its own column

    #For renko, all we need to look at is a couple rows
    df = df.iloc[:, [0, 1, 2, 3, 5, 6]]
    #only include columns 0,1,2,3,5,6

    df.columns = ["date", "open", "high", "low", "close", "volume"]
    #simply rename the columns, respectively

    renko_df = Renko(df)
    renko_df.brick_size = round(ATR(
        df, 120)["ATR"][-1])  #use atr to assign bricksize
    #-1 takes the latest point/last point
    df2 = renko_df.get_ohlc_data()
Exemplo n.º 18
0
def renko_DF(DF):
    "function to convert ohlc data into renko bricks"
    df = DF.copy()  # copio el dataframe
    df.reset_index(
        inplace=True
    )  # pongo un indice secuencial y la fecha pasa a la primera columna
    df = df.iloc[:, [0, 1, 2, 3, 5, 6]]  # Quito la colunna 4
    df.rename(columns={
        "Date": "date",
        "High": "high",
        "Low": "low",
        "Open": "open",
        "Adj Close": "close",
        "Volume": "volume"
    },
              inplace=True)
    df2 = Renko(df)
    df2.brick_size = round(
        ATR(DF, 120)["ATR"][-1],
        0)  #marcamos el incremento basado en ATR para pintar un brick
    renko_df = df2.get_ohlc_data(
    )  #if using older version of the library please use get_bricks() instead
    return renko_df
Exemplo n.º 19
0
def renko(dataframe):
    """atr
    A Renko chart is built using price movement without standardized time intervals. A new brick is created when the
    price moves a specified price amount. Each block is positioned at a 45-degree angle (up or down) to the prior brick.
    An up brick is typically colored white or green, while a down brick is typically colored black or red. Brick size
    is determined by ATR.

    Args:
        dataframe (pd.Dataframe): Dataframe with ohlcv data.
    Returns:
        pd.Dataframe: Frame with renko col appended.
    """
    df = dataframe.copy()
    brick_size = max(0.5, round(atr(df, 120)['atr'][-1], 0))

    df.reset_index(inplace=True)

    df_renko = Renko(col_rename(df))
    df_renko.brick_size = brick_size

    df_ohlc_renko = df_renko.get_ohlc_data()

    df_ohlc_renko["renko_bar_num"] = np.where(df_ohlc_renko["uptrend"], 1,
                                        np.where(df_ohlc_renko["uptrend"] == False, -1, 0))

    for i in range(1, len(df_ohlc_renko["renko_bar_num"])):
        if df_ohlc_renko["renko_bar_num"][i] > 0 and df_ohlc_renko["renko_bar_num"][i-1] > 0:
            df_ohlc_renko["renko_bar_num"][i] += df_ohlc_renko["renko_bar_num"][i-1]
        elif df_ohlc_renko["renko_bar_num"][i] < 0 and df_ohlc_renko["renko_bar_num"][i-1] < 0:
            df_ohlc_renko["renko_bar_num"][i] += df_ohlc_renko["renko_bar_num"][i-1]

    df_ohlc_renko.drop_duplicates(subset="date", keep="last", inplace=True)
    df_merged = df.merge(df_ohlc_renko.loc[:, ["date", "renko_bar_num"]], how="outer", on="date")
    df_merged["renko_bar_num"].fillna(method='ffill', inplace=True)
    df_merged.set_index('date', inplace=True)

    return df_merged[['renko_bar_num']]
def renko(Df):
    '''
    Converts ohlc data to Renko bricks
    
    Parameters
    ==========
    Df: pandas.DataFrame(): enter a regular OHLCv dataframe with pandas.Date index
    
    Returns
    =======
    Renko_df: pandas.DataFrame(): Renko bric indicators
    '''
    df = Df.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:, [0, 1, 2, 3, 4, 5]]
    df.rename(columns={
        'Date': 'date',
        'Open': 'open',
        'High': 'high',
        'Low': 'low',
        'Adj Close': 'close',
        'Volume': 'volume'
    },
              inplace=True)
    df2 = Renko(df)
    df2.brick_size = max(0.5, round(ATR(Df, 120)['ATR'][-1], 0))
    renko_df = df2.get_ohlc_data()
    renko_df['bar_num'] = np.where(
        renko_df['uptrend'] == True, 1,
        np.where(renko_df['uptrend'] == False, -1, 0))
    for i in range(1, len(renko_df['bar_num'])):
        if renko_df['bar_num'][i] > 0 and renko_df['bar_num'][i - 1] > 0:
            renko_df['bar_num'][i] += renko_df['bar_num'][i - 1]
        elif renko_df['bar_num'][i] < 0 and renko_df['bar_num'][i - 1] < 0:
            renko_df['bar_num'][i] += renko_df['bar_num'][i - 1]
    renko_df.drop_duplicates(subset='date', keep='last', inplace=True)
    return renko_df
Exemplo n.º 21
0
class RENKOIND(Indicator):
    def __init__(self, df=None, n=120):
        super().__init__()
        self.collapse = False

        self.n = n

        # Set dataframe keys
        self.low_key = None
        self.high_key = None
        self.open_key = None
        self.date_key = "Date"

        self.prices_key = None

        self.brick_size = None

        self.df_renko_input = None
        self.df_renko = None
        self.renko_data = None

        if df is not None:
            self.set_input_data(df)

    def set_input_data(self, df):
        super().set_input_data(df)

        self.low_key = Constants.get_low_key()
        self.high_key = Constants.get_high_key()
        self.open_key = Constants.get_open_key()

        # Set dataframe keys
        prices_temp = pd.DataFrame()

        df_list = []
        for ticker in self.tickers:
            if ticker in df:
                df_temp = df[ticker].loc[:, [
                    self.high_key, self.low_key, self.open_key, self.prices_key
                ]]

                df_list.append(
                    pd.concat([df_temp, prices_temp], axis=1, keys=[ticker]))

        df_indicator = pd.concat(df_list, axis=1)

        self.df = df_indicator.copy()

        prices_temp = pd.DataFrame()

        df_list = []
        for ticker in self.tickers:
            df_temp = df[ticker]
            df_temp.reset_index(level=0, inplace=True)
            df_temp = df_temp.loc[:, [
                self.date_key, self.high_key, self.low_key, self.open_key,
                self.prices_key
            ]]  # TODO: Is this rebundant???

            df_temp.rename(columns={
                "Date": "date",
                self.high_key: "high",
                self.low_key: "low",
                self.open_key: "open",
                self.prices_key: "close"
            },
                           inplace=True)

            df_list.append(
                pd.concat([df_temp, prices_temp], axis=1, keys=[ticker]))

        df_indicator = pd.concat(df_list, axis=1)

        self.df_renko_input = df_indicator.copy()

    def calculate(self):
        """function to convert ohlc data into renko bricks"""

        super().calculate()

        df_result = []

        for ticker in self.tickers:

            df_data_atr = self.df[[ticker]].copy()
            atr = ATR(df_data_atr, 120)
            df_atr = atr.calculate()

            df_data = self.df_renko_input[ticker].copy()

            self.df_renko = Renko(df_data)

            atr_key = Constants.get_key("ATR")

            self.df_renko.brick_size = round(df_atr[ticker][atr_key][-1], 0)
            self.brick_size = self.df_renko.brick_size

            # renko_df = df2.get_bricks() #if get_bricks() does not work try using get_ohlc_data() instead
            self.renko_data = self.df_renko.get_ohlc_data()
            df_result.append(self.renko_data)

        self.df = pd.concat(df_result, axis=1, keys=self.tickers)

        return self.df
Exemplo n.º 22
0
import pandas_datareader as pdr
Exemplo n.º 23
0
def ATR(DF,n=20):
    temp = DF.copy()
    temp["H-L"] = abs(temp["High"] - temp["Low"]) 
    temp["H-PC"] = abs(temp["High"] - temp["Adj Close"].shift(1)) # high - previous day close
    temp["L-PC"] = abs(temp["Low"] - temp["Adj Close"].shift(1))
    temp["TR"] = temp[["H-L", "H-PC", "L-PC"]].max(axis=1, skipna = False)
    temp["ATR"] = temp["TR"].rolling(n).mean()
    
    return_val = temp.drop(["H-L","H-PC","L-PC"], axis=1)
    return return_val

df.reset_index(inplace = True)
df = df.drop(["Close"], axis=1)
df.columns = ["date", "high", "low", "open", "volume", "close"]

renko_df = Renko(df)
renko_df.brick_size = 10
renko_df.chart_type = Renko.PERIOD_CLOSE

df2 = renko_df.get_ohlc_data()
df2.set_index("date", inplace = True)

def renko_DF(DF):
    df = DF.copy()
    df.reset_index(inplace=True)
    df = df.iloc[:,[0,1,2,3,4,5]]
    df.columns = ["date", "low", "high", "open", "close", "volume"]

    df2 = Renko(df)
    df2.brick_size = max(0.5, round(ATR(DF,120)["ATR"][-1],0))
Exemplo n.º 24
0
def test_renko():
    renko = Renko(df)
    renko.brick_size = 4
    cdf = renko.get_ohlc_data()
    assert cdf['close'].equals(rdf['close'])
Exemplo n.º 25
0
def renko():
    renko_data = Renko(transform_data(SetUp.data))
    renko_data.brick_size = round(atr(SetUp.data, 120)['ATR'][-1], 0)
    renko_df = renko_data.get_ohlc_data()

    return renko_df