Skip to content

charmingdata/stock-market-trading

Repository files navigation

Stock Market Trading

As part of the Charming Data community project, the goal is to develop a data app that includes an agentic system that analyzes past performance and recommend trading decisions.

Explanation of the a1, a2, and a3 python files:

  • a1_simulate_trades.py connects to yahoo finance and pulls the historical price data -- from April 1 to present time -- for all the tickers in the trading-data.csv (lines 1 to 54 of the code). Then, from line 61 to the end, the python code simulates trading taking place, based on the setup in the trading-data.csv. For example, if the price of a stock was between the enter_from to enter_to range, we simulated a trading position being opened. If the price of a stock reached the pt1 point, we simulated the selling (if it was a buy long position) or buying (if it was a short position) of the stock. All the simulated trading is saved in the executed-trades.csv sheet.
  • a2_standardize_executed_trades.py standardizes all the trades in the executed-trades.csv sheet to assume the same position size. This is good practice in the trading world. Often, professional traders will spend a pre-determined and similar amount of money on every new trade they open to ensure they limit their losses. See an example in lines 8-17 in the python file. The code in this python file creates the final standardized-executed-trades.csv sheet.
  • a3_analysis.py does the data visualization and analysis of all the trades that took place, with the goal of assessing the quality and performance of the trade setups (trading-data.csv).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages