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

Futures Valid month code assert references equity letter map #58

Open
kastins opened this issue Oct 18, 2022 · 3 comments
Open

Futures Valid month code assert references equity letter map #58

kastins opened this issue Oct 18, 2022 · 3 comments

Comments

@kastins
Copy link

kastins commented Oct 18, 2022

Hello,
in Conn.py >> function " def request_futures_option_chain" at line 2939
the assert below checks against valid equity month letters and NOT the futures_map,
i ran into this issue when requesting options for December "Z"

        if month_codes is not None:
            valid_month_codes = ()
            if opt_type == 'p':
                valid_month_codes = LookupConn.put_month_letters
            elif opt_type == 'c':
                valid_month_codes = LookupConn.call_month_letters
            elif opt_type == 'cp' or opt_type == 'pc':
                valid_month_codes = (
                    LookupConn.call_month_letters +
                    LookupConn.put_month_letters)
            # noinspection PyTypeChecker
            for month_code in month_codes:
                assert month_code in valid_month_codes

i rudimentary changed it to this,

        if month_codes is not None:
            valid_month_codes = LookupConn.futures_month_letters 

            # noinspection PyTypeChecker
            for month_code in month_codes:
                assert month_code in valid_month_codes
                

Thanks for this great wrapper BTW

@akapur
Copy link
Owner

akapur commented Oct 18, 2022 via email

@kastins
Copy link
Author

kastins commented Oct 18, 2022

OK, bare with me, i'm just trying to understand github and get my head around this forking thing, ill try sort it out within the week.
Cheers

kastins referenced this issue in kastins/pyiqfeed Oct 23, 2022
@akapur
Copy link
Owner

akapur commented Aug 23, 2023

  1. Could you make sure there are no conflicts.
  2. Could you make sure that your pull request still works for instruments other than futures with an if statement.

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