No. of Recommendations: 17
There is a major problem with Klein Charts, there are not enough of them! Mike used two limits, a minimum of 16 years of price history and a minimum market CAP of $1 billion. While he was active at TMF he would produce additional charts on demand. Other Fools had chart rendering websites but they have all faded away.

My fast growth wishlist uses phpExcel to calculate the Average CAGR (the red line) but looking at the numbers is not too helpful, nowhere as informative as a chart. The charting software I have seen is in languages that I'm not familiar with.

I seldom make New Year Resolutions but this year I'm making one, Denny's Klein Charts with phpExcel! I got started today. The tutorials on Google were all very complicated so I turned to the examples that come with phpExcel which promptly bombed. I found the bug fix using Google so the examples are now working. Now it's just a matter of time to get it working.

Why now? Because had I looked at a Klein Chart I would not have bought an overpriced stock that took a terrible dive last October.

Stay tuned!

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 1
Not to rain on your parade, but phpExcel is deprecated and not maintained and they suggest people to switch to phpSpreadsheet

https://github.com/PHPOffice/PHPExcel

If you're going to learn it, I'd learn the one that is maintained, there might be something in the old one that doesn't work with modern web technologies
Print the post Back To Top
No. of Recommendations: 1
Not to rain on your parade, but phpExcel is deprecated and not maintained and they suggest people to switch to phpSpreadsheet

Yes, I know it's deprecated. I'm using phpExcel in my Portfolio webapp so I'm quite familiar with it. I use it for its math library (Excel functions) and that is not likely to change. These are the same functions that I used in Excel 4 which seems a lifetime ago!

If I could find a charting, drawing class library in php I would prefer to use that instead of phpExcel/phpSpreadsheet. Do you know of any?

Thanks!

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 0
Yes, I know it's deprecated. I'm using phpExcel in my Portfolio webapp so I'm quite familiar with it. I use it for its math library (Excel functions) and that is not likely to change. These are the same functions that I used in Excel 4 which seems a lifetime ago!

If I could find a charting, drawing class library in php I would prefer to use that instead of phpExcel/phpSpreadsheet. Do you know of any?


Sorry, we actually use node, but haven't found any modules that have decent graphing and regression features, which is why I was looking at phpExcel when you mentioned it. Best of luck!
Print the post Back To Top
No. of Recommendations: 6
Hi Denny!

This sounds like a good idea. I guess what you're saying is you'd like to be able to generate the CAGR charts for any stock you come up with. I simply have not put any emphasis into interactive web software in my career (I do more with deep physical/math modeling and currently mainly Python, previously Octave). To my knowledge Javascript would be the main vehicle, as I think maybe jck101 implied, because it's built to be interactive in the browser and has wildly varied choices for charting and other display. The current BMW charts are built with Perl in an extremely primitive fashion. But it keeps working... the code is now over a decade old.

-Mike
Print the post Back To Top
No. of Recommendations: 0
I guess what you're saying is you'd like to be able to generate the CAGR charts for any stock you come up with.

Yes!

I simply have not put any emphasis into interactive web software in my career (I do more with deep physical/math modeling and currently mainly Python, previously Octave).

Most of the website work I've done is interactive screens usually powered by a relational database sticking as closely as possible to Apple's user interface guidelines. Design and graphics are not my thing. I've played around a bit with Python but I'm trying to stick with php which by version 7 is very powerful. I've switch almost entirely to OOP.

To my knowledge Javascript would be the main vehicle, as I think maybe jck101 implied, because it's built to be interactive in the browser and has wildly varied choices for charting and other display.

Javascript is a language I loved to hate because it was so difficult to debug but now Safari has some really good developer tools built in. But you are right, maybe that's the way to go. The latest version of my Portfolio webapp runs on php 7, some Javascript in the user interface, a home grown version of AJAX, and MySQL/MariaDB.

One unsolved problem I have is downloading price history from Yahoo - the crumb! Can you help?

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 3
Holy Guacamole!

Chart.js
Simple yet flexible JavaScript charting for designers & developers


https://www.chartjs.org/

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 0
Holy Guacamole!

Chart.js
Simple yet flexible JavaScript charting for designers & developers

https://www.chartjs.org/


You found the add in my company currently uses for charts and it is pretty good, but a few things it doesn't do well.

It is your resolution but if I were you I'd do a tutorial on a MEAN stack and see how that fit in with what you're trying to do. Mean is Mongo DB, Express, Angular, Node and is fairly common, although I'd maybe skip the Angular and just use the what is in express.

If you do decide to go the javascript route and want other contributors, put it on git or bitbucket and I'd be happy to spend some time on it.

For stock history, check this out:

https://github.com/AndrewRPorter/yahoo-historical

it is in PHP so maybe it would work better for you. Although seems like Yahoo changed their API so maybe not working currently. There are a couple other options for those quotes. Just search github.
Print the post Back To Top
No. of Recommendations: 1
I'm sticking with LAMP. I no longer do any commercial work so it's not worth my while to start learning afresh. I'm happy to use JavaScript so long as I can find a library I can just drop in. I gave Chart.js a quick look and got it working ASAP. I'll see how well it does.

The yahoo-historical is in Python, not php. It uses the new Yahoo API. I'll give it a try.

Thanks,

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 3
Chiming in just to note that everyone on this thread (not me) deserves a few dozen recs for considering this. Thank you!

ThyPeace, yes, I'm still around and reading.
Print the post Back To Top
No. of Recommendations: 6
ThyPeace, all we have to go on is data from the past and some of us prefer to see it in graphic rather than in tabular form. That's what makes Klein charts so useful. We need more of them, on demand. At least I do!

I started my professional life programming mainframes and it was actually easy because we only had about 20 or so instruction to talk to the CPU with. Modern computer languages have hundreds of instruction and we can make up more complex ones on the fly. In investing terms, switching costs become increasingly high -- exponentially! Young people learn the new stuff, old ones want to stick with the old ones.

One way to simplify things is to use frameworks. For someone who likes to write code (me) it is as easy to create one as it is to learn one created by someone else in the hope you'll like it. I'm on the third version of my php framework -- entirely OOP and semantic in design. So I'm stuck with LAMP which has lots of missing features such as a good math library (phpExcel, maybe Python), graphic rendering (Javascript), and other odds and ends. Then there is the increasing complexity of interacting with Yahoo's API, a necessity because Yahoo is still the best source of free price data.

Progress Report

For the graphics rendering I'm going to try Chart.js (JavaScript). I've downloaded the library and got it working.

Python might solve the Yahoo API problem and might even replace phpExcel which is huge and deprecated to boot. Python 2.7 comes installed in Macs and I've installed Python 3.7 as well. I got php to talk Python (more or less).

Now I have to decide to start with the rendering (JavaScript) or with the data acquisition (Python).

Suggestions welcome!

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 0
Hi - I am interested in this endeavor. Any update on this.

Thanks for you continued help.

IK
Print the post Back To Top
No. of Recommendations: 0
Not going so good. I've run into a series of problems.

I'm fairly sure that Python needs to be a part of the solution but there is a glitch, there are two active versions, Apple supports v 2.7 on the Mac but one has the option of also installing v 3.7 which I did. I can launch either but there is a problem, my web apps run on php and when php launches Python, it's 2.7 that runs. I have not found a way to get php to launch 3.7. It was at this time that I got distracted by more urgent things.

Sorry, no ETA.

Denny Schlesinger
Print the post Back To Top
No. of Recommendations: 0
Thank you for your reply. Wish I could help - I am not a programmer. I do know lot of people who do programming for a living. If you can define the help, I can connect you with them and see if they would be interested to help.

Always appreciate your dedication in keeping this going.

IK
Print the post Back To Top
No. of Recommendations: 2
IK, thanks for the offer. I've started a new project that is more important for my own portfolio so the charts will have to wait.

I've been trading options since late 2008 and covered calls have become an important source of income in my portfolio. More recently I discovered that covered calls can simultaneously work as a hedge. The principal objection one hears is "picking up pennies in front of a steamroller" and that's what happens when you do it wrong.

With stocks you are dealing mostly with uncertainty and the BMW Method helps to tilt the odds in your favor by buying well below the mean. With options you are dealing with risk proper because you can calculate the outcome for both, the option expiring worthless, and the option being assigned. What you cannot calculate is the potential opportunity loss which is uncertain.

The calculations are not all that difficult but they are cumbersome and time consuming done with a spreadsheet. My new project is to add a covered call calculator to my Portfolio web-app. The first and easy part is done, uploading the option chains downloaded from the CBOE website.

http://softwaretimes.com/pics/upload-option-chains.png

Today I'm starting on the hard part, converting my spreadsheets to php code.

The calculator does the following

1- Price a number of calls based on likely strike prices and expiration dates

2- Calculate premium (cash) collected, CAGR if the option expires worthless, CAGR if the option is assigned

3- Discard options that don't meet the minimum criteria

4- Order the remaining ones. So far I do this last by eyeballing. I don't know if I can come up with an algorithm for it.

That's the sell side. On the buy side the calculator should check to see if the option is worth buying back. Short call options are decaying assets, the most you can make is the premium collected. If the premium falls low enough then it's worth buying back the call option and to look for opportunities to sell new ones.

That's my current assignment! ;)

Denny Schlesinger


PS: with the kind of stocks I own the above strategy produces between 4 and 5% cash returns which pretty much covers my routine expenses, a good reason to do it right. The major risk is opportunity loss should a stock take off (pennies/steamroller). To mitigate this risk the strike price has to be high enough to make the stock worth selling. Initially I lost several stocks this way, six in all. I have since learned to roll up the option which is the hedging part of the strategy -- you give back the premium but keep the stock.
Print the post Back To Top
No. of Recommendations: 0
Sounds exciting - big fan of covered calls if done properly, I use them all the time, good luck.
Maybe revisit in a month or so.
Print the post Back To Top