I provided user inputs here for three Fibonacci levels. You can also adjust the time frame (default is set to WEEK). You can change that to whatever time frame is available in the user input. Screenshot below shows what is looks like on a 1 hour chart set to weekly Fibonacci levels. This does not include labels for the lines and it does not automatically switch directions based on trend direction.
Here is your code:
input fibOne = 38.2;
input fibTwo = 50.0;
input fibThree = 61.8;
input timeFrame = AggregationPeriod.WEEK;
plot periodHigh = high(period = timeFrame)[1];
periodHigh.SetDefaultColor(Color.GREEN);
periodHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot periodLow = low(period = timeFrame)[1];
periodLow.SetDefaultColor(Color.RED);
periodLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot fibLevelOne = periodLow + ((periodHigh - periodLow) * (fibOne * 0.01));
fibLevelOne.SetDefaultColor(Color.CYAN);
fibLevelOne.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot fibLevelTwo = periodLow + ((periodHigh - periodLow) * (fibTwo * 0.01));
fibLevelTwo.SetDefaultColor(Color.YELLOW);
fibLevelTwo.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot fibLevelThree = periodLow + ((periodHigh - periodLow) * (fibThree * 0.01));
fibLevelThree.SetDefaultColor(Color.MAGENTA);
fibLevelThree.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);