def env(): rate = RatesStub(RecordsStub()) rate.add_record(entry("BTC_ETH", "2.0", miner_fee="0"), entry("ETH_BTC", "0.5", miner_fee="0")) \ .add_record(entry("BTC_ETH", "2.0", miner_fee="0"), entry("ETH_BTC", "0.5", miner_fee="0")) \ .add_record(entry("BTC_ETH", "4.0", miner_fee="0"), entry("ETH_BTC", "0.25", miner_fee="0")) \ .add_record(entry("BTC_ETH", "2.0", miner_fee="0"), entry("ETH_BTC", "0.5", miner_fee="0")) \ .add_record(entry("BTC_ETH", "1.0", miner_fee="0"), entry("ETH_BTC", "1.0", miner_fee="0")) \ .add_record(entry("BTC_ETH", "2.0", miner_fee="0"), entry("ETH_BTC", "0.5", miner_fee="0")) \ .add_record(entry("BTC_ETH", "4.0", miner_fee="0"), entry("ETH_BTC", "0.25", miner_fee="0")).finish() yield ExchangeTradingAiEnvironment(rate, "BTC", 1, 1, { 1: "BTC", 2: "ETH" }, TotalBalanceReward()) rate.close()
def rates(): s = RecordsStub() yield RatesStub(s) s.close()
def __init__(self): self.rates = RatesStub(RecordsStub()) self.rewards = deque()
def __init__(self, action_to_token, active_token): self.rates_stream = RatesStub(RecordsStub()) self.action_to_token = action_to_token self.token = active_token
def stream(): stream = RecordsStub() yield stream stream.close()