Search
× Search
Monday, December 23, 2024

Archived Discussions

Recent member discussions

The Algorithmic Traders' Association prides itself on providing a forum for the publication and dissemination of its members' white papers, research, reflections, works in progress, and other contributions. Please Note that archive searches and some of our members' publications are reserved for members only, so please log in or sign up to gain the most from our members' contributions.

Talking Trading Strategy

photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 21, 2016

Recently I put out an article that might interest some. https://www.linkedin.com/pulse/stock-trading-strategy-experiment-guy-r-fleury In it is described a variation of a MACD trading strategy with a vision for the long term. It answers questions like: Can a trading strategy last? Can a technical indicator prove to be profitable over the long term? Can a trading strategy not break down with time? Can I do this using chicken like trading procedures? I've answered yes to those questions. How about you?


Print

20 comments on article "Talking Trading Strategy"

photo

 Guy R. Fleury, Independent Computer Software Professional

 Friday, January 22, 2016



Here is the second part of the stock trading strategy experiment.

https://www.linkedin.com/pulse/stock-trading-strategy-experiment-ii-guy-r-fleury

It describes what happened when the MACD trading strategy was applied to a small portfolio of 10 stocks. Naturally, 1 of the 10 stocks was assured of winning, it was the test candidate ABT needed to debug the code. So, there will be no surprise if ABT again wins the day.

It is the other 9 stocks that should reveal if the trading strategy not only made sense, no only be profitable, but show that it was worthwhile. That whatever compromises made in the design of this trading strategy, the methodology shined where it counts, on the bottom line.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, January 23, 2016



Some might think that I uncovered something no one knows about the MACD, or that I found the perfect combination of parameters to make it an outstanding indicator.

Well, sorry there. The answer is: No. It is the MACD, just plain and simple, with almost no predictive powers at all, except it will catch the long term drift.

The MACD code snippet used was provided in the first post along with the trend index indicator. Nothing exceptional there, nothing that has not been seen or done before.

For me, a simple copy and paste of two blocks of code, and voilà a complete trading strategy. And as was also shown in the first post, not that productive a strategy either. Something that anyone would or should throw away.

It is the what you do with it that counts, do you, or can you use it as a backbone for something or not, or at first glance effectively throw it away? I think I've been creative in the design of this strategy and use of this foundation.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, January 23, 2016



Even after I refined the MACD (adding code) for a more productive outcome, it still is something else that matters most. It is the what I want the strategy to do within the confines of the MACD and the trend index.

Combined, you have a lagging oscillator over another lagging oscillator. Always late to the party. But still, a contraption that technically could follow a “self-defined” oscillating trend over which another oscillator could provide entry points used as decision maker, within the constraints of having sufficient funds in the account to execute a trade. Would this be perfect? Certainly not, but that is not the point, that is not what I'm going after, is it?

… more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, January 23, 2016



The following chart depicts the profit distribution based on the MACD value at trade entry time. Red dots are % lost while blue dots are the % won achieved for each of the 1,079 positions at end game.

.#1 ABT MACD Profit Distribution

http://alphapowertrading.com/images/divers/TI_ABT_Jan18_MACD_Profit_Distribution.png

The above chart says that yes there is a tendency to buy slightly below the zero mark. However, most trades are centered around zero. I could not even say if such a distribution is different from random. And this is a major statement. It is like saying that the way the MACD is used, whatever its parameter values, has close to no predictive value.

So, have I found something in the MACD no one has seen before? No, not at all. Is there a parameter in the MACD that has trading significance? No, on that one too.

… more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, January 23, 2016



In the previous chart, notice that the red dots are centered around the 0% (horizontal line), the stop loss in action. The MACD's profit center of gravity is located near 100% and slightly below zero. This is understandable, the trade triggering process required that the MACD cross the signal line from under zero. And this signal crossing is always lagging.

Nonetheless, this too becomes another area of study. Can I shift the MACD's profit center of gravity higher (more profits) by somehow shifting the decision making procedures triggering a trade? Interesting. Can I move the blue dots higher, on average, or all of them? If I want more profits, that is what I will have to do, modify the trading script so that it will allow moving most blue dots and shift them higher whatever the MACD value may be.

As trading strategy developer, my job is not necessarily to outguess the market, but to end up with the loot, that it be in cash, in shares, or in my case both.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Sunday, January 24, 2016



The whole point of designing a trading strategy is that you want to win. You don't care so much what the method is or will be. It is just that you want to know “in advance” you will win, no matter what.

That is the hard part of the game, knowing that what you are going to do for the years to come will end up as being not only profitable, but above average profitable. That is the quest, to generate alpha due to your own unique set of skills.

The how you get there is a totally different question.

That I tell you: use an MACD as backbone for your strategy and obtain impressive long term result (well just did). But still, it is up to you to find your comfort zone. All I can say is it is possible, and here is a simulation over the last 20 years that says it can be done.

You have to generate some alpha, otherwise leave the job to someone else, at minimum to someone having for aspiration a positive zero alpha or close to it: buy an index fund.


photo

 Jorden Tim, Financial Advisor at FOREX

 Sunday, January 24, 2016



Please Register Here for Free Forex WhatsApp Signals :

http://goo.gl/pe2cqW


photo

 Guy R. Fleury, Independent Computer Software Professional

 Monday, January 25, 2016



Here is an interesting article:

http://www.marketwatch.com/story/how-missing-out-on-25-days-in-the-stock-market-over-45-years-costs-you-dearly-2016-01-25

just in case some missed it.

Anyone could do the same analysis concerning their trades. Simply take out the top and/or bottom 5% of all your trades over the past 20 or 25 years. You will see how much impact they had, and how important they were in achieving your trading success.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Monday, January 25, 2016



In a previous post I stated “...I will have to modify the trading script so that it will allow moving most blue dots higher...”. Yes, that will do it.

I am debugging on one stock, in this case ABT, a price vector with 5,184 EOD closing prices. Since the total profit generated has to answer to: Ʃ Profit = Ʃ q*Δp, and due to the limited initial capital $200k, if I want to increase profits, I will need to reinvest trading profits.

I can increase the bet size q*p as I go along depending on the strategy's ongoing profitability. To increase profits, it should be evident that I need to either increase the average Δp, average q or both. Some neglected parameters here are n and Δt. Meaning I could also reduce the holding time, increase the number of trades or both. All ways to increase performance. If good (debugged), then I can apply to the portfolio matrix (size: 5,184*10). So, I'll be back.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Tuesday, January 26, 2016



The test results are presented in the same format as earlier. This way a strategy comparison can be made. Is version 03 really better: Σ(H(MACDv03).*ΔP) > Σ(H(MACDv02).*ΔP)? The answer is: definitely yes.

.#1 MACDv03 Summary Report. January 25 test.

http://alphapowertrading.com/images/divers/TI_Jan25_MACD_v03_Summary.png

The last line of the above report gives the added value, and it is more than reasonable for a few lines of code. I particularly like some of the exit techniques used in this one. More refined. Here are two representative charts:

.#2 CVS MACDv03 January 25 test.

http://alphapowertrading.com/images/divers/TI_CVS_Jan25_MACD_v03.png

.#3 LMT MACDv03 January 25 test.

http://alphapowertrading.com/images/divers/TI_LMT_Jan25_MACD_v03.png

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Tuesday, January 26, 2016



The point to make is this: I dealt with the whole payoff matrix as a block of data, its 51,890 decision points. There is some randomness in the exits, a delay gratification used by bumping an acceptable and accepted exit to wait another day or more for an even better exit should it find it. So before doing the test, I also change the seed of the random number generator in order to have the trades fall where they may.

I think chart #1, in the previous post, shows quite impressive numbers, even if I have to say so myself.

Here is the interpretation of the previous portfolio report. The MACDv03 is definitely more productive: Σ(H(MACDv03).*ΔP) > Σ(H(MACDv02).*ΔP) performance wise.

My intention was to increase the number of profitable trades at the portfolio level without even seeing 9 of the selected stocks. Mission accomplished: 4,525 trades were added over the 20-year time span. More positions were closed, adding 1,962. The percentage of winning trades increased.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Tuesday, January 26, 2016



Closed positions added some $59M compared to the January 18th test, another $15M in profit is in still opened positions for a grand total of $74.8M added to portfolio profits.

The system accumulated more shares, 536,478 more, collectively valued at $41M which was added to the existing inventory. About 2 alpha points were added to the January 18th test, pushing the portfolio's CAGR higher to 27.96%.

Overall the January 25 test generated $272,302,129 in profits from 15,661 trades. The performance differences are summarized in the following table.

.#1 MACDv03 Summary Report. Differences. January 25 test.

http://alphapowertrading.com/images/divers/TI_Jan25_MACD_v03_Summary_Differences.png

The added portfolio profits could be viewed as the opportunity cost of not adding the code modifications. Providing a kind of incentive to always search for more, new and at times simply different ways to reach your objectives.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Tuesday, January 26, 2016



It is my contention that anybody can do this. If I can, be assured, anyone can! It only requires a slight change in perception.

The question might be: how would you design a trading strategy that has for mission: to accumulate shares for the long term while trading over the process? And if you look closely at how you could do this, you will figure out the same things I did.

Long term, the Buy & Hold people win the game, not the day to day traders. But, the Buy & Hold is limited performance wise, your best expectation is to achieve about the same as an index fund if you diversified enough. If you want more, you will definitely have to do more.

This thing says trade all the swings and keep some shares for the long haul. Based on the numbers presented, it does not seem like that bad an idea.


photo

 David S. Moore, PhD, Forensic Formaldehyde and Finance Remediation, Pharmacologist, Spectroscopist, Complexity Theorist, Propylene Glycol FE

 Tuesday, January 26, 2016



.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 28, 2016



Time for some analysis. It took 2 days to design the first productive version of the program MACDv01. Another 3 to add the improvements that generated Strategy Experiment II (MACDv02). Made some minor improvements overnight which resulted in MACDv03, the one used in Strategy Experiment III, where I ran the program once on the 10-stock portfolio, and then reported the results. All of it was being done live.

Most of the development time was spent “thinking”, on how will I do this or that. I find programming relatively easy. It is more a matter of having a concept in mind and then find a way to translate it to code. But, even though the concept is simple – accumulate shares for the long term while trading over the process – it becomes more complicated when you want to put it to code. Because there, nothing is vague. An equal sign will show no mercy! And it has no grey zones either, it lives only on: is or not. It does not even have a was.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 28, 2016



The code that came out of Experiment III is just that: code. Software routines with conditionals that do what they were told, nothing more. The important part is not the code, it is the trading philosophy, the methodology you want it to convey. Once you have that, it is easy to code.

What I originally wanted to show was that even if I used an indicator or two, the core trading philosophy would still hold. Another way of saying: using your own technical indicators, you should be able to do about the same thing.

This program (MACDv03) came after this other program: DEVX8, which was converted to total randomness: random-like entries, random exits, and random holds. It even has an exit procedure where a trade is considered lucky if eventually it finds an exit at all.

The primary intent in this “experiment” was to show that it could be done using ordinary technical indicators. The basic code snippets used (a copy and paste) were provided in Strategy Experiment I.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 28, 2016



It is the trading rules I added that made the strategy distinctive. I gave it the directives to follow, the necessary code to translate my view of the game, the what it can do, and the how I intended it to react to price movement.

There were 2 surprises in this for me. One: how easy it all was. Two: it is even better than DEVX8. An unintentional outcome. I was expecting something that would perform less than my preferred program. I will now have to reconsider. Also, MACDv03 gave a few new ways to handle exits and extend holding functions.

Overall an interesting and worthwhile experiment.

Why I'm not selling my programs?

They would be expensive. 1) Try, for instance, to put a price on MACDv03 with its bottom line as presented in Strategy Experiment III. And my improvements will do even better.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 28, 2016



. 2) I don't want some one else mishandling my program, trying to do things for which it was not designed, and then having them come back to me with: it's your &%*# program. I designed it, and I know exactly what it does and will not do.

. 3) It is spaghetti code. I don't program clean and tidy. I don't even optimize for speed, or indent properly as I was taught to do. I just make the code work, do what it is suppose to do.

. 4) I simply wanted to show that it was possible. Presenting that it could, might entice you to investigate and find your own ways of doing it, the equivalent, or better. You now have an example that says it can be done that way too.

. 5) MACDv03, for me, opens new doors, where more code could be added to increase performance even further.

From here, design your own long term strategy. But always keep the end game in mind. It is not the trade here and there that matters, it is your ending payoff matrix: Σ(H.*ΔP) and how big it will be.

...more


photo

 Guy R. Fleury, Independent Computer Software Professional

 Thursday, January 28, 2016



The writing space here is limited. It would take a book to describe the underlying principles involved, the trading methods used, and expand on the reasoning behind it all. It is why I wrote one.

All I can do here is give bits and pieces of it at a time, hoping those who follow this discussion will find a way to connect the dots. I don't think it is that complicated a trading strategy. I would say it is accessible to anyone wishing to build a long term portfolio. I find in it the making of a trading philosophy. From its long term perspective makeup, it has the potential to rival the best long term trading strategies out there. At least the strategy has shown it could last over a time span of 20 years, stay profitable, and not break down, even if it is a glorified Buy & Hold with a weak hold.


photo

 Guy R. Fleury, Independent Computer Software Professional

 Saturday, January 30, 2016



For those interested in this topic, I've put a more detailed explanation on my website. Follow the link: http://alphapowertrading.com/index.php/tests/194-a-stock-trading-strategy-experiment-iv

Please login or register to post comments.

TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS
Terms Of UsePrivacy StatementCopyright 2018 Algorithmic Traders Association