v2
Updated:
dynamic_period(left, right, numPivots, minPeriod, maxPeriod, defaultPeriod, high, low)
Parameters:
left (int): Number of left bars for pivot detection
right (int): Number of right bars for pivot detection
numPivots (int): Minimum number of pivots to calculate average distance
minPeriod (int): Minimum allowed period
maxPeriod (int): Maximum allowed period
defaultPeriod (int): Default period if no pivots are found
high (float): Source for low values
low (float): Source for high values
Returns: Calculated dynamic period