分类
外汇交易市场策略

BBands与RSI复合指标组合

Welcome to backtrader!

backtrader allows you to focus on writing reusable trading strategies, indicators and BBands与RSI复合指标组合 analyzers instead of having to spend time building BBands与RSI复合指标组合 infrastructure.

Use, modify, audit and share it. The secret is in the sauce and you are the cook. This is just the tool.

Check the QuickStart, the extensive documentation, in-depth topics and ideas in the blog.

See what others have already asked, answered & shared. You are the community! Join and be part BBands与RSI复合指标组合 of it!

See a quick example of a Simple Moving Average Crossover BBands与RSI复合指标组合 strategy (long-only)

See a quick overview of all the goodies and language feathers that backtrader has to offer.

Welcome to backtrader!

backtrader allows you to focus on writing reusable trading strategies, indicators and analyzers instead of having to spend time building infrastructure.

Use, modify, audit and share it. The BBands与RSI复合指标组合 secret is in the sauce and you are the cook. This is just the tool.

Check the QuickStart, the extensive documentation, in-depth topics and ideas in the blog.

See what others have already asked, answered & shared. You are the community! Join and be part of it!

See a quick example of a Simple Moving Average Crossover strategy (long-only)

See a quick overview of all the goodies and language feathers that backtrader has to offer.

TA-Lib

Each function returns an output array and have default values for their
parameters, unless specified as keyword arguments. Typically, these functions
will have an initial “BBands与RSI复合指标组合 BBands与RSI复合指标组合 lookback” period (a required number of observations
before an output is generated) set to NaN .
每个函数都默认需要输入数组,并为它们提供默认值。
参数,除非指定为关键字参数。通常,这些函数
会有一个初步的“lookback”时期(观测所需数量
在生成一个输出之前),设置为“NaN”。

All of the following examples use the BBands与RSI复合指标组合 function API:
所有的API函数的使用,都需引入库文件:

Abstract API BBands与RSI复合指标组合 Quick Start 抽象 API BBands与RSI复合指标组合 快速入门

If you’re already familiar with using the function API, you should feel right
at home using the abstract API. Every function BBands与RSI复合指标组合 takes the same input, passed
as a dictionary of Numpy arrays:
如果您已经熟悉使用函数API,那么您就应该精通使用抽象API。
每个函数有相同的输入,作为一个字典通过NumPy数组:

Supported Indicators 支持的指标

We can show all the TA functions supported by TA-Lib, either as a list or
as a dict sorted by group (e.g. “Overlap Studies”, “Momentum Indicators”,
etc):
我们可以显示Ta lib的所有TA函数,返回一个 list 或者 dict

TA-LIB】之MACD

褶皱的包子 于 2018-07-18 18:38:37 发布 24632 收藏 BBands与RSI复合指标组合 39

移动平滑异同平均线(Moving Average Convergence Divergence,简称MACD指标)策略。MACD是查拉尔·阿佩尔(Geral Appel)于1979年提出的,由一快及一慢指数移动平均(EMA)之间的差计算出来。“快”指短时期的EMA,而“慢”则指长时期的EMA,最常用的是12及26日EMA。

MACD=M快 - M慢

1.DIF 与MACD均为正值亦即在中轴线上,大势属多头市场,DIF 向上突破 MACD,应作买。若 DIF向下跌破MACD应只可作回档,暂时获利了解。

2.反之DIF与MACD均为负值时,即在0轴线以下时,大势属空头市场,DIF 向下跌破MACD,可作卖。若 DIF向上突破MACD只可作空头暂时补空。

3.如同强弱指标,背离走势也适用在 MACD的图形上,当MACD图形与 K线 图趋势线发生背离时亦为反转讯号。

4.MACD无法预知高价及低价。盘局时,失误率较高, 但如配合 RSI及KD线 应用则可以解决此二缺点.

从MACD的走势,投资者可以发现三种讯息: 1. 当MACD升穿Signal Line,入市讯息;当MACD跌穿Signal Line,出市讯息。 2. 当MACD上升时,股票价格可能是超买

对于talib中的macd:

12日EMA的计算:EMA12 = 前一日EMA12 X 11/13 + 今日收盘 X 2/13

26日EMA的计算:EMA26 = 前一日EMA26 X 25/27 + 今日收盘 X 2/27

差离值(DIF)的计算: DIF = EMA12 - EMA26,即为talib-MACD返回值macd

根据差离值计算其9日的EMA,即离差平均值,是所求的DEA值。今日DEA = (前一日DEA X 8/10 + 今日DIF X 2/10),即为talib-MACD返回值signal