Can this strategy coded to an EA, or not? And is it useful at all?


So, I like to ask your opinions and grate comments and suggestions. I have wrote about the same in ForexFactory Forum, and I got also valuable inputs there, but I also like to hear from you here in this community.

What I like to know exactly is whether what I am suggesting is an ok and acceptable trading strategy or it is just a time wasting. And also, if this can be coded so I can backtest it and play with it to adjust its settings and find the best options for it, or not.

I have discussed this in the following post in FF:

Since I am blind and cannot rely on technical analysis or reading charts or the other amazing trading stuff that need visual engagements, I have relied on the price and price movements only. So my work is only with numbers. I came up with something I think might be a trading strategy, and I like to know your thoughts about it.

It is basically that I take a specific trading instrument and read it's historical data. I collect accurate information about it's movements and how many pips it is trending to one direction before it pull back. I do this in a long time period. So if I found out that this instrument usually range in 400 pips every two months and that in these 400 pips it is always pull back more than 66% before it continue, then I will consider that the top of these 400 pips is my signal to go short, and the bottom is to go long. My SL and TP will be 33% of the range.

Let me explain this further with the GBPUSD as an example:

I head over to the and bring the GBPUSD historical data up. I read the historical data for this pair in more than three years. I found out  that the GPBUSD usually when it have travelled 400 pips seems to have the need for pulling back 66% of these 400 pips before it travel back in same directions. This if it not just change it's direction and continue the journey for more than these 66%. This happen usually every two months.

Well, now I have this in mind. Now I just need to read the last two months of historical data to find out how many pips was the range, and where the price right now is. Let us say I found out that in the last two month the GBPUSD have ranged in 350 pips. This mean I cannot enter the market since I am waiting for a 400 as a minimum pips range for this pair.

Second senario is I find out that it have ranged in 400 pips but now the price is in the middle so to both directions there are no 400 pips. Again here I cannot enter the market.

Third senario is that the GBPUSD have ranged in more than these 400 pips (let us say 500 pips) and right now it is in the bottom of these 400 pips that I have considered as my minimum range. That could be if the pair have pulled back 100 pips from these 500 pips, so now we have 400 pips before us. Now I enter a buy and my SL and TP is 132 pips, and those are the 33% of this range that is left from the overall range.

And of course if it was in the top I will have entered a sell.

Well, as you can see, I do not have many possibilities to enter the market. Just in two or three cases. The rest is not trade until my conditions will be met. This can cause me to not be able to enter the market for one pair in a year only 8-14 times. I will solve this by trying to trade all the trading instruments I can. It could be 28 or 30 pairs.

Of course after I have analysed for each pair it's own calculations.

Now the question is do you think this approach is profitable? Or I am just wasting my time and yours by posting this topic here?

To hit an SL is not a problem for me since I understand that this market whatever you do you have to accept sometimes losses occur. What I need that my TP have to be more than my SL. So do you think I can acheav this with this strategy?

Also, can this be coded to an EA, or this strategy have in its main ideas something that can not be programmed and just manual interactions is possible?

You know in an EA this idea will be clearly tested, since we can adjust the settings in so many ways. An EA have to be coded in a way that the user have to be able to put those calculations into it. So for how many bars it have to look after, and what is the minimum range that is allowed to be considered, and what is the percentage of this range is the SL and TP, and so on.

Also, it will be really useful if it possible to let the EA look back in historical data, and try to find out the range that is the average for the specifyed period. So if it look back in five years data, it have to found out what is the average range for every 40 days, or 70 days, or something like that. This average can then be used as our signal range. 

I mean if the EA can be coded so it allow the user input those to it, and also it have a mode where it have to try to find those calculations by itself.

So, do you think this possible to be programmed? And how?

I am without any knowledge about coding, so I like to hear your opinions and meanings about this. And if any is interested to code this for me I will also highly appreciate it.

Thanks for reading this long post. Looking forward to your comments and suggestions.

السلام عليكم و رحمة الله و بركاته

In general you have good working concepts
I would recommend reducing the complexity of the described strategy
Divide it into relatively independent parts

For example first separate the work with market data and work with grids
Programming grids is much easier than programming automatic market analysis

Moreover grid calculations and their risks/results are almost 100% precise
Market data calculations and predictions/forecasts => never for many reasons


It also makes sense to focus on working with just one pair rather than many

By the way I did not see anything interesting in that thread on FF

Best wishes anyway

و السلام عليكم و رحمة الله و بركاته


Even if you don't plan to ask a freelancer to code this EA for you read this to make up your mind about what is needed so that in idea becomes a working program or EA:;    // EA-freelancer;    // Indi;     // How to Order a Trading Robot in MQL5 and MQL4;     // Quickstart for newbies;     // Schrittweiser Leitfaden für Anfänger zum Schreiben eines Expert Advisors in MQL5

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2022.02.26
The largest freelance service with MQL5 application developers
I must admit, you are already on the right track regarding this trading strategy.
You can see that this strategy is widely used, you can even see MT5 and MT4 top signals using the strategy you described, you only need to copytrade the signal if you want to trade with real money without the need to operate the ea.And if you are looking for an ea with your idea, I believe someone already made it, you just need to do some research.

Good Luck.

Thank you very much for your comment. I thought that this idea is not complicated. I thought it is rather so simple that it is not so difficult to code. You know strategies that rely on different indicators for entering the market, and indicators for SL and indicators for TP, I thought that will be the big deal for a coder.

This idea I thought will be straightforward and not need so much work and effert.

So I am totally wrong out of what you are saying.

Carl Schreiber

Thanks for your post, but all the links you gave me don't work.


Ok this give me an encouragement forward with this idea, so thanks for your input.

MQL5 forum
MQL5 forum
MQL5: Forum on automated trading systems and strategy testing
I like to hear more comments and perspectives about this approach. Suggestions and ideas to make it better. Or and also discouraging comments is welcome. I also like to give up this market if it is impossible, and if this idea is just basic playing with numbers.

Because my idea might be so simple and without any reason, and that the market is more complicated thank this.