Skip to content

Instantly share code, notes, and snippets.

@henryrossiter
Created January 24, 2020 22:38
Show Gist options
  • Save henryrossiter/691c4b0904f2ecf0bbc87d39f297686b to your computer and use it in GitHub Desktop.
Save henryrossiter/691c4b0904f2ecf0bbc87d39f297686b to your computer and use it in GitHub Desktop.
import robin_stocks as r
def getTradeableCryptoList():
data = r.crypto.get_crypto_currency_pairs()
return [crypto for crypto in data if not crypto['display_only']]
def getCryptoPositions():
positions = r.get_crypto_positions()
return positions
def getCryptoQuote(symbol):
quote = r.get_crypto_quote(symbol)
return quote
def buyCrypto(symbol, usd):
resp = r.orders.order_buy_crypto_by_price(symbol, usd)
return resp
def sellCrypto(symbol, usd):
resp = r.orders.order_sell_crypto_by_price(symbol, usd)
return resp
def getHistoricals(symbol):
resp = r.stocks.get_historicals(symbol)
return resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment