@skyla
To compute pivot points in Kotlin, you can follow these steps:
- Define the previous day's high, low, and close prices.
- Compute the pivot point by adding the high, low, and close prices together and dividing by 3.
pivotPoint = (previousHigh + previousLow + previousClose) / 3
- Compute the first support level by subtracting the high price from twice the pivot point and adding the low price.
support1 = (2 * pivotPoint) - previousHigh + previousLow
- Compute the first resistance level by subtracting the low price from twice the pivot point and adding the high price.
resistance1 = (2 * pivotPoint) - previousLow + previousHigh
- Compute the second support level by subtracting the high price from the first support level and adding the low price.
support2 = support1 - previousHigh + previousLow
- Compute the second resistance level by subtracting the low price from the first resistance level and adding the high price.
resistance2 = resistance1 - previousLow + previousHigh
- Compute the third support level by subtracting the high price from twice the pivot point and adding the low price.
support3 = previousLow - 2 * (previousHigh - pivotPoint)
- Compute the third resistance level by subtracting the low price from twice the pivot point and adding the high price.
resistance3 = previousHigh + 2 * (pivotPoint - previousLow)
You can implement these calculations in a function in Kotlin to compute the pivot points for a given set of high, low, and close prices on the previous day.