SMA Example
-
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.
-
Hi.
See this example: https://quantiacs.com/documentation/en/examples/btc_futures_trend_following.html
Just replace
qnta.lwma
withqnta.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.
-
@support Thank you!
-
This post is deleted!