alpacahq / alpacahq/alpaca-backtrader-api

Help with Live trading examples and ALPACA_PAPER = False crash

Abierto
#165 1 comentario 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
702
Forks
160
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When I run the sample code of the SMACross backtest and use ALPACA_PAPER = True. Everything runs fine.
Question 1 - is that actually hitting alpaca? to pull historical data for AAPL from 2015 to now? and show the results?

Then if I change ALPACA_PAPER = False - I get an error, that: AttributeError: 'Account' object has no attribute 'portfolio_value'.
Question 2 - Is that expected because the sample just doesn't work with False?

First day using backtrader and just want to see that its working before I try to do anything.
Question 3 - When BT says 'live' trading, it doesn't mean actual money account, it means running on live data in the PAPER account only?

Does BT support trading live, actual money via Alpaca if the code is eventually tested as good, or that is not at all feature? so I should not look for that to be working in any way?

I have another sample script the only runs with ALPACA_PAPER = True and works fine. (I'm seeing a pattern) But when I switch that to False, that one also breaks. It however looks to start a websocket and says access denied:
`ERROR:root:error while consuming ws messages: Invalid Alpaca API credentials, Failed to authenticate: {'stream': 'authorization', 'data': {'action': 'authenticate', 'message': 'access key verification failed', 'status': 'unauthorized'}}`

I know my paper credentials are good, because I use them all the time out of the same config file. Any help is appreciated.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.