For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to use EMA without a strategy
-
Hi
I want to use backtrader EMA without a strategy to calculate EMA for an array of close values, but I don't know how the data should look like in order for backtrader to accept it
from backtrader.indicators import EMA random_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] value = EMA(random_array, period=10)[0] print(value) #output: IndexError: array index out of range
-
it's impossible, use ta-lib ...
-
@dmitry-prokopiev said in How to use EMA without a strategy:
it's impossible, use ta-lib ...
In addition to this, you can try the dataframe friendly bta-lib
Just note there's been some issue with the latest releases of pandas/numpy.
-
@dmitry-prokopiev said in How to use EMA without a strategy:
it's impossible, use ta-lib ...
Thank you