• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:32pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:32pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

order repeating EA? stop/repeat? 2 replies

Auto Hedge Commodity Trader System 29 replies

Repeat or Loop a Closed Trade 1 reply

SteveHopwood EAs 4 replies

Now 17Mar2008 vs History Review (repeat itself) 0 replies

  • Commercial Content
  • /
  • Reply to Thread
  • Subscribe
  • 24
Attachments: Rinse and Repeat. A hedge trading auto-trader by SteveHopwood
Exit Attachments
Tags: Rinse and Repeat. A hedge trading auto-trader by SteveHopwood
Cancel

Rinse and Repeat. A hedge trading auto-trader by SteveHopwood

  • Last Post
  •  
  • Page 1 23456 10
  • Page 1 234 10
  •  
  • Post #1
  • Quote
  • First Post: Edited Apr 16, 2011 5:36pm Apr 5, 2011 11:53am | Edited Apr 16, 2011 5:36pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
SERIOUS WARNING

  1. Most Forex traders lose all their money.
  2. Using the robot posted here in trading Forex does not guarantee success.
  3. Trading this robot could lead to serious financial loss.
  4. Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.


Y0U MUST NOT USE THIS ROBOT ON A LIVE ACCOUNT. IT IS EXPERIMENTAL.

This one arises from Brijon's Amazing Magic, which led to the EA that generates signals, which led to DC's 6 pairs thingy and the principle of Rinse and Repeat, where you take balanced trading baskets, close out the winners at whatever moment suits you, then re-enter in the same direction immediately.

One of the ideas is to use hedging to get out of the hole created by a big loser; this gave me an idea.

 

  1. take simultaneous buy and sell trades, then use mptm to:

    1. trail the winner by 10 pips
    2. hedge the loser at 10 pips, to x2 lot size.

  2. In an ideal scenario, the hedge takes out the loser at breakeven and the winner continues to run until a retrace takes out the stop. Return to 1) and start again.
  3. When a hedge is not working and the market has moved against it, hedge-the-hedge at -10; this process continues until the winner has closed and the hedged position reaches breakeven and closes. Rinse and repeat by returning to 1).


I had planned leaving this running for a couple of days before deciding whether to release it or not, but I had a bath and realised during it that there are a host of different ways of approaching this. Here are just a few of the questions that occurred to me:

 

  1. are there not many combinations of trailing/jumping stop that can be used on the winning trade?
  2. should we be going longer before hedging the loser?
  3. is x2 lots too aggressive?
  4. instead of a trail/jump, should we go for a simple tp and use hedging to deal with a trade that does not make it to tp before retracing?
  5. do we need a maximum hedging depth to ensure we do not blow the account?

I could go on, but you can start playing with different combinations yourselves. Attached is the original R&R code bolted on top of mptm.


You can blow your account in minutes with R&R
As posited, R&R uses Martingale hedging to get out of losing trades at breakeven. Martingale is simple and seductive: if a trade hits its stop loss enter the next trade at double the lot size of the previous one.

The idea is that the market only has to move in your favour by a few pips for you to make back your losses. It works. It is brilliant. It will grow your account at an enormous speed.

Right up to the day it kills your account.

What happens is this: the markets enter a sustained move in one direction; all your indicators and stuff have been telling you it will move in the opposite direction; your trades keep hitting their stops; you keep re-entering at double the previous lot size. Here is what happens to a sequence of lot sizes starting at 0.1.

 

  1. 0.1
  2. 0.2
  3. 0.4
  4. 0.8
  5. 1.6
  6. 3.2
  7. 6.4
  8. 12.8

It does not take long for a level 6 trade to blow our account. R&R is even wose because the trades do not close. By the time we reach level 5, we would have 3.1 lots of trades open. Ouch.

This is why nobody must use R&R live. To do so were must first:

 

  1. decide what percentage of lot size to use as our hedge
  2. decide at which point to have hedging kick in
  3. work out how tiny our lot sizes have to be in order to survive the kind of run that the xxxJPY pairs are anjoying at the moment.


Martingale safety features

There are two protections to stop R&R overtrading and blowing your account:

 

  1. FkMinimumMarginPercent: this prevents R&R from sending any more hedge trades when your margin percent falls below this figure.
  2. FreezeTradingAtLotSize: this stops the bot from doing anything at all when a hedge is sent at this lot size. It immediately sends a further hedge to the trade it has just sent, freezing the entire position. R&R stops any activity and you have to manage the position manually. This post explains the rationale behind this filter http://www.forexfactory.com/showpost...&postcount=143


Remember to always have:

 

  1. ManageThisPairOnly set to true
  2. All the other 'Management styles' set to false.

Muck these inputs up and you will cause chaos.

The two biggest, fundamental questions are huge.

 

  1. How long before the Martingale-style hedging blows the account.
  2. Assuming it is possible for the account to survive, is the stress of a run-away sequence worth the comparatively small profits that each run generates?


If the bot turns out to have legs, I will add trading times and pseudo-random post-closure sleep periods to try to hide from the crims what we are up to. Let's give this a whirl and see.




-------------------------------------------------------------------------
Posting restrictions
I have restricted the ability to post in this thread to: traders with at least 1 voucher; and traders on my 'buddy' list. I have done this because I do not want the thread cluttered with 'newbie' questions about the basics. New/inexperienced traders, this is not intended as a direct insult. What I want here is discussion with traders who fully understand what it is they are doing; when you newbs have been around a while, you will come to understand what a difference experience makes to the posts a member writes and shudder at the recollection of some of the questions you asked. I do. http://cdn.forexfactory.com/images/s..._the_floor.gif Go to your profile page; there is a link to the FF page that describes the voucher process.

Do not attempt to get around this by sending me pm's asking for help with your basic problems. Doing so will earn you an automatic ban from all of my threads.

I have set up a partner thread to this one and Nanningbob's at http://www.forexfactory.com/showthre...66#post3948666
There, you can post the questions that you cannot post here, about anything you need to know. Someone with the knowledge and experience you need will answer - just not necessarily me.

Traders/coders with experience who have not yet been vouched for, can get around this restriction be being added to my 'buddy' list; all you have to do is pm me to ask me to do this.

Coming up
http://www.forexfactory.com/showpost...&postcount=103
Ignore this guys. I have put this link here so I do not lose the post.

Attached File(s)
File Type: mq4 Rinse and Repeat with MPTM.mq4   87 KB | 1,619 downloads | Uploaded Apr 16, 2011 5:36pm
  • Post #2
  • Quote
  • Apr 5, 2011 12:23pm Apr 5, 2011 12:23pm
  •  Caillou
  • | Joined Apr 2010 | Status: Member | 1,404 Posts
Iīm in Steve...

Thank you. Will share results......
 
 
  • Post #3
  • Quote
  • Apr 5, 2011 3:08pm Apr 5, 2011 3:08pm
  •  Edd Ganuelas
  • | Joined Feb 2010 | Status: Maranatha | 446 Posts
I am aboard.

Edd
 
 
  • Post #4
  • Quote
  • Apr 5, 2011 5:12pm Apr 5, 2011 5:12pm
  •  paulbt38
  • | Joined Mar 2010 | Status: Member | 244 Posts
Steve

I had pm'd you a slightly different version of this sometime ago. I hadn't heard anything so presumed the idea was poor. However I will take another stab at it

Rather than taking simultaneous trades, we take a trade in one direction (doesn't matter which although we could use some indi to help). Once trade is taken a pending trade in the opposite direction for 3x the lot size is set up 10 pips away from original trade price. TP for both first trade and pending is 10 pips. If first trade goes straight to tp then we can start again. If it goes against us and the hedge goes to tp then we lose 20 pips on original trade but make 30 pips. Once the pending hedge trade is taken another pending hedge the hedge is set up at the entry price of original trade for 2x the hedge lot size. If this trade goes to tp we loose 60 but gain 70 pips. This can keep going until closure with all future martingale hedge trades at 2x the last trade. The logic behind this is that it only takes a 20 pip move in one direction to close all trades and start again.

Anyway hope you feel this may be a worthwhile variation and look forward to your thoughts. If it is a crap idea (I know the spread may effect things) then please be gentle.

Paul
 
 
  • Post #5
  • Quote
  • Edited 6:12pm Apr 5, 2011 5:22pm | Edited 6:12pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting paulbt38
Disliked
Steve

I had pm'd you a slightly different version of this sometime ago....
Ignored
Try reading your middle para with the mindset of someone with a limited attention span, a deep hatred of long and involved paragraphs, and a shed-load of pm's to read. I do get the occasional one from time to time.

What will have happened is this:

 

  1. I opened your pm
  2. lost track of the business bit of the pm
  3. thought, "I will sort this out later"
  4. forgot about it.

Please do take the time to knock you ideas into a readable form that makes sense to someone with limited understanding, and I will see what I can do.

 
 
  • Post #6
  • Quote
  • Apr 5, 2011 5:59pm Apr 5, 2011 5:59pm
  •  paulbt38
  • | Joined Mar 2010 | Status: Member | 244 Posts
Sorry Steve wasn't having a go as I know you are massively busy and I'm sure you do get tortured.

Cheers

Paul
 
 
  • Post #7
  • Quote
  • Apr 5, 2011 6:15pm Apr 5, 2011 6:15pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting paulbt38
Disliked
Sorry Steve wasn't having a go as I know you are massively busy and I'm sure you do get tortured.

Cheers

Paul
Ignored
I know you weren't, Paul. Nor was I responding 'fire with fire'.

Also, some of what I had in mind somehow didn't make it onto the screen. Please re-read my post. I have edited it with an addition that I thought I had made, but which clearly did not appear on screen.

Hey, this will confuse the heck out of later readers here.

 
 
  • Post #8
  • Quote
  • Apr 5, 2011 9:28pm Apr 5, 2011 9:28pm
  •  chips
  • | Joined Sep 2010 | Status: Member | 304 Posts
One I note is that when you choose to close a profitable trade manually the ea does not replace the order. Is this intentional on your part.

I think it should be flexible we should be able to take profit manually or ea automatically, and the ea keeps replacing the trade as per the direction.



Thanks
 
 
  • Post #9
  • Quote
  • Apr 5, 2011 9:39pm Apr 5, 2011 9:39pm
  •  mobthehop
  • | Joined May 2010 | Status: Member | 215 Posts
Steve, thanks for doing this - I am actually doing something very similar in manual mode with the old beast..... I liked the principal concept of the E2U simple hedge robot you coded here (http://www.forexfactory.com/showthread.php?t=265317) but not the martingale mechanics.... Rinse and repeat will be put into action immediately....

One request - would you mind to add the code for the breakeven line concept of Old Beast as user selecetable option into this EA which would make manual handling of orders a lot easier (for me...)
 
 
  • Post #10
  • Quote
  • Apr 6, 2011 1:22am Apr 6, 2011 1:22am
  •  Caillou
  • | Joined Apr 2010 | Status: Member | 1,404 Posts
Hi Steve,

I wake up now and one order is in 25 pips profit and still open. I have to close and reopen manually or the EA must do that automatically?
Thank you
 
 
  • Post #11
  • Quote
  • Apr 6, 2011 2:01am Apr 6, 2011 2:01am
  •  brijon
  • | Membership Revoked | Joined Jan 2008 | 3,753 Posts
im running now on demo , will see how it goes and offer any sujestions i can

great work amazing effort

your simple the best

from brian
 
 
  • Post #12
  • Quote
  • Apr 6, 2011 2:17am Apr 6, 2011 2:17am
  •  Caillou
  • | Joined Apr 2010 | Status: Member | 1,404 Posts
Hi again,

The EA has just opened a new order for the trade which was in 30 pips profit with double lot size, and has not close any order (3 orders opened now)......maybe there is something wrong or it's me who is wrong.....

Thanks again Steve
 
 
  • Post #13
  • Quote
  • Apr 6, 2011 2:50am Apr 6, 2011 2:50am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting brijon
Disliked
im running now on demo , will see how it goes and offer any sujestions i can

great work amazing effort

your simple the best

from brian
Ignored
Cheers Brian.

 
 
  • Post #14
  • Quote
  • Apr 6, 2011 3:28am Apr 6, 2011 3:28am
  •  brijon
  • | Membership Revoked | Joined Jan 2008 | 3,753 Posts
great little note but it seems its not taking trades in peak trading moment on my demo at present strange as manual i was having great fun
see my latest manual trades on my thread steve

maybe its me on this ea but ill keep it running , might be a good idea to post your profile like dryclean for us setting up as your demo

just an idea Steve it would help us dumies


from BRIAN
 
 
  • Post #15
  • Quote
  • Apr 6, 2011 3:32am Apr 6, 2011 3:32am
  •  Nicastro
  • | Joined Mar 2010 | Status: Member | 186 Posts
Dear Mr Hopwood,

There is a risk that the hedging element will turn the EA into a martingale. I think we need to avoid this.

My suggestion is that MPTM enter a hedge trade after 20 pips at 200% of the original trade size. Close the original trade and the hedge trade at BE plus 2 or 3 pips profit.

And if this hedge trade reverses against us again (as many will), then after 10 pips, enter a Hedge the Hedge Trade at 110% of the original trade (or 55% of the hedged trade).

Hedging stops here. From here onwards, we freeze time to allow us to unravel the hedge in the most profitable/efficient manner. The trade(s) could wash themselves out in the basket closure. We could apply recovery or indeed, depending on its size, we could absorb the loss as a trading expense.


By way of example:
Original EA trade of Short …………………. GBPUSD of 0.1 lots
Hedge trade at 20 pips of : Buy GBPUSD of 0.2 lots
Hedge the Hedge trade at 10 pips of: Short GBPUSD of 0.11 lots

In this fashion we have created a circle trade and have reduced our exposure to the market to 10% of the original trade size.

Do you think this will benefit the Rinse and Repeat EA?

Sincerely

Nicastro
 
 
  • Post #16
  • Quote
  • Apr 6, 2011 4:22am Apr 6, 2011 4:22am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting Nicastro
Disliked
Do you think this will benefit the Rinse and Repeat EA?

Sincerely

Nicastro
Ignored
Don't know. Try it and see.

 
 
  • Post #17
  • Quote
  • Apr 6, 2011 4:30am Apr 6, 2011 4:30am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting brijon
Disliked
great little note but it seems its not taking trades in peak trading moment on my demo at present strange as manual i was having great fun
see my latest manual trades on my thread steve

maybe its me on this ea but ill keep it running , might be a good idea to post your profile like dryclean for us setting up as your demo

just an idea Steve it would help us dumies


from BRIAN
Ignored
You do realise that you need two charts, Brian? One for the ea that sends the trades - Rinse and Repeat - and the second for mptm?

I am demoing EU, so I have two EU charts open.

With R&R, check your MaxSpread input and make sure it is big enough. This filter is intended to keep us out of the market during news releases etc.

This is indeed good fun. No reason why you should use R&R at all; you could simply enter the trades manually whenever you feel like a bit of gentle trading.

--------------------------------------------------------------------

Incidentally guys, the sharp-eyed amongst you will have noticed a take profit input in R&R. Ignore it; it does nothing and I will remove it when I next update the bot. If you want a tp, then use mptm's tp insertion function to provide it.

 
 
  • Post #18
  • Quote
  • Apr 6, 2011 4:41am Apr 6, 2011 4:41am
  •  Caillou
  • | Joined Apr 2010 | Status: Member | 1,404 Posts
Quoting Caillou
Disliked
Hi again,

The EA has just opened a new order for the trade which was in 30 pips profit with double lot size, and has not close any order (3 orders opened now)......maybe there is something wrong or it's me who is wrong.....

Thanks again Steve
Ignored
Sorry Steve,

As always, it was me who was wrong......
 
 
  • Post #19
  • Quote
  • Apr 6, 2011 4:44am Apr 6, 2011 4:44am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting Caillou
Disliked
Sorry Steve,

As always, it was me who was wrong......
Ignored
No problem.

 
 
  • Post #20
  • Quote
  • Apr 6, 2011 5:54am Apr 6, 2011 5:54am
  •  brijon
  • | Membership Revoked | Joined Jan 2008 | 3,753 Posts
great help thank you
it works great help
from brian


Quoting SteveHopwood
Disliked
You do realise that you need two charts, Brian? One for the ea that sends the trades - Rinse and Repeat - and the second for mptm?

I am demoing EU, so I have two EU charts open.

With R&R, check your MaxSpread input and make sure it is big enough. This filter is intended to keep us out of the market during news releases etc.

This is indeed good fun. No reason why you should use R&R at all; you could simply enter the trades manually whenever you feel like a bit of gentle trading.

--------------------------------------------------------------------...
Ignored
 
 
  • Commercial Content
  • /
  • Rinse and Repeat. A hedge trading auto-trader by SteveHopwood
  • Reply to Thread
    • Page 1 23456 10
    • Page 1 234 10
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023