Skip to content
New issue

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

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

Already on GitHub? # to your account

File name #68

Open
shivakn2003 opened this issue Sep 23, 2024 · 1 comment
Open

File name #68

shivakn2003 opened this issue Sep 23, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@shivakn2003
Copy link

Hello
Is it possible to include the strike price of Index in the file name?
Can trading date be part of the file name instead of expiry date?

@VarunS2002
Copy link
Owner

@shivakn2003 Are you talking about the .csv file?
If yes, you can include it by modifying the code in the function export()
Specifically lines:

        csv_exists: bool = os.path.isfile(
            f"NSE-OCA-{self.index if self.option_mode == 'Index' else self.stock}-{self.expiry_date}.csv")
        try:
            if not csv_exists:
                with open(f"NSE-OCA-{self.index if self.option_mode == 'Index' else self.stock}-{self.expiry_date}.csv",
                          "a", newline="") as row:
                    data_writer: csv.writer = csv.writer(row)
                    data_writer.writerow(self.csv_headers)

            with open(f"NSE-OCA-{self.index if self.option_mode == 'Index' else self.stock}-{self.expiry_date}.csv",
                      "a", newline="") as row:

To include the strike price

@VarunS2002 VarunS2002 added the question Further information is requested label Sep 30, 2024
@VarunS2002 VarunS2002 added the enhancement New feature or request label Oct 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants