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.

import plotly.graph_objs as go from plotly.offline import plot import talib import plotly def fibonacci_levels(df): a = df.Close.values b = df.High.values c = df.Low.values x = talib.MAX(b, timeperiod=1) y = talib.MIN(c, timeperiod=1) z = x-y o = y.tolist() p = o.index(x[-1]) q = df.Date.iloc[p] r = df.Date.iloc[-1] d = df.Date.tolist() e = d.index(q) f = d.index(r) fig = go.Figure() fig.add_trace(go.Scatter(x=df.Date[e:f], y=df.Close[e:f], mode="lines", name="BNBUSDT")) fig.add_trace(go.Scatter

Want to kickstart your project?Use the new AI Studio to create your code