Fixed vs Adaptive Parameters in Algorithmic Trading

 

I've been developing trading EAs for about a year now, and one thing I keep running into is the same issue over and over: lagging indicators.

Take a simple trend-following strategy using an EMA Golden Cross and Death Cross. It can perform really well in certain market conditions, but over time it starts to lose its edge because by the time the crossover happens, a big part of the move is already over.


That got me thinking.


Has anyone here experimented with making indicator parameters adaptive instead of keeping them fixed forever? For example, instead of always using EMA 50/200, the EA could continuously adjust those values based on its own internal calculations and recent market behavior. The idea would be for the EA to adapt as the market changes rather than relying on the same settings year after year.

I know this can easily turn into overfitting if it's done the wrong way. The difficult part is finding a way to adapt without simply optimizing for what just happened. I'm curious how more experienced developers here deal with this.


Do you just accept that every strategy will have market conditions where it performs poorly?

Do you use adaptive indicators or self-adjusting logic? If you do, how are you approaching it?

Or have you moved away from traditional crossover systems altogether?


I'd really like to hear how others have tackled this problem or if you've found a completely different way of thinking about it.


The longer I spend building algo trading bots, the more I realize how endless the possibilities are. Every time I think I've seen everything, I come across another idea that I never would have considered.

I once talked to a trader who said he was using satellite images of oil ports and tanker traffic around the world to help predict supply changes before trading oil. My first reaction was that it sounded completely over the top, but the more I thought about it, the more I wondered if there was actually an edge there.

Do you think something like that is realistic for independent traders, or is that the kind of approach that's only practical for institutions with deep pockets?

I'd also love to hear about any unconventional data sources or ideas you've seen people use successfully. The more I learn about algorithmic trading, the more it seems like there really are no limits to where an edge can come from.

 
Gio Rendel Masagca Rivadillo:

Has anyone here experimented with making indicator parameters adaptive instead of keeping them fixed forever? 

There are plenty of adaptive indicators in the CodeBase. Do a search, and test them out. If you find a good one, use iCustom() to code it into an EA.
 
As a breakout strategist, who relys on market movement and volume, The best I was able to incorporate was ATR filters with spacing multipliers, expansion filters especially coupled with envelopes, spread detectors and more. These can give an idea when market moves out of range or consolidating, expanding and contracting, and your ea can adapt accordingly. But no, I havn't seen an ea change core logic into different modes, which sounds like my next project..😆 . Yah those oil traders look at the barrel level from the top to see if the oil is sitting or distributing, if levels are going up or down.
 
Gio Rendel Masagca Rivadillo:
I once talked to a trader who said he was using satellite images of oil ports and tanker traffic around the world to help predict supply changes before trading oil.
Have a look at the U.S. Oil Fund ETF (USO) for the purpose of leading Micro WTI Crude OIl futures (MCL).
 

I think that the thing about adaptive EAs isn't about adaptation; it's more about when to adapt... Under which circumstances, etc...

 
Gio Rendel Masagca Rivadillo:

Has anyone here experimented with making indicator parameters adaptive instead of keeping them fixed forever? For example, instead of always using EMA 50/200, the EA could continuously adjust those values based on its own internal calculations and recent market behavior. The idea would be for the EA to adapt as the market changes rather than relying on the same settings year after year.


If you haven't heard of neural network. Have a look at this article: Neural Networks Made Easy - MQL5 Articles

It is super useful and interesting. Based on this article you could basically feed your EA constantly with data in order to learn and adapt (e.g. parameter inputs change) but the down side of it would be overfitting. So, you have to be careful with this.

Hope that's helpful.

Neural Networks Made Easy
Neural Networks Made Easy
  • 2020.03.11
  • www.mql5.com
Artificial intelligence is often associated with something fantastically complex and incomprehensible. At the same time, artificial intelligence is increasingly mentioned in everyday life. News about achievements related to the use of neural networks often appear in different media. The purpose of this article is to show that anyone can easily create a neural network and use the AI achievements in trading.
 

Gio Rendel Masagca Rivadillo:


Has anyone here experimented with making indicator parameters adaptive instead of keeping them fixed forever? For example, instead of always using EMA 50/200, the EA could continuously adjust those values based on its own internal calculations and recent market behavior. The idea would be for the EA to adapt as the market changes rather than relying on the same settings year after year.


This is like adding prediction to your EA under a different name. I read the work of many great traders but their focus was never on finding the optimal value. Better results come from diversification, systems oriented for longer time frames, wider stop losses to prevent frequent whipsaws. Also you can split your money in several portofolios and each one of them will be traded with a different system. I hope that i am clear enough. To focus on one instrument , like gold, and trying to squeeze every dollar with optimizations it's a waste of time. 
 
Mr Valentin Michel Draperi #:

If you haven't heard of neural network. Have a look at this article: Neural Networks Made Easy - MQL5 Articles

It is super useful and interesting. Based on this article you could basically feed your EA constantly with data in order to learn and adapt (e.g. parameter inputs change) but the down side of it would be overfitting. So, you have to be careful with this.

Hope that's helpful.

I've been hearing about this neural network/machine learning thing for a while now, but wasn't really curious about it. But I think I will give it a dive and see what it can do. Thanks!
 
Ryan L Johnson #:
Have a look at the U.S. Oil Fund ETF (USO) for the purpose of leading Micro WTI Crude OIl futures (MCL).
Thanks!
 
Isaac Uriel Arenas Caldera #:
I think that the thing about adaptive EAs isn't about adaptation; it's more about when to adapt... Under which ci
Can you elaborate more and give example of an EA knowing "when to adapt"? would it be like let's say for example an EA changing core logic when market regime shifts? like from trend trading to mean reversion.
 
Daniel-gheorghe Muresan #:
This is like adding prediction to your EA under a different name. I read the work of many great traders but their focus was never on finding the optimal value. Better results come from diversification, systems oriented for longer time frames, wider stop losses to prevent frequent whipsaws. Also you can split your money in several portofolios and each one of them will be traded with a different system. I hope that i am clear enough. To focus on one instrument , like gold, and trying to squeeze every dollar with optimizations it's a waste of time. 
Honestly, I just trade XAU and SPX mainly, sometimes DJI or NQ. I used to trade crypto back in 2020 during covid however I find that real money is made in trading traditional markets. I'm curious as to how your approach to trading is. Can you share how many markets do you trade? Sounds like you are more like a positions trader rather than just swing.