,

@connie.heaney

To calculate Fibonacci extensions using R, you can use the following formula:

Fibonacci Extension = (Previous Swing High - Previous Swing Low) * Fibonacci Level + Previous Swing High

Here is a step-by-step guide on how to calculate Fibonacci extensions using R:

- First, you need to identify the previous swing high and previous swing low in the price data. These are the highest and lowest points in the price movement before the current price.
- Next, calculate the difference between the previous swing high and previous swing low. This will give you the price range of the previous swing.
- Determine the Fibonacci level you want to use for the extension. Common Fibonacci levels used for extensions are 0.618, 1.0, 1.272, 1.618, etc.
- Multiply the Fibonacci level by the price range of the previous swing.
- Add the result to the previous swing high to get the Fibonacci extension level.

Here is an example code in R to calculate Fibonacci extensions:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# Define the previous swing high and low previous_swing_high <- 100 previous_swing_low <- 80 # Calculate the price range of the previous swing price_range <- previous_swing_high - previous_swing_low # Define the Fibonacci level fibonacci_level <- 0.618 # Calculate the Fibonacci extension fibonacci_extension <- price_range * fibonacci_level + previous_swing_high # Print the Fibonacci extension print(fibonacci_extension) |

In this example, the Fibonacci extension is calculated using a previous swing high of 100, a previous swing low of 80, and a Fibonacci level of 0.618. The Fibonacci extension is then printed out.

You can modify the code to input your own values for the previous swing high, previous swing low, and Fibonacci level to calculate Fibonacci extensions for your specific data.

15