2 changed files with 22 additions and 1 deletions
@ -0,0 +1,19 @@ |
|||
from pandas import DataFrame, Series # type: ignore |
|||
|
|||
from auto_trading.interfaces import Strategy |
|||
from auto_trading.indicators.dumb import Dumb |
|||
|
|||
|
|||
s1 = Series({"GOOG": 1, "GOOGL": 2}) |
|||
s2 = Series({"GOOG": 3, "GOOGL": 4}) |
|||
result = DataFrame({"GOOG": {"n1": 1, "n2": 3}, "GOOGL": {"n1": 2, "n2": 4}}) |
|||
|
|||
|
|||
class UselessStrategy(Strategy): |
|||
def execute(self, data, indicators_results: DataFrame, ptf_state): |
|||
assert (indicators_results == result).all().all() |
|||
|
|||
|
|||
def test_indicators_agg(): |
|||
strat = UselessStrategy({"n1": Dumb(s1), "n2": Dumb(s2)}) |
|||
strat.run(DataFrame(), None) |
Loading…
Reference in new issue