Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SMA Example

    Support
    3
    4
    222
    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.
    • N
      Nikos84 last edited by

      Hello Quantiacs, I want to code a simple system based on comparing several moving averages. I am not familiar with xarray, so I convert to pandas data structures and then I code averages on my own using pandas tools.

      However, my code is rather slow. Can you show me a snippet with the best practice for coding an SMA in your framework? Then I can adapt easily.

      1 Reply Last reply Reply Quote 0
      • support
        support last edited by

        Hi.

        See this example: https://quantiacs.com/documentation/en/examples/btc_futures_trend_following.html

        Just replace qnta.lwma with qnta.sma. It is fast enough in most cases.

        If it is still slow for you, you can try single-pass implementation. Check out the examples folder, you will see the difference.

        Regards.

        N 1 Reply Last reply Reply Quote 1
        • N
          Nikos84 @support last edited by

          @support Thank you!

          1 Reply Last reply Reply Quote 0
          • R
            royalbert867 last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB | Contributors
            • Documentation
            • About
            • Career
            • My account
            • Privacy policy
            • Terms and Conditions
            • Cookies policy
            Home
            Copyright © 2014 - 2021 Quantiacs LLC.
            Powered by NodeBB | Contributors