Support Resistance Algorithm - Technical analysis

后端 未结 11 581
悲哀的现实
悲哀的现实 2020-12-12 09:23

I have an intra-day chart and I am trying to figure out how to calculate support and resistance levels, anyone knows an algorithm for doing that, or a good starting point?

11条回答
  •  醉酒成梦
    2020-12-12 09:50

    I briefly read Jacob's contribution. I think it may have some issues with the code below: # Now the min if min1 - window < 0: min2 = min(x[(min1 + window):]) else: min2 = min(x[0:(min1 - window)])

    # Now find the indices of the secondary extrema
    max2 = np.where(x == max2)[0][0]  # find the index of the 2nd max
    min2 = np.where(x == min2)[0][0]  # find the index of the 2nd min
    

    the algorithm does try to find secondary min value outside given window, but then the position corresponding to np.where(x == min2)[0][0] may lie inside the the window due to possibly duplicate values inside the window.

提交回复
热议问题