Skip to content

Comments

Add crypto, forex, and indices examples#415

Merged
justinpolygon merged 5 commits intomasterfrom
jw-add-cfi
Apr 3, 2023
Merged

Add crypto, forex, and indices examples#415
justinpolygon merged 5 commits intomasterfrom
jw-add-cfi

Conversation

@justinpolygon
Copy link
Collaborator

Added example code snippets for crypto, forex, and indices.

@justinpolygon justinpolygon marked this pull request as ready for review March 29, 2023 12:53
@justinpolygon
Copy link
Collaborator Author

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:

>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)
>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:

<                 percent_change = (
<                     (item.prev_day.close - item.prev_day.open)
<                     / item.prev_day.open
<                     * 100
<                 )
<                 print(
<                     "{:<15}{:<15}{:<15}{:.2f} %".format(
<                         item.ticker,
<                         item.prev_day.open,
<                         item.prev_day.close,
<                         percent_change,
<                     )
<                 )

Updated code style to pass lint check.
@jbonzo
Copy link
Collaborator

jbonzo commented Apr 3, 2023

@jbonzo FYI - it looks like it's actually the linter that made the changes and added the spacing across the lines. So, I changed the code like we chatted about to be:


>                 percent_change = ((item.prev_day.close - item.prev_day.open)/item.prev_day.open*100)

>                 print("{:<15}{:<15}{:<15}{:.2f} %".format(item.ticker,item.prev_day.open,item.prev_day.close,percent_change))

Then, the link check failed here https://github.com/polygon-io/client-python/actions/runs/4601386532/jobs/8129177080?pr=415 so I run poetry run black polygon test_* examples to make the suggested changes and it give me this:


<                 percent_change = (

<                     (item.prev_day.close - item.prev_day.open)

<                     / item.prev_day.open

<                     * 100

<                 )

<                 print(

<                     "{:<15}{:<15}{:<15}{:.2f} %".format(

<                         item.ticker,

<                         item.prev_day.open,

<                         item.prev_day.close,

<                         percent_change,

<                     )

<                 )

Ah. Thats unfortunate. Ok then.

@justinpolygon justinpolygon merged commit 5d8560c into master Apr 3, 2023
@justinpolygon justinpolygon deleted the jw-add-cfi branch April 3, 2023 21:49
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

Successfully merging this pull request may close these issues.

2 participants