<jupyter_start><jupyter_text>Deployment Guide for ITCH file parser and VWAP calculator**Steps (Don't skip reading through the commented code in code cells)**1. Create python module called as vwap from the vwap.pyx (cython file)<jupyter_code># You can skip this step and directly the python file. 
# But make sure you include the vwap.cp37-win_amd64.pyd to root folder structure.
#$ python setup.py build_ext --inplace<jupyter_output><empty_output><jupyter_text>2. A new file named "vwap.cp37-win_amd64.pyd" will be created. Place this file in same folder where all your python libraries or modules are placed.3. Now run the command which calculates the VWAP for file which is given as command line argument to the python file created.<jupyter_code>#$ python calculate_vwap.py "C:/Users/Amandeep/Downloads/NASDAQ_DATA/01302019.NASDAQ_ITCH50.gz"
#After running above line you should see

#The VWAP for each stock are stored in stock_vwap_full.csv
#Time taken to execute(in seconds) = 531.0053579807281 

#as result of previous command.
#The stock_vwap_full.csv contains VWAP for all the stocks, 
#which is calculated as a 1 hour running average for all the stocks whose trade messages(cross and non-cross) were received.
# Let us explore the result
import pandas as pd
stocks_vwap = pd.read_csv("stock_vwap_full.csv", header = None)
stocks_vwap.columns = ['Stock Name', 'VWAP', 'Time of the Day(Nanoseconds)']
stocks_vwap['Formated Time of the Day'] = pd.to_timedelta(stocks_vwap['Time of the Day(Nanoseconds)'])
stocks_vwap.shape
stocks_vwap.groupby(['Stock Name']).size().shape
display(stocks_vwap.head())
display(stocks_vwap.tail())<jupyter_output><empty_output><jupyter_text>**Note the times you see are include pre-market and post-market messages, because the question just said trading hours, I assumed they include pre-market and post-market trading messages**<jupyter_code>stocks_vwap.loc[stocks_vwap['Stock Name'] == "b'TSLA    '"].sample(n=100, random_state=1).shape
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns

# Let us see the stocks for Tesla.
to_plot = stocks_vwap.loc[stocks_vwap['Stock Name'] == "b'TSLA    '"].sample(n = 300, random_state = 1)
# Plot the responses for different events and regions
sns.lineplot(x = "Formated Time of the Day", y = "VWAP", data = to_plot)
plt.show()


# Let us see the stocks for Amazon.
to_plot = stocks_vwap.loc[stocks_vwap['Stock Name'] == "b'AMZN    '"].sample(n = 200, random_state = 44)
# Plot the responses for different events and regions
sns.lineplot(x = "Formated Time of the Day", y = "VWAP", data = to_plot)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09787556904400607, 'fraction_numerical': 0.019347496206373292, 'mean_word_length': 5.511111111111111, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '483090', 'license': 'MIT', 'n_tokens_mistral': 935, 'n_tokens_neox': 879, 'n_words': 301, 'path': 'Deployment/Deployment Guide.ipynb', 'repo_name': 'amandeepfj/NASDAQ_PITCH_DATA_PARSER', 'size': '2636'}