def cfg_fixture():
    b = DefaultMunch()
    b.url = "test_url"
    b.api_key = "test_key"
    b.api_secret = "test_secret"

    b.name = "market_maker"
    b.instrument_name = "TEST-PERP"
    b.tick_size = 1
    return b
Beispiel #2
0
 def add_url(self, url, insert=None):
     if isinstance(url, str):
         url = DefaultMunch(url=url, attrs="")
         spl = url.url.split(None, 1)
         if len(spl)==2:
             url.url = spl[0]
             url.attrs = spl[1]
     if insert is not None:
         self.urls.insert(insert, url)
     else:
         self.urls.append(url)
Beispiel #3
0
def cfg_strategy_fixture():
    b = DefaultMunch()
    b.url = "test_url"
    b.api_key = "test_key"
    b.api_secret = "test_secret"

    b.name = "market_maker"
    b.instrument_name = "TEST-PERP"
    b.mid_price_based_calculation = False

    b.tick_size = 1
    b.price_rounding = 2
    b.cancel_orders_on_start = False
    b.stop_strategy_on_error = True
    b.cancel_orders_on_reconnection = True

    b.orders = DefaultMunch()
    b.orders.asks = [[0, 1]]
    b.orders.bids = [[0, 1]]
    return b
def cfg_strategy_fixture():
    b = DefaultMunch()
    b.url = "test_url"
    b.api_key = "test_key"
    b.api_secret = "test_secret"

    b.name = "market_maker"
    b.instrument_name = "TEST-PERP"
    b.mid_price_based_calculation = False
    b.send_post_only_orders = True

    b.tick_size = 1
    b.price_rounding = 2
    b.stop_strategy_on_error = True

    b.positional_retreat = DefaultMunch()
    b.positional_retreat.position_increment = 100
    b.positional_retreat.retreat_ticks = 5

    b.orders = DefaultMunch()
    b.orders.asks = [[0, 1]]
    b.orders.bids = [[0, 1]]
    return b