Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap out Alpaca live data with Polygon API directly? #18

Open
interzonez opened this issue May 10, 2020 · 0 comments
Open

Swap out Alpaca live data with Polygon API directly? #18

interzonez opened this issue May 10, 2020 · 0 comments

Comments

@interzonez
Copy link

interzonez commented May 10, 2020

I'm not a US citizen and therefore can't access live data from Alpaca within my demo account.

I'm implementing Polygon via seems to work.


def get_polygon_credentials(alpaca_key=None):
    #try:
    #   alpaca_key, _, _ = get_credentials(alpaca_key, 'ignored')
    #except ValueError:
    #    pass

    key_id = '######################'  # os.environ.get('POLYGON_KEY_ID') or alpaca_key

    #if key_id is None:
    #   raise ValueError('Key ID must be given to access Polygon API'
    #                   ' (env: APCA_API_KEY_ID or POLYGON_KEY_ID)')
    return key_id

plus

from polygon import RESTClient
from polygon import WebSocketClient, STOCKS_CLUSTER

I could not get macd to recognise. So using:

from ta import trend

Then:

hist = trend.MACD

Are there any other ways advised to use Polygon data alongside Alpaca and can I therefore trade using ?

My output. Do the markets need to be live to run fully?

Getting current ticker data...
Success.
Tracking 0 symbols.
Getting historical data...
Success.
Watching 0 symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant