ta-lib-两只乌鸦

ta-lib两只乌鸦形态识别实现分析。

k线形态需要回溯前面走势,并判断当前形态是否满足一定条件,如果我自己写可能会存在较多if else。因此今天研究下cdl2Crows的实现学习下。

k线默认配置

从默认配置可以查看作者对一些形态的基本判断。

private CandleSetting TA_CandleDefaultSettings[] = {
   /*
   * real body is long when it's longer than the average of the 10
   * previous candles' real body
   */
   new CandleSetting(CandleSettingType.BodyLong,
      RangeType.RealBody, 10, 1.0),
   /*
   * real body is very long when it's longer than 3 times the average
   * of the 10 previous candles' real body
   */
   new CandleSetting(CandleSettingType.BodyVeryLong,
      RangeType.RealBody, 10, 3.0),
   /*
   * real body is short when it's shorter than the average of the 10
   * previous candles' real bodies
   */
   new CandleSetting(CandleSettingType.BodyShort,
      RangeType.RealBody, 10, 1.0),
   /*
   * real body is like doji's body when it's shorter than 10% the
   * average of the 10 previous candles' high-low range
   */
   new CandleSetting(CandleSettingType.BodyDoji,
      RangeType.HighLow, 10, 0.1),
   /* shadow is long when it's longer than the real body */
   new CandleSetting(CandleSettingType.ShadowLong,
      RangeType.RealBody, 0, 1.0),
   /* shadow is very long when it's longer than 2 times the real body */
   new CandleSetting(CandleSettingType.ShadowVeryLong,
      RangeType.RealBody, 0, 2.0),
   /*
   * shadow is short when it's shorter than half the average of the 10
   * previous candles' sum of shadows
   */
   new CandleSetting(CandleSettingType.ShadowShort,
      RangeType.Shadows, 10, 1.0),
   /*
   * shadow is very short when it's shorter than 10% the average of
   * the 10 previous candles' high-low range
   */
   new CandleSetting(CandleSettingType.ShadowVeryShort,
      RangeType.HighLow, 10, 0.1),
   /* when measuring distance between parts of candles or width of gaps */
   /*
   * "near" means "<= 20% of the average of the 5 previous candles'
   * high-low range"
   */
   new CandleSetting(CandleSettingType.Near,
      RangeType.HighLow, 5, 0.2),
   /* when measuring distance between parts of candles or width of gaps */
   /*
   * "far" means ">= 60% of the average of the 5 previous candles'
   * high-low range"
   */
   new CandleSetting(CandleSettingType.Far,
      RangeType.HighLow, 5, 0.6),
   /* when measuring distance between parts of candles or width of gaps */
   /*
   * "equal" means "<= 5% of the average of the 5 previous candles'
   * high-low range"
   */
   new CandleSetting(CandleSettingType.Equal,
      RangeType.HighLow, 5, 0.05) };

代码

三日K线模式,第一天长阳,第二天高开收阴,第三天再次高开继续收阴,收盘比前一日收盘价低,预示股价下跌。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值