Skip to content

Instantly share code, notes, and snippets.

@McKlayne
Created August 28, 2021 18:59
Show Gist options
  • Save McKlayne/de61fe90ce339aa25c21dbfbb40b955f to your computer and use it in GitHub Desktop.
Save McKlayne/de61fe90ce339aa25c21dbfbb40b955f to your computer and use it in GitHub Desktop.
import requests
endpoint = 'https://paper-api.alpaca.markets/v2/orders'
order = {
"symbol":symbol,
"notional":amount,
"side":side,
"type":"market",
"time_in_force":"day"
}
headers = headers = {'APCA-API-KEY-ID':api_key,'APCA-API-SECRET-KEY':api_secret}
print(requests.post(endpoint,json=order,headers=headers).json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment