Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Standard Deviation for Sample

    General Code/Help
    1
    2
    17
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G3r West
      G3r West last edited by

      Hi there, I wanna check if there's only one class StandarDeviation to calculate the standard deviation of data population but not sample? I think in many cases we may want to use Std for sampling instead, is there any class/params/function for that? Thanks

      G3r West 1 Reply Last reply Reply Quote 0
      • G3r West
        G3r West @G3r West last edited by

        @G3r-West I tried this, this helps fix this though not very elegant:

        self.std = pow((pow(
        btind.StandardDeviation(self.datas[0], period=self.params.maperiod),
        2)
        * self.params.maperiod) / (self.params.maperiod - 1), 0.5)

        Any other advice is welcomed.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors