def fetch_position(self, symbol, params={}):
    self.load_markets()
    market = self.market(symbol)
    method = None
    request = {'instrument_id': market['id']}
    type = market['type']
    if ((type == 'futures') or (type == 'swap')):
        method = (type + 'GetInstrumentIdPosition')
    elif (type == 'option'):
        underlying = self.safe_string(params, 'underlying')
        if (underlying is None):
            raise ArgumentsRequired(((((self.id + ' fetchPosition() requires an underlying parameter for ') + type) + ' market ') + symbol))
        method = (type + 'GetUnderlyingPosition')
    else:
        raise NotSupported((((((self.id + ' fetchPosition() does not support ') + type) + ' market ') + symbol) + ', supported market types are futures, swap or option'))
    response = getattr(self, method)(self.extend(request, params))
    return response
def fetch_position(self, symbol, params={}):
    self.load_markets()
    market = self.market(symbol)
    method = None
    request = {'instrument_id': market['id']}
    type = market['type']
    if ((type == 'futures') or (type == 'swap')):
        method = (type + 'GetInstrumentIdPosition')
    elif (type == 'option'):
        underlying = self.safe_string(params, 'underlying')
        if (underlying is None):
            raise ArgumentsRequired(((((self.id + ' fetchPosition() requires an underlying parameter for ') + type) + ' market ') + symbol))
        method = (type + 'GetUnderlyingPosition')
    else:
        raise NotSupported((((((self.id + ' fetchPosition() does not support ') + type) + ' market ') + symbol) + ', supported market types are futures, swap or option'))
    response = getattr(self, method)(self.extend(request, params))
    return response