Пример #1
0
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()
Пример #2
0
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
Пример #5
0
def stream():
    stream = RecordsStub()
    yield stream
    stream.close()