Rinse 'n Repeat

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Rinse 'n Repeat

Post by SteveHopwood »

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.
MAKE SURE YOU READ THIS POST http://www.stevehopwoodforex.com/phpBB3 ... 41#p111241 There was a Forex bloodbath on Jan 15th 2015 that you need to know about.

YOU ABSOLUTELY MUST NOT TRADE THIS EA LIVE UNTIL YOU HAVE EXPERIENCED IT WORKING ON DEMO AND ARE COMFORTABLE WITH IT. RnR GENERATES A LOT OF TRADES AND WILL EASILY BLOW YOUR ACCOUNT.

Rinse 'n Repeat is based on the trading method offered by remon78eg, real name Remon Reffat. Remon, we salute you for the genius and simplicity of your trading. :clap: :clap: :clap: :clap: :clap:

RnR is not an automation of Remon's method. It has close similarities. Bruster posted the flowchart I have attached; this pdf is Bruster's understanding of the trading method posited by Remon and I used it to generate RnR's algorithm. I have not coded offsetting a loser on one side with an equivalent pips winner on the other for the loss of the spread, swap and commission - don't see the point.

Remon has developed a breathtaking simulator for his method, available at http://www.stevehopwoodforex.com/phpBB3 ... p?id=60161 Play with it to get a feel for the trading method. It is unbelievable programming, and great fun. Remon added this note: Note:
"If Anyone Got Any Runtime Error (In The Simulator), Just Install Microsoft Office 2003 Or Previous Version To Complete The Missing Dll Files."

Bruster and I cooked this EA for a while. In an exhibition of breathtaking brilliance, he supplied the missing link in the chain, by working out how to repopulate the grid when the highest and lowest trades are a long way apart, left high and dry by closures in between. I am not an intelligent and logical person. Bruster single-handedly cut RnR's development time period short by about a month.

--------------------
Edit 26th April 2016:
Brewster's contribution to this project has been huge. He has sorted out stuff that was defeating me. We owe him a huge round of :clap: :clap: :clap: :clap: :clap: :clap:
-------------------

Here is how RnR trades:
  • Starting with no open trades, we establish a base line at current market price, and RnR draws a dotted yellow line at that point. If the market rises by DistanceBetweenTradesPips, RnR takes a buy and redraws the line at the price of the new order; this becomes the new base line price. If the market falls by DistanceBetweenTradesPips, RnR takes a sell and redraws the line at the price of the new order; this becomes the new base line price.
  • Once a trade is open in either or both directions, RnR takes a new buy trade every time the market rises above the highest buy price by DistanceBetweenTradesPips, and a new sell trade every time the market falls below the lowest sell price by DistanceBetweenTradesPips. Bruster's method kicks in when the highest and lowest have a gap larger then DistanceBetweenTradesPips * 2 between them.
RnR has five trade closure methods. Taking the buy side of the equation as an example and with DistanceBetweenTradesPips set to 20:
  • Simple Offsetting:
    • A simple offset of the loser at the top by the biggest winner at the bottom. Imagine there are 4 market buys and that no 4 has just opened:
      • No 4, the top, is the spread in the red.
      • No 3, is 20 pips in the green.
      • No 2, is 40 pips in the green.
      • No 1, the lowest, is 60 pips in the green.
      • Imagine the market retraces and the latest buy at the top of the pile is DistanceBetweenTradesPips in the red. Now the position is:
        • No 4, the top, is the 20 pips in the red.
        • No 3, is at breakeven.
        • No 2, is 20 pips in the green.
        • No 1, the lowest, is 40 pips in the green.
      • The top trade is -20. The bottom trade is + 40. Close them both and net 20 pips. There is code to ensure that this only happens when the combo can be closed in cash profit.
    • Complex double-sided offsetting
      • This is offsetting a group of trades from one side of the hedge, against a loser from the other.
        • Imagine there are 5 buys open and the group is in profit; there are 3 sells open and the group is in loss:
        • Imagine that some or all of the buy trades have a combined cash profit that will allow the buys and the worst sell trade to be closed at an overall profit. Close the relevant number of buys and the sell.
    • Complex single-sided offsetting.
      • This takes care of the 'leaky toilet' market.
        • Imagine the market has fallen a long way.
        • Lots of sells opened and closed by the simple offset method.
        • At each closure, RnR takes a buy to fill in the gap between the market and the lowest buy trade. You end up with a lot of buys open.
        • The market will rise eventually - it always does. The lowest buys in the grid become more and more profitable. The loss on the highest buy trade lowers. Eventually we reach the stage where a bunch of winners at the bottom can combine to close the highest loser at a combined overall profit. Stunning stuff from Bruster.
  • Optional basket closures:
    • The position is hedged: close all trades when the overall profit reaches HedgedBasketPips. A zero value turns this off.
    • The position is not hedged i.e. all the trades are either buys or sells: close all trades when the overall profit reaches ClearBasketPips. A zero value turns this off.
There is the ability to use dynamic lot sizing - HGBnG users are familiar with it.

EmergencyStopLossPercentageOfBalance calculates an emergency stop loss in cash to cater for one of Bob's 'leaky toilet' markets. For noobs, a 'leaky toilet' market is one where the market moves away from a group of trades in the wrong direction - up against sells, for example. The retraces never quite make enough to allow the trades to be closed, so drawdown deepens and deepens. They happen. Here, the buys will be closing themselves out through simple offsetting and so never acquiring enough value to close out the sells. The emergency stop loss is designed to cope with this situation and needs to be reasonably large so it does not trigger too often.

PartialEmergencyStopLossPercentOfBalance is a brilliant idea by Bruster. Instead of closing the entire position when the stop loss is hit, close just the worst trade in the hope that the position recovers. If not, RnR will carry on closing the worst trades until profit taking resumes.

A GJ code testing run in Crapergy Tester, H4 every tick mode, using OOTB inputs, turned a start balance of $10,000 into $167,607,333. That isn't a misprint folks. 167 million and a few hundred thousand in loose change. I think Global Prime would enjoy the commission on that little lot, given that the lot size grew to 1000 full lots. :lol:

I am trading RnR on my live account, just on GJ and using tiny lots. Based on my experience so far, here are my observations and recommendations:
  • This is an expensive way to trade. There are lots of trades, so the spread and any commission costs a lot. I do not care so long as the equity keeps rising. Do not run this ea if the cost of doing so bothers you.
  • You can end up with a lot of open trades in one direction when you encounter a leaky toilet market. I had over 60 buys open at one point. To stay safe, here is what I suggest so far:
    • You need $5,000 of balance per pair, so $10,000 for two pairs, $15,000 for three and so on.
    • Trade 0.01 lots per pair per $5,000.
    • Trade GJ only until others here prove that other pairs are also tradable.
  • The idea is to add lots of small profits. Lots of small profits eventually add up to lots of profit.
Pairs to trade: RnR's development is pretty much complete, so our attention is turning to how to trade him most effectively. Those with the most volatility look as though they are going to be the best. The attached VolatilityChart is an indicator coded by Rene and shows the volatility of the pairs over all time frames. I trade this on GJ only.

Trading this way looks pretty safe whatever value you input for DistanceBetweenTradesPips, so long as you have a sufficiently large initial deposit - this is not suitable for $500 beginners. Play and find what suits you best.

Have fun folks.

:xm:


EDIT: 17/7/16
Another Experimental Version:


Following a request from Gertje, a filter has been added to the experimental version to restrict trading based on a single moving average- price above, longs only and price below, shorts only. More details and his initial results can be found in his post : http://www.stevehopwoodforex.com/phpBB3 ... 80#p143380 on page 46. The aim of this filter is to reduce drawdown during trending periods so it is not intended that this feature is used with recovery mode.

We've thrown a lot of ideas at this bot over the last few months and yet the original version still comes out on top - let's see if this time it'll be different! If you're planning a test, please run the original bot alongside for comparison because that is the benchmark that has to be comprehensively beaten before anyone should consider going live with this version.



EDIT: 17/6/16
NEW Experimental Version:


A further suggestion by TraderJoeForex was to change the reason to enter recovery mode from a total number of trades on one side to an imbalance between the buys and sells irrespective of the total number of trades. Makes sense, hence a new version that does just this.

This version has two new inputs:

TradeImbalanceForRecovery - This is the number of trades one side must have GREATER than the other
TradeImbalanceToReset - when the imbalance is returned below this number recovery mode is exited.

It would be great to find an improvement but please remember these things
- Recovery mode was shown not to be effective in its previous incarnation...
- Recovery mode is not just one setting - it's the opportunity for you to change the way the bot takes trades while this mode is active. The way the bot trades is set by user inputs so you'll have to experiment with turning on and off various trading methods to find an overall behaviour that helps.
- The basic bot with no frills or extras is trading profitably...



EDIT: 25/5/16
You MUST NOT use this feature on your live accounts. It is not working properly yet.

TraderJoeForex posted about hedging when there is a huge imbalance between buy and sell trades - we have all seen imbalances of 50+ - I have one at the time of writing.

The thingy about hedging is this:
  • Only hedge against, say, sell trades, when your trading system indicates you should buy. Merely hedging in a panic is not helpful.
  • Close the hedge trade when your trading system gives an opposite direction signal.
TraderJoeForex wrote about using Tom DeMark trendlines to indicate when to enter and subsequently close a hedge trade. In a PM to me he mentioned HGI and my single firing synapse boinged into life.

So is born the "TraderJoeForex hedging" feature. This hedges a wildly imbalanced position when HGI fires up a signal. Imagine you have 30 0.01 lot sells and 4 0.01 buys and HGI generates a buy signal:
  • There is a difference of 0.26 kits in between the sells and the buys.
  • RnR will send a buy hedge of 0.26 lots.
  • He will close the trade when HGI generates a sell signal, or optional yellow wavey.
Here are the inputs:
  • UseTJF: turns this defensive hedging on.
  • MinimumTradesToCauseImBalance: this is the difference between the buys and sells. RnR will not invoke the defensive hedge when the imbalance is less than MinimumTradesToCauseImBalance.
  • Next come the usual HGI inputs requiring your HGI version name and read delay to save on cpu use. There is no excuse for not understanding what these are about. The only moron who does not clearly has taking no notice of anything that has been going on here. Any such morons, find out for yourselves. Ask about it here and I will delete your registration.
  • HgiTimeFrame is the time frame you wish to use for HGI. I trade RnR on the M5 because it means I can see the trades easily. I currently have 5 buys and 56 sells open; hedging on the M5 HGI would have netted me quite a lot of pips today. The default time frame is based on my experience today only, and so could be wildly wrong.
  • The remaining inputs are about whether to hedge when an HGI trend arrow or blue wavy line appear, and close the hedge if a yellow wavy range appears, apart from:
    • OffsetLosersWhenClosingHedge: this tells RnR to calculate how many losing trades can be offset by the profits of a profitable defensive hedge closing, and then close them
    .
I have added Sixths into the mix. Frankly, you should know all about these now from Charles' thread at http://www.stevehopwoodforex.com/phpBB3 ... =88&t=4720 and how they are utilised by HGBnS at http://www.stevehopwoodforex.com/phpBB3 ... =87&t=4733. Visit these threads if you have been cut off from SHF for the last fortnight, or have just joined and could not be arsed to read the info I sent you at the time.

Setting UseSixths to 'true' tells RnR to close a TJF defensive hedge trade following a bounce, or near bounce, off the outer blue lines.
  • UseSixths turns this feature on/off.
  • SixthTimeFrame tells RnR over which time frame to draw the Sixths lines. Not a clue what the default should be, so it represents my demo setting.
  • BarCount: go and boil your head if you really do not know what this is all about.
  • ClosureDistancePips creates a buffer zone the market must enter and exit to trigger a defensive trade closure. Taking a defensive buy trade as an example:
    • The buffer zone is ClosureDistancePips from the top blue line.
    • A candle opens within this zone.
    • The market falls out of it. Time to do all the closure thingies listed above.

EDIT: 4/5/16
Experimental Version:


There is a trial version of the EA that has new features. These features are not proven and so are for testing / demo only.

New Features:

- OffsetPipProfitStandard : Added to the standard closure - makes closure less likely so don't be greedy!
- OffsetPipProfitRecovery : Added to the recovery closures - zet to zero to add nothing.

- StopTradingAtNextZeroUPL : The bot will carry on trading normally until UPL is zero.

- UseRecoveryMode: A new feature which attempts to reduce drawdown - details below.

Recovery mode allows greater flexibility around how the bot trades when it has a large number of trades in DD. To help understand this mode here's a brief summary of the standard mode (explained in detail above):

The standard mode will place buy trades as price rises and sell trades as price falls and will close losing trades in the following ways:

- Simple Offset: One trade offset against one trade of the same type.
- Complex Offset; A group of one type of trades to offset one losing opposite trade.
- Single Sided Complex Offset; A group of one type of trades to close one losing trade of the same type.

When we get a trending move, the system will build drawdown (DD) as the counter trend trades get left behind. Using a falling price as an example, we will be left with a lot of buy trades. The sell trades will become profitable but that profit will be used to offset the losing buy trades, or losing sell trades on retraces. The problem is that closing losing sell trades (either via simple or single sided complex offsets) isn't helpful as it doesn't help reduce the losing buy trades.

Recovery Mode allows you to decide which of the offset methods the bot can use when it gets into a DD situation, with the aim of increasing its ability to offset the worst losing buy trades. The OOTB settings are designed to focus entirely on closing the worst losing trade. Offsets that close trades on the opposite side, or close trades that are not the worst losing trade are temporarily disabled.

The recovery mode is triggered when the number of trades on either side reaches: MaxTradesForRecovery. If the bot successfully closes some of these trades and the number of trades falls back below; TradesToResetRecoveryMode, then standard trading will resume. If the bot doesn't recover sufficiently and the number of opposite trades builds as well as the original DD trades then standard trading resumes again until one side is biased once more.

Recovery modes is currently fully flexible with each offset method being optional for each situation - either Max Buy Trades or Max Sell Trades. Toggle the offsetting methods either true or false to change the recovery mode behaviour.

Enjoy!!


Matters of general interest
Go here to download and run the script that will fill your platform's missing chart history: http://www.stevehopwoodforex.com/phpBB3 ... f=15&t=254
Read this post:
http://www.stevehopwoodforex.com/phpBB3 ... p?f=6&t=78 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration.

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79, at the bottom of the post.

Useful utilities/EA's/scripts -

-
You do not have the required permissions to view the files attached to this post.
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. [email protected] 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
woodlands
Trader
Posts: 226
Joined: Sun Mar 23, 2014 6:16 pm

Rinse 'n Repeat

Post by woodlands »

Thank you Steve for the tireless work and management, and Remon for the theory and Bruster, it just gets better and better at SHF
Last edited by woodlands on Sat Apr 23, 2016 7:06 pm, edited 1 time in total.
leerockach
Posts: 8
Joined: Wed Nov 18, 2015 8:49 pm
Location: Derbyshire, UK

Rinse 'n Repeat

Post by leerockach »

Thanks so much Steve and Bruster for your hard work creating this and sharing it with us. I'm really excited to try this. I think this has the potential of being a game changer! :hi:
Lee
Zennor
Trader
Posts: 276
Joined: Fri Feb 08, 2013 4:44 pm
Location: On a Canal Boat travelling the waterways.

Rinse 'n Repeat

Post by Zennor »

Steve, Bruster and Remon many thanks you guys, looking forward to putting this beast through it's paces.
:hi: :hi: :hi:
User avatar
remon78eg
Trader
Posts: 19
Joined: Fri Apr 01, 2016 11:56 pm

Rinse 'n Repeat

Post by remon78eg »

Thanks
:)
trader689
Trader
Posts: 644
Joined: Thu Nov 17, 2011 12:53 am

Rinse 'n Repeat

Post by trader689 »

Bravo Steve and Bruster, thank you so much, hate weekends!

:cheer:


Trader
bazze

Rinse 'n Repeat

Post by bazze »

Thanks to all of you :good: ...
Last edited by bazze on Sat Apr 23, 2016 7:52 pm, edited 1 time in total.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Rinse 'n Repeat

Post by SteveHopwood »

Anybody who even has nightmares about using what I am about to write as an excuse for presenting craptesting results here really has not being paying attention over the last few years.

Just don't do it ok? What I am about to suggest is a weekend game only.

Got it?

Run the bot through a few H4 every tick craptests and watch the graph. It really is good fun. It is especially good on the more volatile pairs. The emergency stop loss is hit and there is a dramatic drop in the balance. The dramatic drop becomes less and less, and finally becomes a mere blip, then the blip disappears........

Bored right now? Try it. It is good fun.

Present it as a serious result here and I will eviscerate you. Depending on my mood, I may ban you. I trust I have made the thrust of this post abundantly clear even to the most stupid?

Have fun playing folks. I am. I shall delete this post once we have run this bot for a few days.

:xm:
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. [email protected] 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
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Rinse 'n Repeat

Post by SteveHopwood »

You are most welcome Remon. None of this would have happened without you. :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. [email protected] 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.
bazze

Rinse 'n Repeat

Post by bazze »

The future have been, tomorrow we can't do anything about....It's NOW that's matter :) ...Forex is like life itself...
Post Reply

Return to “Automated trading systems”