예제 #1
0
def test_sendchildorder():
    '''
    test bitflyer.private.sendchildorder()
    '''
    time.sleep(1)
    p1 = Private(access_key=settings.access_key, secret_key=settings.secret_key)
    result = p1.sendchildorder(product_code='BTC_JPY',size=0.1,child_order_type='LIMIT',side='BUY', price=30000)
    ok_(isinstance(result.get('response'),dict))
    ok_(isinstance(result.get('response').get('child_order_acceptance_id'), str))
    return result.get('response').get('child_order_acceptance_id')
예제 #2
0
def test_cancelchildorder():
    '''
    test bitflyer.private.cancelchildorder()
    '''
    time.sleep(1)
    p1 = Private(access_key=settings.access_key, secret_key=settings.secret_key)
    result = p1.sendchildorder(product_code='BTC_JPY',size=0.1,child_order_type='LIMIT',side='BUY', price=30000)

    time.sleep(1)
    p2 = Private(access_key=settings.access_key, secret_key=settings.secret_key)
    result2 = p2.cancelchildorder(product_code='BTC_JPY',child_order_acceptance_id=result.get('response').get('child_order_acceptance_id'))
    eq_(result2.get('status_code'),200)
예제 #3
0
def test_sendchildorder():
    '''
    test bitflyer.private.sendchildorder()
    '''
    time.sleep(1)
    p1 = Private(access_key=settings.access_key,
                 secret_key=settings.secret_key)
    result = p1.sendchildorder(product_code='BTC_JPY',
                               size=0.1,
                               child_order_type='LIMIT',
                               side='BUY',
                               price=30000)
    ok_(isinstance(result.get('response'), dict))
    ok_(
        isinstance(
            result.get('response').get('child_order_acceptance_id'), str))
    return result.get('response').get('child_order_acceptance_id')
예제 #4
0
def test_cancelchildorder():
    '''
    test bitflyer.private.cancelchildorder()
    '''
    time.sleep(1)
    p1 = Private(access_key=settings.access_key,
                 secret_key=settings.secret_key)
    result = p1.sendchildorder(product_code='BTC_JPY',
                               size=0.1,
                               child_order_type='LIMIT',
                               side='BUY',
                               price=30000)

    time.sleep(1)
    p2 = Private(access_key=settings.access_key,
                 secret_key=settings.secret_key)
    result2 = p2.cancelchildorder(
        product_code='BTC_JPY',
        child_order_acceptance_id=result.get('response').get(
            'child_order_acceptance_id'))
    eq_(result2.get('status_code'), 200)