Skip to content

Enrique Garcia

General musings from someone in over their head

Menu
  • Home
  • Program Journal
Menu

Do I know what I’m doing? There’s a 33% chance I do

Posted on September 22, 2018August 21, 2020 by Enrique Garcia

As I mentioned elsewhere, in my free time I’m working on a PHP-based program to analyze the stock market and choose which stocks to trade. The idea being to run a basic trading method against all stocks, rank them based on results and success and then buy one of the top results the program spits out at me.

The program so far

I’ve been working on my program, for the moment codenamed Gnosis, since April. I started paper-trading around a month ago, starting with a “budget” of $2,500. So far things haven’t been going so well, as my simulated portfolio is down almost 16%. On the plus side, however, 5 of the 15 stocks I’ve traded thus far have been great successes. One of them even netted me an almost 18% gain.

Right now, my program is analyzing all stocks across the AMEX, NASDAQ, NYSE and OTCBB markets, on equal footing. Yes, that means I’m analyzing over 20,000 available stocks. However, I need to start setting up parameters to reduce the amount of analysis going on, as there are some stocks that will clearly never yield good results, or that just aren’t good for swing trading (for example, stocks with such little volume that their price changes once or twice a month).

So once I wrap up the current line of work I’m doing right now, I’ll be doing some house-cleaning in the code and adding these restrictions. Key among those restrictions will be volume, I need to determine what would be a good average daily volume for a stock to have to make it worth updating.

Just the same, however, I do plan on implementing a feature that will eventually analyze all stocks, maybe once a month or once a week. You never know when the circumstances will change for any particular stock, especially the lesser known ones.

The big features I’ve recently added are simple moving average (SMA) functionality and chart generation. I’ve tried a few chart generating libraries, including Google Charts, but for now I’m sticking with Jpgraph.  I really liked Google Charts but I hated that I have to set up the data in the HTML header before generating the chart itself where I want it on the webpage. Plus, it doesn’t work offline. Jpgraph is kind of difficult for a newb programmer but I’ve gotten it to achieve what I need for now (check out the screenshot above). We’ll see how that goes.

The human factor

My program scores all stocks on a scale of 0 to 100. Because I’m mostly only working with historical price data from this year, which is not much go to by, I have a lot of stocks that are ranked at 100, which probably shouldn’t be (and as time goes on, many are dropped).

Because of this, I’ve had to do some manual analysis of my own to determine which stock will likely yield me the highest return for the lowest price from the list of “perfect” results my program provides. This may or may not be the cause behind my subpar paper trading so far. One thing I intend to do soon is to create a second portfolio and go back to my program’s results to “start over” and always choose the #1 result my program gives me. It’ll be interesting to see how that goes.

What’s next

Now that I’ve got SMA functions written and have been able to successfully apply the use of SMA triggers on individual stocks, I’ve got to wrap that up and make my program apply it using different time periods (5-day & 10-day SMAs, or 10-day & 20-day SMAs, etc.) to all the stocks in the market. Then do like I’m doing now, scoring and ranking them so I can begin paper-trading using this second method.

Hopefully, I can backtrack a month or so so I can simulate trading from the first day I started with the other method, so I can have side-by-side comparisons.

The ultimate goal, however, is to combine my current method with these SMA-triggers, which I’m hoping will yield more reliable stock picks.

Leave a Reply Cancel reply

You must be logged in to post a comment.

Archives

  • August 2021
  • July 2021
  • June 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • September 2018
  • June 2018

RSS Finance News

  • U.S. natgas futures wrap up biggest monthly decline in 22 years
  • Snap earnings call: Improvements will take time to hit top line, CEO says
  • Diabetes drug developer Structure Therapeutics sets terms for $125M US IPO
  • Why did CureVac stock slip today? Declining market for COVID vaccines
  • AMD CEO Lisa Su: Company in a 'good position' for data center gains
  • Stoneridge appoints former Aptiv executive Jim Zizelman as president, CEO
  • S&P 500 hits the ‘January Indicator Trifecta,’ giving it perhaps 100% odds of 2023 gains

Trading Websites

  • Master the Market
  • QuantiInsti’s Blog

Recent Posts

  • Latest program update going very well!
  • First big program update all year!
  • It’s been a minute…
  • The major overhaul continues
  • Major program changes now in progress

Tags

AAPL Apple coding collectibles comic books data sources diversification Dow Jones ETF GME ideas insights investing IRIX KRP marijuana methodology MGY MYCNX NASDAQ NVAX opinion preferred stock programming progress project stock market TGIF troubleshooting TXMD wallstreetbets
©2023 Enrique Garcia | Built using WordPress and Responsive Blogily theme by Superb