Hello all,
It seems that my previous inquiry was removed by the moderators as they wanted to see me invest time and effort in my problem. I have invested time and effort in the more "algorithmic" parts of my project, but now I need a bit of help in controlling the charting of stock data.
Here is my situation. For the past 20 years, as an Electrical Engineer with an interest in the recognition of stock trading patterns, I have worked with Technical Analysis. I have worked for startups and written software that can recognize trendlines, technical patterns, and Elliott Waves. I have done all of my previous work in C# and absolutely love the topic. It gives me something to do besides my day job as a university professor in the Department of Computer Science.
I have been enamoured with Mathematica since the mid 2000's. However, for some reason, I have found it difficult to learn, compared to all the previous (traditional and not so traditional) languages I have mastered (Basic, Forth, C, C++, C#). One of my problems is that I was always impatient to get the work done and I could do that with something like C++ with my favorite, C#. It could take me a couple of 100's of lines, but the process was rather simple.
But with Mathematica, it is a different mental approach. What I love with Mathematica, is that I can take those 100's of C# lines and compress them into 10 lines (or less) of Mathematica. The problem is that, while I can write those 100's of C# lines in an hour or so, it takes me a week for me to get my head around all the functions, tables, lists, etc,,, I use in Mathematica.
The final result in Mathematica is like a work of art. It is beautiful, it speaks to my mind. The work in C# produces a beautiful application, but I don't find the program itself that fascinating. It is a bit like pointillism. The pixels (the programs or lines of code), in themselves are not that interesting, but the overall effect (the application) can be quite stunning.
In Mathematica, you don't have pixels, but swaths of paint of different colors (List, Map, BlockMap, etc...) and combinations of a few swaths (a single line of Mathematica can be simply mesmerizing). However, it can take hours to design that swath or understand someone else's swath.
I thus decided to delve into Mathematica and I wanted an interesting project to do so. I chose to rewrite my Technical Analysis Suite in Mathematica. My C# version, displays stock data, indicators, patterns (like channels, triangles, pennants, flags, etc...) and now can analyze all the potential Elliott wave patterns present in a stock move from one time (minute, day, week or month) to another.
I plan on taking a large number of stocks over a certain period and generate all of the possible Elliott wave patterns that were created for each stock during that period. Then I will feed to patterns (and their subsequent result) into an AI algorithm to create an Algorithm that can then be used to determine if a particular stock should be bought or sold.
I have never been convinced that a single individual (Ralph Nelson Elliott) could, before the advent of computers, figure out how markets work. But, I figure that his theory of Elliott Waves could be tested.
The problem, from what I understand, is that, if you put five Elliotticians (as they are called) into a room and show them a stock chart, you will get 5 different interpretations, all of them acceptable!
My view is to take away the human element, find any and all potential waves, then feed them into an AI machine and see if our powerful modern-day algorithms can figure out which patterns have strong predictive powers.
As such, I have put in a lot of work in converting my C# code to Mathematica. I can't tell you how amazed I am in the power of Mathematica, taking thousands of lines of C# code and reducing them to about a dozen lines of Mathematica code!
Given a stock over a period of time, my code will determine ALL the potential Elliott Wave patterns that occurred for that stock during that period of time. At some point that information could have been used to make trading decisions.
However, my interest is in deciding, once and for all for me, whether or not the different patterns mentioned in the literature (things like the bat, the butterfly, the crab, the shark, etc... from "The Harmonic Trader" do occur and do have predictive power. I have found that they do occur, and often. As for the predictive power, I see anecdotal evidence, but would like to take the decisive step of simply feeding mathematically provable patterns (meaning that the patterns I feed are ALL the possible wave patterns in the chart) into an AI program and generating an algorithm (e.g. Neural Network) that could then tell us what its predictive power is.
We could also see if the Support/Resistance prices generated by the Elliott Waves are also validated.
In order to do so, I wanted to have the ability to display the stock on a chart. I have used Mathematica[s InteractiveTradingChart which offers a great way to display stock data. My problem is that InteractiveTradingChart shows the chart in one short. What I want to do is to show the chart incrementally. What I mean by that is that I want to show the first bar, and then, after a short period of time, show the next bar, and so on. I might want to show each new bar after a delay of 5 seconds (or any other time period) in order to simulate a ticker. Also, my algorithm works in an incremental fashion. You feed it a new bar and it figures out what new information or new Elliott Wave may have emerged from the new bar. All I've been able to do so far is ask the chart to redraw itself, with the new bar, But I do this by reloading the FinancialData (which takes a while) after having updated the last day of interest. This is not satisfying. I would like to read all the data in one short (reading weekly bars for instance, from Jan 1, 2020 to the current day) and then feeding the bars one at a time to the chart once every 5 seconds.
I don't know how to programatically control the display of the chart. There is a little window on the bottom which can be slid left or right or stretched to show more or less of the stock. One approach I an thinking of is to start the window on the first day of the stock data I have and every 5 seconds, change the change the right edge of the window to the next day. In this way, it would look like the chart is updating itself every 5 seconds.
Can anyone help with my problems?