支持性算法 - 技术分析 [英] Support Resistance Algorithm - Technical analysis

查看:140
本文介绍了支持性算法 - 技术分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日线图,我试图找出如何计算 支持和阻力水平,任何人都知道的算法,这样做,或一个很好的起点?

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?

推荐答案

是的,一个很简单的算法就是选择一个时间框架,说100吧,然后找当地的转折点,或最大值与最小值。最大值和最小值可以由平滑收盘价格,通过使用第一和第二导数(DY / DX以及d ^ 2Y / dx)上计算的。其中,DY / DX =零以及d ^ Y / dx为正,则有一个极小,当镝/ DX =零以及d ^ 2Y / dx为负,则有一个最大值。

Yes, a very simple algorithm is to choose a timeframe, say 100 bars, then look for local turning points, or Maxima and Minima. Maxima and Minima can be computed from a smoothed closing price by using the 1st and second derivative (dy/dx and d^2y/dx). Where dy/dx = zero and d^y/dx is positive, you have a minima, when dy/dx = zero and d^2y/dx is negative, you have a maxima.

在实际应用中,这可以通过遍历你平滑的收盘价系列,看着三个相邻的点来计算。如果点是低/高/低,相对而言,你有一个最大值,否则高/低/高你有一个极小。你不妨微调这种检测方法看多点(比如5,7),只有触发如果边缘点是有一定%远离中心点。这是类似的Z字形指示器使用的算法。

In practical terms this could be computed by iterating over your smoothed closing price series and looking at three adjacent points. If the points are lower/higher/lower in relative terms then you have a maxima, else higher/lower/higher you have a minima. You may wish to fine-tune this detection method to look at more points (say 5, 7) and only trigger if the edge points are a certain % away from the centre point. this is similar to the algorithm that the ZigZag indicator uses.

在你当地的最大值和最小值,你再要寻找群彼此在Y方向在一定距离内的转折点。这是简单的。取N个转折点列表,并计算它与其它每个发现的转折点之间的Y距离。如果距离小于一个固定的常数,那么你已经找到了两个亲密的转折点,表明可能支撑/阻力。

Once you have local maxima and minima, you then want to look for clusters of turning points within a certain distance of each other in the Y-Direction. this is simple. Take the list of N turning points and compute the Y-distance between it and each of the other discovered turning points. If the distance is less than a fixed constant then you have found two "close" turning points, indicating possible support/resistance.

您便可以排名您的S / R线,因此两个转折点,在$ 20是超过三个转折点,在比如20 $不那么重要了。

You could then rank your S/R lines, so two turning points at $20 is less important than three turning points at $20 for instance.

这是扩展,这将是计算趋势线。随着发现现在采取的每一点依次选择其他两个点,试图将直线方程转向点的名单。如果该公式内的一定的误差容限可解,你有一个倾斜的趋势线。如果没有,则丢弃并移动到附近的下一个三元组。

An extension to this would be to compute trendlines. With the list of turning points discovered now take each point in turn and select two other points, trying to fit a straight line equation. If the equation is solvable within a certain error margin, you have a sloping trendline. If not, discard and move on to the next triplet of points.

为什么需要三个在时间来计算趋势线的原因是任意两点所用的直线方程中使用。另一种方式来计算趋势线是计算所有对转折点的直线方程,然后查看是否在第三点(或多个)位于内误差容限在同一直线上。如果1个或多个其他点也趴在这条线,宾果您已经计算出一个支撑/阻力趋势线。

The reason why you need three at a time to compute trendlines is any two points can be used in the straight line equation. Another way to compute trendlines would be to compute the straight line equation of all pairs of turning points, then see if a third point (or more than one) lies on the same straight line within a margin of error. If 1 or more other points does lie on this line, bingo you have calculated a Support/Resistance trendline.

我希望这有助于。没有code例子对不起,我只是给你如何能做到的一些想法。总结:

I hope this helps. No code examples sorry, I'm just giving you some ideas on how it could be done. In summary:

输入到系统

  • 在回望周期L(酒吧数量)
  • 收盘价对于L杆
  • 平滑因子(平稳收盘价)
  • 在误差或三角洲(转折点构成匹配之间的最小距离)

输出

    转折点
  • 在列表中,给他们打电话tPoints [](X,Y)
  • 潜在的趋势线的列表,每个与线方程(Y = MX + C)

最好的问候,

这篇关于支持性算法 - 技术分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆