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

state.interface.history duplicating prices #232

Open
chaterpaul opened this issue Mar 21, 2023 · 3 comments
Open

state.interface.history duplicating prices #232

chaterpaul opened this issue Mar 21, 2023 · 3 comments

Comments

@chaterpaul
Copy link

Description

Hi, I was using your Screener example, and when printing out the dataframe for state.interface.history the prices are duplicated.

def is_stock_buy(symbol, state: ScreenerState):

This runs per stock

    prices = state.interface.history(symbol, 40) # get past 40 data points
    print(prices)

returns

      time     open      high       low   close      volume

18 1677042000 148.870 149.9500 147.1600 148.91 51037691.0
19 1677042000 148.870 149.9500 147.1600 148.91 51037691.0
20 1677128400 150.090 150.3400 147.2400 149.40 48412870.0
21 1677128400 150.090 150.3400 147.2400 149.40 48412870.0
22 1677214800 147.110 147.1900 145.7202 146.71 55469643.0
23 1677214800 147.110 147.1900 145.7202 146.71 55469643.0
24 1677474000 147.710 149.1700 147.4500 147.92 45007197.0
25 1677474000 147.710 149.1700 147.4500 147.92 45007197.0
26 1677560400 147.050 149.0800 146.8300 147.41 50575615.0
...

Platform Info

  • Python version: Python 3.10.9
  • Platform: Windows

Also if you look at your help from the screener : https://docs.blankly.finance/examples/rsi-screener/

if you cut and paste the code into python it will not run there are several errors in it.

Thanks

Paul

BTW. Love this its cool.

@EmersonDove
Copy link
Member

EmersonDove commented Mar 21, 2023

Hey Paul, sorry about the errors, I think we changed the screener API and didn't update the the docs, I'll add that to the project TODO.

Can you give some more info on what stock you're querying? I'll take a look on my local because that looks like unexpected behavior.

@chaterpaul
Copy link
Author

chaterpaul commented Mar 21, 2023 via email

@EmersonDove
Copy link
Member

Hey @chaterpaul I recommend installing yfinance using pip install yfinance and then changing use_yfinance to true inside your settings.json. This will use yfinance for history calls instead of Alpaca which appears to be correct until I can get around to fixing this.

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

2 participants