zoukankan      html  css  js  c++  java
  • Backtrader中文笔记之CSV Data Feed Filters

    Filters

    This functionality is a relatively late addition to backtrader and had to be fitted to the already existing internals. This makes it to be not as flexible and 100% feature full as wished, but it can still serve the purpose in many cases.

    这个功能是对backtrader一个相对较晚的添加,必须在现有的内部实现。这使得它不像预期的那样灵活和100%的功能,但它仍然可以在许多情况下达到目的。

    Although the implementation tried to allow plug and play filter chaining, the pre-existing internals made it difficult to ensure that could always be achieved. As such, some filters may be chained and some others may not.

    尽管该实现尝试允许过滤器立即链接,但由于预先存在的内部结构,很难确保始终能够实现这一点。因此,一些过滤器可能是连锁的,而另一些则不是。
     

    Purpose

    Transform the values provided by a data feed to deliver a different data feed
     
    平台通过数据传输提供值来交付不同的数据传输
    The implementation was started to simplify the implementation of the two obvious filters which can be directly used via the cerebro API. These are:
    开始实现是为了简化两个明显的过滤器的实现,这两个过滤器可以通过cerebro API直接使用。这些都是:

    Resampling (cerebro.resampledata)

    Here the filter transforms the timeframe and compression of the incoming data feed. For example:

    在这里,过滤器转换传入数据提要的时间框架和压缩。例如

    (Seconds, 1) -> (Days, 1)
    

    That means that the original data feed is delivery bars with a resolution of 1 Second. The Resampling filter intercepts the data and buffers it until it can deliver a 1 Day bar. This will happen when a 1 Second bar from the next day is seen.

    这意味着原始数据馈送是分辨率为1秒的bar。重采样过滤器截取数据并对其进行缓冲,直到它可以提供1天的bar。这将发生在第二天的1秒条出现时。

    Replaying (cerebro.replaydata)

    For the same timeframes as above, the filter would use the 1 Second resolution bars to rebuild the 1 Day bar.

    That means that the 1 Day bar is delivered as many times as 1 Second bars are seen, updated to contain the latest information.

    This simulates, for example, how an actual trading day has developed.

    对于与上述相同的时间段,过滤器将使用1秒分辨率条重建1天条形图。

    这意味着,1天的条形图与1秒的条形图显示的次数一样多,更新后包含最新的信息。

    例如,这模拟了实际交易日的发展情况。

     

    Note

    The length of the data, len(data) and therefore the length of the strategy remain unchanged as long as the day doesn’t change.

    数据的长度len(data)和策略的长度保持不变,只要日期不变。
     
     
     
     
     

  • 相关阅读:
    在CentOS中配置DNS服务器
    CENTOS5.3 64位 VNC远程控制Centos 安装配置
    Windows Server 2003 FTP服务器配置详解 20091210 14:23:36| 分类: 服务器 | 标签: |字号大
    Centos 5.1 sendmail邮件服务器安装及配置
    DNS安装配置全过程
    tomcat多域名设置
    tomcat6 优化初步
    让CentOS自动备份mysql数据库 不指定
    开通企业邮箱之前,请登录您企业网站的域名注册服务商的域名管理平台,进行DNS配置及指向设置,谢谢您的配合
    18.3.2 在不同主机上使用 RMAN 备份建立物理备用数据库
  • 原文地址:https://www.cnblogs.com/sidianok/p/13489234.html
Copyright © 2011-2022 走看看