• 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)和策略的长度保持不变,只要日期不变。
     
     
     
     
     

  • 相关阅读:
    普元EOS中nui(对jquery MiniUi的封装)合并表头
    css--让箭头动起来
    在开发中说一说你最讨厌什么函数????
    前端开发学习路线
    默哀日,网页置灰,开发人员你应该掌握的
    window--环境下升级node的版本(因为低版本node运行Vue项目有问题)
    小程序--模板<template>的定义和使用
    小程序--app.js之App方法
    小程序---页面配置文件,只对自己的页面有效果
    javascript 内存模型
  • 原文地址:https://www.cnblogs.com/sidianok/p/13489234.html
Copyright © 2020-2023  润新知