Skip to content

Commit

Permalink
update exchange name
Browse files Browse the repository at this point in the history
  • Loading branch information
shashankvemuri committed Oct 8, 2023
1 parent 189b0bc commit dc3fd18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions stock_analysis/sp500_cot_sentiment_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def download_and_extract_cot_file(url, file_name):
# Reverse the data frame
data = data.iloc[::-1]

# Select only the data for the S&P 500 STOCK INDEX - CHICAGO MERCANTILE EXCHANGE
data = data.loc[data['Market_and_Exchange_Names'] == 'S&P 500 STOCK INDEX - CHICAGO MERCANTILE EXCHANGE']
# Select only the data for the E-MINI S&P 500 - CHICAGO MERCANTILE EXCHANGE
data = data.loc[data['Market_and_Exchange_Names'] == 'E-MINI S&P 500 - CHICAGO MERCANTILE EXCHANGE']

# Append the data frame to the frames list
frames.append(data)
Expand Down Expand Up @@ -88,7 +88,6 @@ def download_and_extract_cot_file(url, file_name):
plt.show()

# Box Plot
plt.figure(figsize=(10, 6))
boxplot = plt.boxplot([df['Pct_of_OI_Dealer_Long_All'], df['Pct_of_OI_Dealer_Short_All'], df['Pct_of_OI_Lev_Money_Long_All'], df['Pct_of_OI_Lev_Money_Short_All']],
labels=['Dealer Long', 'Dealer Short', 'Leveraged Money Long', 'Leveraged Money Short'],
patch_artist=True)
Expand Down

0 comments on commit dc3fd18

Please sign in to comment.