Exemplo n.º 1
0
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
Exemplo n.º 2
0
Arquivo: abbr.py Projeto: s-nt-s/GSI
 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)
Exemplo n.º 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
Exemplo n.º 4
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.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