JLPi Grid EA

 

Hello,

first a short introduction:

I am a trend follower and have profitable EA for such purposes, but as real trend following systems they don't trade very often (in average once a week per EA), so I have some time to check the forums for new ideas and test also some ideas. Here is one.

I am not fond of systems that are averaging down like martingale EAs or even Grid EAs but I am at least testing some of them because you need to keep your mind open.

Grid systems have at least the advantage of not increasing the lot size when the market is moving against them, so they will resist better in adverse conditions.

Then I made my own Grid EA. I know that others exist but I prefer to do my own because I can better control the behaviour of the EA.

Many grid Eas send a lot of limit orders at the beginning but I prefer to keep the grid "in memory" and send the orders when the price is reached. (I think that the brokers will also prefer that)

I also filter the direction of the orders according to a long term moving average. So if the trend is up I will send only Buy, and if down only Sell.

I have also an ADX filter to send the orders in both directions if the trend is too weak, but for the moment I keep this parameter low because the filtering according to the MA only looks OK.

I also close the grid regularly in order to avoid too big positions open against me. So I close my grid when I have got 5% increase in my equity.

I have run it on USDJPY H1 (Time frame shouldn't matter) and it gives steady profits. The parameters value are as default.

Please test it on other pairs, make comments remarks, suggestion for improvement.

I will keep the "official" version on this first post.

Have fun and good testing !

(edited)

new version with variable lots size, a bug corrected for Intervals with JPY pairs, and different intervals if the pair is trending (TrendInterval) or ranging (TrendInterval*MultiplierTrendInterval)

(edited 2)

new Parameter MicroLots to tell if you accept 0.01 lots or not

(edited 3)

new Parameter MinLots for the starting size Lots. default is 0.1 but you can put 0.01 for IBFX for instance.

(edited 4)

New parameter StopLoss. If set to 0 it means no stop loss as it was before and a value >0 means a stop loss of this value in points.

Files:
jlpigrid.mq4  8 kb
 
Hello,

first a short introduction:

I am a trend follower and have profitable EA for such purposes, but as real trend following systems they don't trade very often (in average once a week per EA), so I have some time to check the forums for new ideas and test also some ideas. Here is one.

I am not fond of systems that are averaging down like martingale EAs or even Grid EAs but I am at least testing some of them because you need to keep your mind open.

Grid systems have at least the advantage of not increasing the lot size when the market is moving against them, so they will resist better in adverse conditions.

Then I made my own Grid EA. I know that others exist but I prefer to do my own because I can better control the behaviour of the EA.

Many grid Eas send a lot of limit orders at the beginning but I prefer to keep the grid "in memory" and send the orders when the price is reached. (I think that the brokers will also prefer that)

I also filter the direction of the orders according to a long term moving average. So if the trend is up I will send only Buy, and if down only Sell.

I have also an ADX filter to send the orders in both directions if the trend is too weak, but for the moment I keep this parameter low because the filtering according to the MA only looks OK.

I also close the grid regularly in order to avoid too big positions open against me. So I close my grid when I have got 5% increase in my equity.

I have run it on USDJPY H1 (Time frame shouldn't matter) and it gives steady profits. The parameters value are as default.

Please test it on other pairs, make comments remarks, suggestion for improvement.

I will keep the "official" version on this first post.

Have fun and good testing !

Hello, jlpi! Have you backtested your EA? May I ask, what trend following EA's do you use?

 
Trader83:
Hello, jlpi! Have you backtested your EA? May I ask, what trend following EA's do you use?

Yes I have backtested it on USDJPY H1

Attached is the result. Not marvelous but steady. I requires of course a certain account size.

The trend following EA's are personal ones. And I don't give them for free to the community because it has required a lot of time (not to code but to find the proper ideas) and the key idea didn't come from a forum.

Files:
jlpigrid.htm  67 kb
jlpigrid.gif  7 kb
 

JLPi,

I appreciate you posting your EA. I will try and start testing on EURUSD and AUDUSD soon. Should I use the default OOTB settings or do you have optimized settings / presets?

TimeFreedom

 

Hi JLPi, the system looks good - have you tested on other timeframes / pairs ? would running on a lower timeframe mean more trades and thus more profitable ? Just a thought. Cheers

 
TimeFreedom:
JLPi,

I appreciate you posting your EA. I will try and start testing on EURUSD and AUDUSD soon. Should I use the default OOTB settings or do you have optimized settings / presets?

TimeFreedom

I think that you should first try with the default settings because it is good if it is robust with the same settings accross different pairs.

But feel free to change them because it may be needed to be adjusted by pair.

 
leeb:
Hi JLPi, the system looks good - have you tested on other timeframes / pairs ? would running on a lower timeframe mean more trades and thus more profitable ? Just a thought. Cheers

Normally time frame should'nt affect because it is not using any indicator related to a time frame but just price levels. So the trades and results are the same with any time frame (normally).

To get more trades you need to decrease the value of "Interval" but it may play against you if the trend is against you.

I have tested a bit on EURUSD and it was OK as well. But I hope that other people have also accurate data on other pairs and then will help in testing.

 

I cannot get this EA to trade either on demo account or in backtester. What am I doing wrong.

Kevin

 
Kaper:
I cannot get this EA to trade either on demo account or in backtester. What am I doing wrong. Kevin

Difficult to say with just this statement. I know that it works for other people at least on backtester.

what currency do you use, what time period do you use?

 

Backtests looks very impressive, at least for me. I will start testing it on next monday. Nice work, jlpi.

 

New version

I have published in the first post a new version with

  • variable lots size,
  • a bug corrected for Intervals with JPY pairs: for instance before it was working OK for USDJPY if Interval was 50 or 100 but not 80. Now it is fixed (I changed "int" into "double")
  • and different intervals if the pair is trending (TrendInterval) or ranging (TrendInterval*MultiplierTrendInterval) because if we are ranging and managing both buy and sell side we need a bit bigger intervals to have a lower drawdown.
Reason: