Millenium

Generation

generate functionMon, 10 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.

# Function to search for the most recent minimum and maximum # Add function for min and max def find_min_max(data): min_value = data[0]['close'] max_value = min_value min_index = 0 max_index = 0 for i in range(1, len(data)): if data[i]['close'] < min_value: min_value = data[i]['close'] min_index = i if data[i]['close'] > max_value: max_value = data[i]['close'] max_index = i return min_index, max_index min_index, max_index = find_min_max(data) # Function to calculate the Fibonacci levels # Add function for fibonacci levels def fib_retracement(data, index, levels=[0, 0.07, 0.15, 0.23, 0.38, 0.50, 0.61, 0.78, 1.0]):

Questions about programming?Chat with your personal AI assistant