Hello , I’m just starting out and I can’t make a purchase I get this is my code please can you help me?.
{‘code’: 40010001, ‘message’: ‘could not find asset “”’}
import config
# import websocket, json
import requests, json
from config import *
BASE_URL = "https://paper-api.alpaca.markets"
ACCOUNT_URL= "{}/v2/account".format(BASE_URL)
ORDERS_URL= "{}/v2/orders".format(BASE_URL)
HEADERS = {'APCA-API-KEY-ID':API_KEY,'APCA-API-SECRET-KEY':SECRET_KEY }
def get_account():
r = requests.get(ACCOUNT_URL, headers=HEADERS)
return json.loads(r.content)
def create_order(symbol, qty, side, type, time_in_force):
data= {
"simbol" : symbol,
"qty" : qty,
"side" : side,
"type" : type,
"time_in_force" : time_in_force
}
r = requests.post(ORDERS_URL, json=data, headers=HEADERS)
return json.loads(r.content)
response = create_order("AAPL", 100, "buy", "market", "gtc")
print(response)