3 Ducks based EA

I would like to thanks Trader009 and you for the hard work. I will try and upload myfxbook here for reference.
Before that, just to clarify. the Risk as mentioned earlier, for example if set as 2 , is it means that 2% risk per trade?

Yes, 2% per trade.

Thanks for that, I will try it then show the results~

267pips last week, hopefully we’ll do the same or better this week - Plutus Trend EA System | Myfxbook

Hi aidyspoule/shane

Been backtesting my EA but results are poor showing mostly losses and no consistency. It did reveal that AUDUSD was the pair to short this year with massive profits but didn’t work last year using the same setting.

Here is where I am so far with my development.

I thought some of you may be interested in the results from my building of a 3 Ducks Expert Advisor (EA).

While I appreciate the 3 Ducks system is a discretionary system, the results will be of interest to those of you who trade it on regular basis and may even offer you an inside as to how you could improve your trading.

With the 3 Ducks system the setup is fixed by the alignment of the 3 Ducks i.e. 60 period moving averages on three different time frames. However, the exact entry point, initial stop position, trade management and exit point are all discretionary. And therein lies the problem and the reason for inconsistent performance.

Trading coaches like Van Tharp would ague that the entry is the least important factor as it is the psychological make up of the trader and their ability to follow their rules and use the correct position sizing for the trade that ensure a successful outcome.

On this forum and elsewhere traders are always asking the question what stop size do you use and what take profit size do you use etc. Position sizing therefore matters and takes care of this for you.

When you consider that no two currency pairs are the same and the market is constantly changing, then there is no fixed values that can work all the time.

Trying to code an automated system requires you to use exact parameter that you can use to simulate the discretionary trade, so I have had to answer many of the above questions or make judgement calls in my coding. This has been very interesting project and some of the results have been unexpected.

Using a EA may not appeal to many of you but once completed it does allow you to backtest your system parameters without any loss of money and can then be traded first via a demo account to make sure it works as expected. If you go down this route then I recommend the book Expert Advisor Programming by Andrew R Young as a good place to learn about EA’s.

Moving averages.
First of my definitions was the 60 period SMA’s and what defines a slope. To overcome this problem I used two 60 period moving averages for each time frame. One of the close and one of the open, so that when the 60 period moving average of the close was above the 60 period moving average of the open, then we were long.

I also used this on my charts so that when the moving average were falling they was red and when rising they were green. So three red moving averages and all 3 Ducks are aligned down. Three green moving averages and the 3 Ducks are aligned up. Easy to see when you have them all together on a 5min chart using a 720 period on the 5min chart to simulate for the 1 hr 60 SMA and 2880 period for the 4hr 60 SMA.

Using the close as a trigger (Unfortunately the close is not the close until the close?).
So let me explain by what I mean by that statement.
Any bar or candle is constructed out of a number of closes over a period of time. So the first close of a new bar or candle becomes the open, then the highest close formed during that period becomes the high and then the lowest close formed during that period becomes the low and finally the last close for that period becomes the actual close.
So because the actual close is unknown until the next candle opens I decided to trigger any trades on the open of the next bar. This is quite useful as it stops you getting into a trade on a spike.

Entry point.
Next the entry point based on a new high or low on the 5min chart above or below the 60 SMA when the other two SMA’s align. This was easily achieved by looking back over a set number of periods to find the previous high or low. I initially used 48 periods as that is a 4hr look back period on a 5min chart, but tests seem to indicate longer is better and linking look back period to market volatility might be a good idea.

Initial stop position.
This was easily defined by the system as if the price moves back across the 5min 60 SMA then the trade is closed as the 3 Ducks no longer align.

Simple position sizing algorithm.
The initial stop position i.e the 60 period SMA also gives us our initial risk in pips from our entry point. So if we are risking 2% of our account on every trade then we divide this amount by our initial risk size to get our lot size. Example: 2% of a £5000 account is £100. Divide this by your initial risk of say 50 pips and your lot size is £2 per pip. Simple.

Take profit target.
I decided against this as there are so many small losses you need to cut your losses short and let your profits run and having a fixed profit target cuts your potential to let the market run.

Trailing stop.
Yes, but what type. The 60 SMA looks very attractive as a trailing stop but often to close to let your profits run a lot of the time. So what about using the opposite look back period. If you entered on a new high as defined by the 48 period look back of the last highs then why not use the 48 period look back of the last low as your trailing stop position. This would only kick in once a new higher low rises above the initial stop position. Also looking at using a ATR based stop below the 5min 60sma, so the stop would trail at the 60 SMA – ATR.

Time of day.
This is more important than you think. Forex is 24 hours but you have to sleep sometime so if your favourite pair is AUDJPY it might be best to trade during the Asian session. I hope to produce a table of best times to trade each pair.

Volatility.
Volatility or violent market swings seem to be the main cause of hitting stops or not making profits , so I have introduced a 5min 20sma>5min60sma filter which after a few market swings gets on the wrong side of the 60sma and keeps me out of some bad trades(Early days for this filter). Using an ATR based stop might help here too.

Parameters.
Trend filters are as follows for Long trades reverse for Short trades. All filters are selectable:
Last Open> 4hr 60sma
Last Open> 1hr 60sma
Slope Filters
4hr 60sma of the Close>4hr 60sma of the last Open
1hr 60sma of the Close>1hr 60sma of the last Open
Volatility Filter
5min 20sma>5min60sma
Entry filters based on the look back period which is changeable.
Last Open<Previous High
Open>Previous High.

Thats it I am back testing out all my ideas and hope to have some conclusive data soon.

Regards Trader009.

Sorry for the late post, busy bactesting on other EA last week.

I made a new demo account with 5000$ , and this is myfxbook link : Error | Myfxbook

This is the 1st time I use myfxbook, so I wonder is it just post the link of mine here to allow u all follow up?

Correct me if I am wrong.

Hi Shane,

You need to go into the settings of the account on myfxbook and make the account public, it currently locked down and not showing the system.

https://www.myfxbook.com/portfolio/mt4-331458/576673

Is public now. Try and see.

That doesn’t work. Shouldn’t the public url have your username in it?

Correct should be Mt4-331458 System | Myfxbook - but the page hasn’t updated yet.

We had 5 pending trades yesterday but none opened, 4 have expired and another will shortly if the EURUSD doesn’t drop shortly.

3 trades have opened this morning with +11 pips overall currently.

I just get to update just now. Only 1 pending order of GBPUSD wait to be open

looks good. I like the duck system as we are set on 30 pips SL and TP. Just curious and have several questions as im trying this EA myself :slight_smile:

  1. Why in your myfxbook page, sometimes I see you closed position at -6 pips and so on. Isn’t it supposed to be default 30 pips or only TP is 30 pips?

  2. do you only use the EA on those 6 pairs? I wonder if we can change the settings so it only trade on certain pairs?

  3. related to the question above, do we need to right click and drag the EA to each different pair screen? I am not very familiar with using autotrade EA but usually we only need to use it once and it will run for other pairs but apparently this EA isn’t. I attached the EA to all 6 pairs. Also does it matter to use the EA on different timeframe? For example I attached the EA when the timeframe is M15. Would it matter if I did so when it was H1? because im currently checking your myfxbook page and I see that some trades are different. i dont have any sell stop for AUDUSD and GBPUSD while you have. also my EURGBP open position is quite different from you. Is that because I attached the EA late so it still picked that order even though it’s already too late?

  4. While I have studied the 3 ducks system for the past one hour but considering that i haven’t used this system at all, I wonder what you meant few pages back about “this system is based on 3 duck system but not following it precisely” (or something like that). What’s the real difference between this EA and the 3 duck system? Because you know, even just a small detail can make huge profit differences in forex so i’m curious to find out.

Thanks. Looking forward for reply. I have sense this can be profitable in long run as long as we use proper MM. I like the TP/SL management. Most EA are scalpers and therefore very broker dependant. This one looks nothing like them

Hi rsg10z,

Thanks for the questions, I’m going to take each question in turn…

Answer 1: The reason why some trades have -6 pips rather than -30 it because the EA closes all positions at 17:00 on a Friday evening.

Answer 2: I only trade on AUDUSD, EURGBP, EURUSD, GBPUSD, USDCAD & USDCHF. The EA can be used on other pairs such as EURJPY, USDJPY Gold, etc but you will need to modify the SL & TP in the settings of the EA, 50pips SL & TP is recommended.

Answer 3: Yes, you need to attach the EA to each pair that you wish to trade. So if you only want to trade AUDUSD, EURUSD & USDCHF, then you just need to attach it to them.

Answer 4: The 3 Ducks system will only place trades for the top 3 trending pairs for that day, looking at the slope of the 4 hour and 1 hour SMA. In my opinion, this is missing alot of pips, so I have programmed the EA to open pending trades as soon as the pair is trending, which means the EA can catch the trend from the start.

Also, in the 3 Ducks system the pending opens are set above\below the previous high\lows, again I believe this is missing pips so that is the reason for the aggressive trading option within the EA. That being said, the EA also has the option to open pending trades above\below the high\low bars found within the previous X number of bars as specified by the trader.

I hope this answers your questions and if you have any more please post them here.

hello thank you very much for the answer but I think you missing one more question (silly me, should have made them in different numbers)

this one:

Also does it matter to use the EA on different timeframe? For example I attached the EA when the timeframe is M15. Would it matter if I did so when it was H1? because im currently checking your myfxbook page and I see that some trades are different. i dont have any sell stop for AUDUSD and GBPUSD while you have. also my EURGBP open position is quite different from you. Is that because I attached the EA late so it still picked that order even though it’s already too late?

i attached the screenshot below to show that your open trades (on your myfxbook profile page) are a bit different than mine. Also i dont have stop orders which you have. Why is this happening? Is it because i late in attaching the EA? or am i missing something here?

one more. i almost forgot to address this issue:

because the EA closes all positions at 17:00 on a Friday evening

17:00 on what timezone? Because IBFX and FXPro, for example, use different timezone. Thanks man!


NO, it doesn’t not matter what time frame you have the EA attached to as the code has the times built in. This means you can attached it to a 5 mins chart and move between timeframes within it affecting the EA.

Because you have the have applied the EA at a different time from me, this will affect the pending order as it will be based on the current price at the time the EA was applied, new trades going forward shouldn’t be much different from now.

The price difference will be down to the difference between your brokers price and my brokers price, plus size of the stoplevel between our brokers.

The time is based on your brokers time zone, when coding I was just thinking about my own time zone which is GMT, I will however have a new release of the EA before the end of the week that will allow traders to modified their timezone in the EA. I hope to have this ready else tomorrow or Thursday so anyone running the EA will be able to add it to their charts and the EA will find any open\pending trades and manage them going forward.

Are you able to setup\share a myfxbook account for the EA?

ok thanks for the answer. Very helpful. I like this EA, sounds like having true potential. Very rarely i see any EA out there with great money management like this one. You also inspired me to create my own EA based on my own trading technique. Even if one day you commercialize this EA I probably would buy it or if you want to open PAMM based on it maybe i would diverse my money and invest there lol. It depends on the test result. I think there’s only one way to succeed in forex - proper money management and follow the trend. That’s it and that’s all. This EA, even though I just recently using it, sounds like the only one I can find with good MM and proper TP/SL placement.

btw i will setup myfxbook account and let you know later.