GridDancer / GridMaster

Rene's trading Expert Advisors
Post Reply
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

GridDancer / GridMaster

Post by renexxxx »

SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
  • At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
  • To trade this robot, you have to understand:
    • How to use EA's.
Originally, Remon Reffat, remon78eg, Egypt, from FF, came of with the idea of the grid strategy, where the biggest losing trades were closed together with one or more winning trades such that the net profit was positive. Steve and Bruster created Rinse 'n Repeat which is single-symbol implementation largely built on Remon's ideas.

This GridDancer/GridMaster combo, further extrapolates on these ideas, but there is a subtle difference too. Here goes:

1. GridDancer is a single-symbol expert advisor that, once started, sets an anchor price, and opens a new SELL if price has moved an x distance UP from the previous level, and opens a new BUY if price has moved an x distance DOWN from the previous level. Before opening a trade, it first checks if there is not already a trade in that direction at that level. If so, no new trade is added. The astute reader would immediately observe that this is the opposite of what Remon originally designed, as in his design a BUY is opened if price goes UP. GridDancer has two parameters of interest: DistanceBetweenTradesATRRatio Default: 0.05 and DistanceBetweenTradesPIPs Default: -1.0. If you set DistanceBetweenTradesATRRatio to a positive number, GridDancer will calculate the distance between two grid steps as (14-period daily ATR) * DistanceBetweenTradesATRRatio. So, with the default value of 0.05, it divides the daily ATR into 20 and uses that as the grid size. If both DistanceBetweenTrades... parameters are positive, DistanceBetweenTradesATRRatio takes precedence.

GridDancer is a mindless EA that will keep opening new trades at unexplored grid levels for as long as it is running. However, it does listen for a message from GridMaster, that is telling the dancer to restart. In such event, GridDancer will close all its trades, setup a new anchor price level and start from scratch: a true Rinse-and-Repeat.

GridDancer is meant to be installed on several pairs, I have been testing this setup on EURUSD, AUDUSD, USDJPY, GBPUSD, AUDJPY, NZDUSD and USDCAD (i.e. the 'cheapest' pairs on GP with respect to spread)

2. GridMaster is a master trade controller robot, that can be installed (in theory) on any symbol. It wakes up every MasterTimerSeconds-seconds (Default: 5), and checks all the open trades. It sorts the open trades in order of (dollar) profit and looks to close the biggest loser (that would be the overall biggest loser), by one or more winners (starting at the biggest winner and going down in descending order), such that the net profit of the set exceeds the given MinProfit parameter (Default: $5.00). So, each time GridMaster finds such a set, it adds at least MinProfit to the balance of the account. So, how is this different from the single pair Rinse 'n Repeat? If the biggest loser is XXXYYY, than it can be offset by winners of AAABBB, CCCDDD ... etc. You get my point. In my opinion, pair selection is crucial.

The problem with this is that after a while the biggest loser is getting quite large (in the negative sense) and GridMaster is struggling to find enough winners to offset that biggest loser. So, the longer this goes on, the more open trades (that gulp up margin) and the higher the draw down. Therefore, you don't want this to go on too long. The good thing is this: From my observations, initially, the balance increases faster than that the drawdown gets more negative. In other words, initially at least, equity seems to go up. Therefore, GridMaster has a parameter called MinEquityIncrease, Default ($50.00), and as soon as this has been reached, GridMaster is telling all the Dancers to restart themselves (i.e. close all their trades, and reset the grid parameters).

GridMaster and all the GridDancers are meant to have the same Magic Number.

How to use:
1. Install GridDancer on several currency pairs
2. Install GridMaster on yet another currency pair. Shouldn't matter which. Play with the (limited) parameters, but ensure all Dancers and the Master have the same Magic Number.

For the moment I'll keep the source code in order to enforce centralized version control.

Have fun!

Update(s)

Update: 2016-08-16
GridDancerv1.59 and GridMasterv1.7
See the write-up on these versions in this Post.

Update: 2016-10-20:
HGIDancerv1.0.ex4 and
GridMasterv1.8.ex4
See the write-up for these in this Post

Update: 2016-10-26:
HGIDancerv1.1.ex4
See this Post.

Update: 2016-11-11:
HGIDancerv1.3.ex4
GridMasterv1.81.ex4: Fixes a bug that was discussed in this post.

Update: 2016-11-19
HGIDancerv1.4.ex4
GridMasterv1.0.ex4
See the write-up for these in this Post
You do not have the required permissions to view the files attached to this post.
User avatar
krzysiekqq2
Trader
Posts: 69
Joined: Sun Oct 11, 2015 11:59 am
Location: Gdynia, town at Baltic sea cost

GridDancer / GridMaster

Post by krzysiekqq2 »

Hi Rene,

Thanks a lot for this bot. It just closed first basket of trades. I set up small basket, just to see how this works. And looks promissing. Smart approach. :clap:

Krzysztof
KingOfCoolville
Trader
Posts: 36
Joined: Sun Dec 04, 2011 4:52 pm

GridDancer / GridMaster

Post by KingOfCoolville »

Hi Rene,

I am currently testing your EA's.

I like the idea of leaving all trades open until the worst trade is able to closed by a group with an additional profit. I also like the idea of a Equity target which once hit closes all trades and starts the process again.

Can I ask why you have decided to go with taking opposite trades from the direction of the cross of the grid point? If the market is trending up for example, you will end up with multiple losing sell trades. Even when there is a retrace this would be hampered by the fact the bot will be taking buys on the way back down. I don't see the logic behind this?

Thanks for your efforts

EDIT: I've been running the bot on demo for 2.5 hours. 0.1 lots, on the pairs Rene recommended. The EA is behaving as described - banked £140, however DD is currently at £250. Again as all these currencies (except yen) seem to be strengthening against the dollar, there are a number of sells in DD. If this was opposite I think there would be more than enough scope to close out the worst losers.

Programming/behaviour wise though, seems to be functioning as described. Many thanks Rene.
User avatar
TraderJoeForex
Trader
Posts: 1157
Joined: Fri Mar 08, 2013 10:29 pm
Location: South London

GridDancer / GridMaster

Post by TraderJoeForex »

renexxxx » Wed May 11, 2016 8:45 am wrote:SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
  • At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
  • To trade this robot, you have to understand:
    • How to use EA's.
Originally, Remon Reffat, remon78eg, Egypt, from FF, came of with the idea of the grid strategy, where the biggest losing trades were closed together with one or more winning trades such that the net profit was positive. Steve and Bruster created Rinse 'n Repeat which is single-symbol implementation largely built on Remon's ideas.

This GridDancer/GridMaster combo, further extrapolates on these ideas, but there is a subtle difference too. Here goes:

1. GridDancer is a single-symbol expert advisor that, once started, sets an anchor price, and opens a new SELL if price has moved an x distance UP from the previous level, and opens a new BUY if price has moved an x distance DOWN from the previous level. Before opening a trade, it first checks if there is not already a trade in that direction at that level. If so, no new trade is added. The astute reader would immediately observe that this is the opposite of what Remon originally designed, as in his design a BUY is opened if price goes UP. GridDancer has two parameters of interest: DistanceBetweenTradesATRRatio Default: 0.05 and DistanceBetweenTradesPIPs Default: -1.0. If you set DistanceBetweenTradesATRRatio to a positive number, GridDancer will calculate the distance between two grid steps as (14-period daily ATR) * DistanceBetweenTradesATRRatio. So, with the default value of 0.05, it divides the daily ATR into 20 and uses that as the grid size. If both DistanceBetweenTrades... parameters are positive, DistanceBetweenTradesATRRatio takes precedence.

GridDancer is a mindless EA that will keep opening new trades at unexplored grid levels for as long as it is running. However, it does listen for a message from GridMaster, that is telling the dancer to restart. In such event, GridDancer will close all its trades, setup a new anchor price level and start from scratch: a true Rinse-and-Repeat.

GridDancer is meant to be installed on several pairs, I have been testing this setup on EURUSD, AUDUSD, USDJPY, GBPUSD, AUDJPY, NZDUSD and USDCAD (i.e. the 'cheapest' pairs on GP with respect to spread)

2. GridMaster is a master trade controller robot, that can be installed (in theory) on any symbol. It wakes up every MasterTimerSeconds-seconds (Default: 5), and checks all the open trades. It sorts the open trades in order of (dollar) profit and looks to close the biggest loser (that would be the overall biggest loser), by one or more winners (starting at the biggest winner and going down in descending order), such that the net profit of the set exceeds the given MinProfit parameter (Default: $5.00). So, each time GridMaster finds such a set, it adds at least MinProfit to the balance of the account. So, how is this different from the single pair Rinse 'n Repeat? If the biggest loser is XXXYYY, than it can be offset by winners of AAABBB, CCCDDD ... etc. You get my point. In my opinion, pair selection is crucial.

The problem with this is that after a while the biggest loser is getting quite large (in the negative sense) and GridMaster is struggling to find enough winners to offset that biggest loser. So, the longer this goes on, the more open trades (that gulp up margin) and the higher the draw down. Hereby an image of a symbol with many open trades: the GREEN lines are BUYs and the RED lines are SELLs.


Therefore, you don't want this to go on too long. The good thing is this: From my observations, initially, the balance increases faster than that the drawdown gets more negative. In other words, initially at least, equity seems to go up. Therefore, GridMaster has a parameter called MinEquityIncrease, Default ($50.00), and as soon as this has been reached, GridMaster is telling all the Dancers to restart themselves (i.e. close all their trades, and reset the grid parameters).

GridMaster and all the GridDancers are meant to have the same Magic Number.

How to use:
1. Install GridDancer on several currency pairs
2. Install GridMaster on yet another currency pair. Shouldn't matter which. Play with the (limited) parameters, but ensure all Dancers and the Master have the same Magic Number.

For the moment I'll keep the source code in order to enforce centralized version control.

Have fun!
Glad to see you went for it :good:
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

GridDancer / GridMaster

Post by SteveHopwood »

:clap: :clap: :clap: :clap: :clap: :clap: :clap:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

GridDancer / GridMaster

Post by renexxxx »

KingOfCoolville » Thu May 12, 2016 12:50 am wrote:Can I ask why you have decided to go with taking opposite trades from the direction of the cross of the grid point? If the market is trending up for example, you will end up with multiple losing sell trades. Even when there is a retrace this would be hampered by the fact the bot will be taking buys on the way back down. I don't see the logic behind this?
Good question and one I've been waiting for.

I've been toying with this stuff for a while, and I first tried to open a BUY when price moved UP and a SELL when price moved DOWN, the 'normal' Remon way. Then, I reversed it, and in the reversed logic, my balance was growing much faster and my draw down was dropping much slower. Why? I've got no idea. However, this was not a fluke, it seemed to be consistent. If you want you can duplicate my experiment with the attached GridDancerRemon. I'm quite confident that the 'reversed' logic is better, that's why I'm not making this selection a parameter.

With the version I posted, including the OOTB settings for the parameters, my 10K demo account is up 7% for this week, with no draw down to speak of. The Equity/Balance Curve looks like this:
Capture2.PNG
The reason for sharing -- apart from my altruistic nature of helping others -- is for other forum members, to experiment with:

1. Pair selection
2. Different values for MinProfit and MinEquityIncrease. These values are of course relative to the lot Size, which in turn is relative to the account balance.
You do not have the required permissions to view the files attached to this post.
User avatar
hopfi2k
Trader
Posts: 35
Joined: Tue Nov 15, 2011 11:03 pm
Location: Germany

GridDancer / GridMaster

Post by hopfi2k »

renexxxx » Wed May 11, 2016 9:45 am wrote:... GridDancer has two parameters of interest: DistanceBetweenTradesATRRatio Default: 0.05 and DistanceBetweenTradesPIPs Default: -1.0. If you set DistanceBetweenTradesATRRatio to a positive number, GridDancer will calculate the distance between two grid steps as (14-period daily ATR) * DistanceBetweenTradesATRRatio. So, with the default value of 0.05, it divides the daily ATR into 20 and uses that as the grid size.
Well done, Rene! Many thanks for your contribution!

I have played the past few days with my modified version of Steve's version of R'n'R that uses ATR to make the distance between levels dynamic. Funny how, I ended up using the same factor 20 you are using. :good:
What I have figured out so far is, that 14-period daily ATR is to slow to modify the distance in case of bigger (news) events. Currently I'm using 6-period ATR (4hour) which basically the range for one trading day. Might be worth considering making the ATR period/timeframe as user input in your GridDancer ;-)

Cheers,
Andy
User avatar
Eamonn
Trader
Posts: 87
Joined: Wed Nov 16, 2011 6:45 am

GridDancer / GridMaster

Post by Eamonn »

GRID MASTER.PNG
Hi Renexxxx

I've been running this all afternoon it is amazing to watch it trade.

It looks like it could be the missing link to the Remon strategy.
You do not have the required permissions to view the files attached to this post.
User avatar
Gertje
Trader
Posts: 1936
Joined: Mon Dec 12, 2011 1:17 pm
Location: Middle of the Netherlands

GridDancer / GridMaster

Post by Gertje »

Hello Renexxxx,

Any suggestion about the lotsize/ balance? What did you use for the $5,- default?

Tnx,
Gertjan
KingOfCoolville
Trader
Posts: 36
Joined: Sun Dec 04, 2011 4:52 pm

GridDancer / GridMaster

Post by KingOfCoolville »

renexxxx » Wed May 11, 2016 7:39 pm wrote:
KingOfCoolville » Thu May 12, 2016 12:50 am wrote:Can I ask why you have decided to go with taking opposite trades from the direction of the cross of the grid point? If the market is trending up for example, you will end up with multiple losing sell trades. Even when there is a retrace this would be hampered by the fact the bot will be taking buys on the way back down. I don't see the logic behind this?
Good question and one I've been waiting for.

I've been toying with this stuff for a while, and I first tried to open a BUY when price moved UP and a SELL when price moved DOWN, the 'normal' Remon way. Then, I reversed it, and in the reversed logic, my balance was growing much faster and my draw down was dropping much slower. Why? I've got no idea. However, this was not a fluke, it seemed to be consistent. If you want you can duplicate my experiment with the attached GridDancerRemon. I'm quite confident that the 'reversed' logic is better, that's why I'm not making this selection a parameter.

With the version I posted, including the OOTB settings for the parameters, my 10K demo account is up 7% for this week, with no draw down to speak of. The Equity/Balance Curve looks like this:


The reason for sharing -- apart from my altruistic nature of helping others -- is for other forum members, to experiment with:

1. Pair selection
2. Different values for MinProfit and MinEquityIncrease. These values are of course relative to the lot Size, which in turn is relative to the account balance.
Rene,

Thanks for the explanation. If you have tested it, I have no reason to doubt your results.

Just a quick update on my test, I've been running the EA since early afternoon (UK time). I have set minprofit to 3, 0.1 lots. Banked profit is £207.08, DD is currently £142.00.

Just a quick question, how does GridMaster work out the MinEquityIncrease parameter? Is it done via comment, magic number or all trades closed? As you can see from the above my equity has increased by £65.08, the MinEquityIncrease is set to 50 - but no trades have been closed. I did have to close a few existing trades from another EA before I started the test so I'm not sure if that is affecting things.

Many thanks
Post Reply

Return to “Auto-trading EA's and EA monitors”