Millenium

Generation

generate functionTue, 11 Apr 2023

search the BNBUSDT chart for any maximum and minimum to determine the maximum and minimum of a Japanese candle that is in the extreme, and plot Fibonacci levels from 0 to 1 on the extreme candle, where 0 should be at the extreme.

def find_extremes(data): max_candle = data.iloc[0] min_candle = data.iloc[0] for i, row in data.iterrows(): if row['high'] > max_candle['high']: max_candle = row if row['low'] < min_candle['low']: min_candle = row max_candle_index = data.index.get_loc(max_candle.name) min_candle_index = data.index.get_loc(min_candle.name) max_extremes = data.iloc[max_candle_index - 5:max_candle_index+5] min_extremes = data.iloc[min_candle_index - 5:min_candle_index+5] max_prices = max_extremes['high'].tolist() min_prices = min_extremes['low'].

Questions about programming?Chat with your personal AI assistant