My proposed EA is built on the "threshold" channel idea. (Also.)
So: as one enters a new Bar (suppose, one hour time frame, eurusd), the price at the Open is known. It is also known that (eventually) the Bar will develop a High and a Low.
So, put a 1/2 channel of some width above the Open, and (similarly) a 1/2 channel width below the Open.
(The 1/2 channel widths could be optimized for currency pairs and the values saved, as "first pass".)
The prices will break either the top or the bottom channel threshold lines.
Assume that the top line was exceeded.
Hoping that this (micro) trend will continue, a Buy order will go out with a TP and a SL. (The SL clearing the stop_level.)
(The TP and SL for various currency pairs could be optimized also: "first pass", also.)
If the order exits with a SL, do nothing and wait for the threshold to trigger a new order again.
If the order exited with a profit, put a 1/2 channel above the current "highest high" achieved inside this Bar.
...and repeat until Bar[0] becomes Bar[1].
The Sell side is similar, in the down direction.
Further: an option might exist for the user, to let the TP and the SL be expressed as "the current measured spread, times an optimizable constant, to deal with volatile markets.)
[Single currency optimizations (if undertaken) are "first pass", since in a later section, "small Bars" will be eliminated from the sample space.]
Modifications:
Use trailing stops, activated after x amount of gain, that move the stop and TP by an x amount also. [The "x amount" might be optimizable [first pass], and the TP and SL may be linked to spread size...]
Incidentally: at any one time there is only one order out, and as a Bar is entered, any possible open orders are closed before the 1/2 channels are put in place at the Open value].
Meanwhile: Do not send out new orders close to the expiration time of the Bar, because: there might not be enough time left in the Bar, to advance by an "x" amount, since open orders will be closed as Bar[0] now becomes Bar[1].
Why all this order closing, and a relatively low time frame?
With the 1/2 channel idea, the two trigger thresholds recede from each other, approaching the Bar's High and Low.
Were one to use a time frame of a Day, prices might (sort of) rise for three hours. Then, if the market reverses, the Sell "1/2 channel threshold" will not be reached for quite a while.
An hour time frame "resets" the position of the 1/2 channels, via the new one hour Open.
(Of course, a similar "reset" result could be achieved by the "full channel" method: Here, after the Open of the Bar, a top and bottom 1/2 channels are placed above and below every OrderExitPrice, regardless if the ticket exited with a loss or a gain; and the EA waits to see if it should Buy or Sell, via which threshold will be broken next (top or bottom). [repeat]
But, why exit every hour Bar?
This, to optimize the EA, via a selection process from multiple currencies.
For (notice): Bars come in essentially three size ranges: small, medium and large.
Usually, small Bars occur in succession (as do medium size Bars).
And (of course) the EA (hopefully) will profit, whether the Close was higher or lower than the Open.
But: larger the Bar, the larger the profit potential.
So, should one monitor the prices of (say) 10 currency pairs, a run of small Bars in a currency pair might be avoided, by trading (up to four) of the currency pairs, when one is in a patern/sequence, where there are no many small Bars follow each other..
To identify "small Bars" (mechanically): measure the High - Low size of the last 300 Bars of a currency pair, at the Open of Bar[0]. Sort this array. The lower 30% [as an example] is the small Bar range. (This is just an illustration. The selection method for trading follows...)
From the 10 candidate currencies, check each pair's Bar[1] for $$ value generated, as if a full lot was traded.
Use the top four value generated Bar[1]-s as a "diversified prediction" on how to divide the total lot/volume to invest, between these four traded pairs, for the next one hour [half channel or full channel methods]. (If there are duplicate values for some Bar[1]-s gains in the selection process, "pick four".
While MT5 could back test this multi-currency EA, in MT4 one could run 10 instances of the Tester (one for each of the 10 candidate currency pairs).
Then, a multi dimensional array of ones and zeroes could flag/mark which one hour Bar was active as the four currencies were funded in the course of the back test run.
From this, a "total gain" could (theoretically) be found via the set: one hour "Bar and pair" actually traded.
But this might be too much coding effort.
It would easier to just get a feel for how the EA would perform, by running it as a Demo for a week or so.
Thus avoiding the labor intensive "summing the one hour Bar gains for the four (varying) pairs" in the back test.

So, hope that you like the idea(s).

One more thing: some people avoid volatile markets; instead of linking the SL and TP to the current spread, as I mentioned, [as an option].
Avoiding fast markets might be a good idea, in general.
But for me, I prefer to use the "external stop loss".
(?):
Have the EA keep track of the highest account balance and equity after any deposit or withdrawal to/from the account.
Then, if the balance or equity falls from these reference values by a user set percentage (say: 20%), the EA stops trading and sends out an Alert of some type(s).
This "anti-Martingale" strategy might have saved many a trader.
(And the EA may be re-started later, possibly after checking on a "cent account" to see how it might fare in the future.)
Well, hope to hear from you.

bellco
Перевести на Английский Показать оригинал