data= {
type: 'buy',
pair: 'BTC_USD',
amount: '1.0',
price: '870.69'
}
msg = 'your key' + urlencode(sorted(data.items(), key=lambda val: val[0]))
sign = hmac.new('your keys secret'.encode(), msg.encode(), digestmod='sha256').hexdigest()