Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   Free EA - Piggy n The Middle (https://www.forexfactory.com/showthread.php?t=587001)

keydcuk Apr 13, 2016 5:58pm | Post# 1

Free EA - Piggy n The Middle
 
4 Attachment(s)
Hello Forex Factory Members!

This is my first thread on Forex Factory so I will try to make it a good one.

FIRST AN FOREMOST: Let me just thank Mr Remon Reffat for giving a lot of us invaluable insight on his very unique strategy on grid trading.
Without Mr Remon's thread, I would not have thought about the method of trading I have implemented in my newly created EA. Let me please give credit where credit is due and identify where Remon's ideas have influenced me and take similarity in my strategy.

 

  1. The strategy involves taking BUY & SELL positions at the same time for each grid step.
  2. The strategy involves closing positions both profitable and non-profitable at a net profit during periods of retracement

Without these two ideas, I would not have been able to work on what is indeed a bit of a strategy that mimics Mr Remon's but with a new twist.

Although some of the alternative "Remon EAs" as being discussed in his thread, I thought it would not be fair to do this as it indeed does not represent nor comes close to the method 1 (part 1 and/or part2) of Mr Remon nor does it follow his method 2 which is still under development.

For those who have no clue what I am talking about, I invite you to go visit his thread. The man is a genius when it comes to his grid trading strategy. It is something I have not come across in my 10+ years of trading forex.
Please visit http://www.forexfactory.com/showthread.php?t=583322 IT IS WELL WORTH IT!

PLEASE FIND THE ATTACHED EA
The settings are explained in this post's screenshot and are pretty self explanatory but feel free to ask if you are uncertain.

In essence, I have already said what the EA does.

  1. The strategy involves taking BUY & SELL positions at the same time for each grid step.
  2. The strategy involves closing positions both profitable and non-profitable at a net profit during periods of retracement

However there are numerous developments that have lead to how I got there and this is why my EA is already called v4

Variables to take in consideration.

  1. Round numbers set the grid size in terms of price value. (Please see screenshot for an exampled explanation)
  2. Variable take profit of positions

Although grid size is very important when trading, I have added a variable TP position in pips.

This I found useful and especially with my favourite pair running my EA the GBPJPY. I added this one based on one of my ideas of taking profits at the middle of the grid rather than when a new grid position opens. Main point to this was to give the Price Action of the pair a chance to turn around should it have reached an ultimate top or bottom.

Example: In a 200 pip grid, TP can be taken at 100 pips either side. If PA swings up 100 pips and down 100 pips from an open BUY/SELL position, then we have closed both positions returning equity to your bank balance for both positions that were opened.

Another experiment that I have done with TP is to set TP at 300 pips on a 200 pip grid. Although this keeps positions open all the time, bigger profits take place and closure is still possible by manually adjusting the EA settings whilst still in trade.

At the moment I have the variable profit position 10 pips away from the next grid step in order to take maximum profit when price is trending and also 10 pips away to allow another BUY/SELL position as if set to 200, one of the BUY/SELL positions will not open at the next grid step.

I GUESS THAT'S PRETTY MUCH IT!

Have fun with my new EA. I am not a coder. I have made this EA through a program called fxdreema. I like this piece of software! It is very versatile and can carry quite complex coding with it's graphical user interface that acts like a flow chart. I encourage anybody to try it. I am still on the free version but it hasn't limited me to make my EA. Feel free to discuss not only the pairs and settings you use with it, but also I am willing to make modifications to the EA IF IT'S WITHIN MY CAPABILITIES.

I am not sharing the mq4 publicly but feel free to PM me your request and what sort of modification you are thinking about. I am likely going to say yes in sharing the mq4 but I rather know what you would like to do in order to prevent lurkers from downloading and not sharing their ideas with us and this thread.

Happy Pipping!

Daniel

VERSION 4-1:
All works the same as version 4 (original).
Added Features:
Triple Trade Hours Filter (Default settings will leave this running 24 hours a day with the exception of between 23:59 - 00:00)
(Sorry, this is the only way I can program the trade hours. 1 minute a day it won't take trades.)
(Also you can change from server time to local time by replacing the word "server" with "local")

I am currently struggling with the "Close All Trades at Equity %" - HOPEFULLY SOON TO COME!

EDIT 22/04/2016
After consideration, I have decided to add the mq4 files for further development. I ask you, "Please share your developments on this thread." It is already hard enough to be an fx trader that I appeal to you decency to share with all of us what could be potentially a better EA than I have originally created.

EDIT 02/05/2016
At the request of a thread follower, this version now has a trade days as well as a trade hours filter. I got rid of the triple trade hours filter as it seems users have no use for it. Also, I have made this version a little more user friendly with the inputs. The variable constants are more defined for users to understand and as well I have managed to change the round numbers function to work in pips rather than price as per original v4 and v4-1 which eliminates complications for users and there is no need to refer to the screenshot in this post unless you are still using v4 or v4-1.

For all who use fxdreema, the mq4 files should be able to be imported directly for fxdreema block editing.

Happy Pipping!
Click to Enlarge

Name: Screenshot_1.png
Size: 92 KB
Piggy n The Middle v4.mq4
Piggy n The Middle v4-1.mq4
Piggy n The Middle v4-2.mq4


Carneiro Apr 13, 2016 6:21pm | Post# 2

Congratulations Friend for the initiative.

I do not know if I should say something, but always think EA should have a direção..por so I have a proposal.

SMA 34 for H1
or
EMA 240 for M15

What TF should leave?

A green hug and pips for all

normtold Apr 13, 2016 6:24pm | Post# 3

Thanks Daniel for the time you put into this project.

I look forward to testing the EA from tomorrow.

keydcuk Apr 13, 2016 6:34pm | Post# 4

Congratulations Friend for the initiative. I do not know if I should say something, but always think EA should have a direo..por so I have a proposal. SMA 34 for H1 or EMA 240 for M15 What TF should leave? A green hug and pips for all
I'm not really into MAs so I am not clued up enough to have an opinion of what to use.

I can try to make a modification for actions based on MA but I need to know what you would like the MA to do in the conditions you are proposing.

Is it that you want it to stop taking BUY/SELLS or is it that you want it to take only buys above and sells below... or something else?

As mentioned in post 1, I am limited as I am not a coder and also the free version of fxdreema is limited to how many connection to blocks I have but I am happy to try anything. At the moment I got a lot of spare time

Daniel

keydcuk Apr 13, 2016 6:35pm | Post# 5

Thanks Daniel for the time you put into this project. I look forward to testing the EA from tomorrow.
Thanks for your support!

Daniel

kilion Apr 13, 2016 6:37pm | Post# 6

Great initiative Daniel!

Let's test it and improve it!

keydcuk Apr 13, 2016 6:46pm | Post# 7

Great initiative Daniel! Let's test it and improve it!
I'm looking forward to ideas as there are some bits I have managed to do with the EA that takes care of most of the DD issues but it still poses the same or problems that nobody seems to have solved yet which is what to do in a trend? With trend brings DD to open opposite positions.

I am thinking already to maybe stop BUY/SELLS at trendline breaks and re-enter retracement positions on a 3-level semafor indicator.

One must come at a point where they admit their limits and call on the people to humble myself to new ideas for the better of us all!

Carneiro Apr 13, 2016 6:55pm | Post# 8

{quote} I'm not really into MAs so I am not clued up enough to have an opinion of what to use. I can try to make a modification for actions based on MA but I need to know what you would like the MA to do in the conditions you are proposing. Is it that you want it to stop taking BUY/SELLS or is it that you want it to take only buys above and sells below... or something else? As mentioned in post 1, I am limited as I am not a coder and also the free version of fxdreema is limited to how many connection to blocks I have but I am happy to try anything....
EA would take the direction just above or below the SMA 34 (H1) or EMA 240 (M15)

The configuration of your EA can be with the same rules, but the EA would have a definite direction in the first inning.

Note> The EA also had no entries, it is that so?

Jb38 Apr 13, 2016 6:59pm | Post# 9

Great initiative keyduck !

I'm following you with great interest, as well as Mr Remon of course.
I'm going to sleep but will come back soon


Good to see some people from Remon's thread here !

keydcuk Apr 13, 2016 7:26pm | Post# 10

{quote} EA would take the direction just above or below the SMA 34 (H1) or EMA 240 (M15) The configuration of your EA can be with the same rules, but the EA would have a definite direction in the first inning. Note> The EA also had no entries, it is that so?
The EA itself is set to trade at price steps. That is where it enters.

For example. If the GBPUSD is at price level of 1.4133 and you set your grid "round numbers" at 0.0050 (every 50 pips), then that is when it will enter the trade. I don't think you will gain advantage of entering a trade above or below any MA at TFs. Reason I say this is that the first trade is a BUY/SELL. It is an instant hedge and will do whatever it does whether it goes up or down from that point.

If the trades that are being taken are to be only directional, then yes, I could introduce an MA and program it to only take buys above the MA until it retraces and then it would take on sell positions. I could make an EA that does this... but the issue you would be getting is that when BUY onlys make a top, it would be harder to kill of any existing sells that are at the very bottom.

I say this not that you would know but when you see it in action, you can notice that all BUYs in the upward position TP as a trend is happening. Currently, it will always leave a trail of SELLs at grid size until it reaches a top. Leaving only 1 buy/sell at a top, as it goes down in retracement it will add an extra sell position to the existing one in retracement WITHOUT it' corresponding buy. This has worked brilliantly in retracements as they are much smaller than a trend and need an extra kick to kill off the losers at the bottom.

When you say "take the direction", do you mean that you would want it to only take 1 direction trade above or below the MA until retracement?

Cheers!

Daniel

keydcuk Apr 13, 2016 7:31pm | Post# 11

Great initiative keyduck ! I'm following you with great interest, as well as Mr Remon of course. I'm going to sleep but will come back soon Good to see some people from Remon's thread here !
Cheers JB!

I've been working on this for a short while but never found anything to satisfy me enough to share and collaborate with until now.

I like the idea of getting all our minds together and coming up with something good!

I don't mind if we come up with too many EAs on this thread in the process of development. Anything that is worthy in the process, I will update post 1 so that it clear to everyone who joins the thread that the post 1 EAs are the best of the best so newbies don't need to be confused in asking "Which EA should I use?"

I hope in the future that we can have a small handful with diverse strategies so people can use the one that suits them the most.

I'm off to bed soon too... it's getting late and my eyes and head have been in the direction of my laptop for a wee too long!

Daniel

rumbaut Apr 13, 2016 7:52pm | Post# 12

Hello all here

Thank to open new idea about Remon strategy to whom we owe his idea. I am open here to be a tester. Carneiro has a lot of experience in direction of the trend so will be good if we can implement after his ideas in that EA to be tested.

Jose

Invermac Apr 13, 2016 8:02pm | Post# 13

Hello, anybody test this EA?

Carneiro Apr 13, 2016 8:12pm | Post# 14

{quote} The EA itself is set to trade at price steps. That is where it enters. For example. If the GBPUSD is at price level of 1.4133 and you set your grid "round numbers" at 0.0050 (every 50 pips), then that is when it will enter the trade. I don't think you will gain advantage of entering a trade above or below any MA at TFs. Reason I say this is that the first trade is a BUY/SELL. It is an instant hedge and will do whatever it does whether it goes up or down from that point. If the trades that are being taken are to be only directional, then...
OK,
1) What TP use?
2) Not yet opened any position, I'm a little confused ...

keydcuk Apr 13, 2016 8:42pm | Post# 15

{quote} OK, 1) What TP use? 2) Not yet opened any position, I'm a little confused ...
The TP can be set relative to the size of your grid.

What pair are you testing on?
What size of grid do you want to use?
TP can be variable. In my opinion there a 4 ways to do this depending on how you want to trade.

1. You can trade TP at mid point of grid. If your grid is 100 pips, you can TP at 50 pips allowing 50 pips away from the next pending position in case the pair turns around, you can avoid being hedged. Also, this can close your BUY/SELL open position quickly keeping equity less exposed for what is being opened.

2. You can go longer and stay in continuous trade. With the same example of 100 pip grid, you can set your TP more than 100 pips say 150 pips. That way you are riding the trend and taking benefit of the direction of PA hoping that better profits come in the trend. The downside is you are leaving a position always open.

3. You can trade to price. By setting the TP equal to your grid. This one here will react differently as instead of opening a BUY/SELL position at the next grid step, it may only open 1 position opposite to the trend due to the programming of the EA.

4. You can set your TP 10 pips away so that positions may not be always open and if you are watching the screen, you can shut off your EA when all positions are closed at some point when it happens. (Example, TP 90 pips on a 100 pip grid.)

As for not opening a trade, I really need to know your pair and round numbers. It will only start a trade when your first round number hits. Even a 10 pip grid will only open when the round number hits.

Sorry I had to program in round numbers, it's the only way I could get the EA to do what it does. As per image in post one I will explain more on this.

GBPJPY, EURJPY, USDJPY: Roundnumbers 1.0 is 100 pips, 0.5 is 50 pips 0.1 is 10 pips etc..
GBPUSD, EURUSD, EURGBP, etc etc etc... there are when price format is X.xxxx 0.01 is 100 pips, 0.005 is 50 pips 0.002 is 20 pips etc etc..

I hope this is understandable.

Daniel

Carneiro Apr 13, 2016 9:17pm | Post# 16

{quote} The TP can be set relative to the size of your grid. What pair are you testing on? What size of grid do you want to use? TP can be variable. In my opinion there a 4 ways to do this depending on how you want to trade. 1. You can trade TP at mid point of grid. If your grid is 100 pips, you can TP at 50 pips allowing 50 pips away from the next pending position in case the pair turns around, you can avoid being hedged. Also, this can close your BUY/SELL open position quickly keeping equity less exposed for what is being opened. 2. You can go...
EA will only open an order when you arrive at the round number?

keydcuk Apr 13, 2016 9:21pm | Post# 17

{quote} EA will only open an order when you arrive at the round number?
Yes, at the round number setting that you set.

If you are using GBPUSD at 0.0050 round number it will only open at 1.4150 or 1.4200 if price is sitting in the middle of these values for example.

remon78eg Apr 13, 2016 10:53pm | Post# 18

Good,
Any Back test Screenshot ?
To See The Best Results For The Best Settings You Have.

Carneiro Apr 13, 2016 11:31pm | Post# 19

1 Attachment(s)
Hello Forex Factory Members! This is my first thread on Forex Factory so I will try to make it a good one. FIRST AN FOREMOST: Let me just thank Mr Remon Reffat for giving a lot of us invaluable insight on his very unique strategy on grid trading. Without Mr Remon's thread, I would not have thought about the method of trading I have implemented in my newly created EA. Let me please give credit where credit is due and identify where Remon's ideas have influenced me and take similarity in my strategy. The strategy involves taking BUY & SELL positions...
Because jumped the number (6)? or was it just a distraction?
Name:  6.png
Views: 40372
Size:  131 KB

Carneiro Apr 13, 2016 11:55pm | Post# 20

1 Attachment(s)
my first 190 pips
I'm curious to know how the EA will react with the remaining operations
Click to Enlarge

Name: GBPJPY + 190 pips.png
Size: 142 KB


© Forex Factory