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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

how to assign a variable dynamically? 13 replies

Dynamically allocated - jagged object arrays 0 replies

EA request to open pending orders dynamically 8 replies

Link OHLC data for 5 daily bars dynamically to Excel? 3 replies

How to dynamically define an array 5 replies

  • Commercial Content
  • /
  • Reply to Thread
  • Subscribe
  • 43
Attachments: Reversi: a dynamically calculated x-candle reversal EA by Steve Hopwood
Exit Attachments
Tags: Reversi: a dynamically calculated x-candle reversal EA by Steve Hopwood
Cancel

Reversi: a dynamically calculated x-candle reversal EA by Steve Hopwood

  • Last Post
  •  
  • 1 2Page 3456 12
  • 1 2Page 34 12
  •  
  • Post #41
  • Quote
  • May 18, 2011 6:52pm May 18, 2011 6:52pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting macman
Disliked
No problem - Steve will be along soon to sort this out for us ....
Ignored
No he won't. Steve hasn't the faintest idea what people are talking about here.

 
 
  • Post #42
  • Quote
  • Edited 10:24pm May 18, 2011 10:07pm | Edited 10:24pm
  •  mobthehop
  • | Joined May 2010 | Status: Member | 215 Posts
squalou thanks a lot for your work! I am reasonably sure that results will be improved once additional conditions of entry are added, such as some form of relation to RSI (x) or as I suggested earlier, RoC(x)...

We should also bear in mind that probabilities refer to the analysis of random events, not sure that this is the case with candle movements.
 
 
  • Post #43
  • Quote
  • May 18, 2011 10:26pm May 18, 2011 10:26pm
  •  roundrock
  • | Joined Feb 2010 | Status: J16 Student | 902 Posts
Quoting squalou
Disliked
Hi there,

what an interesting approach!
I like statistical analysis too...

I had coded a script primarily for Renko charts that would display statistics of sequences of consecutive up and down renko blocks, to analyse the probability of reversal, but this script can also be applied to regular (non-renko) charts.

Here is my original post:

http://www.forexfactory.com/showthre...12#post4027612

=====

I have recoded it as an indicator, which makes it easier to...
Ignored
hi sq,


"With my example picture:

prob_of_reversal_after(5) = 100 - 100 * ( 48+23+5+2+6+1 ) / 1409 = 94%"


i am trying to understand how you have arrived at probability of success. if we enter after 5 consequitive green bars. in your example you are deducting the occurances of 6 or more consequitive green bars from 100. what is the guarantee they have occured AFTER our trade ? some are after and some are before. for example there are 48 occurances of 6 consequitive grreens, these 48 are from start of the test. and we are entering trades (of 5 consequitive greens) at different candles.

am i missing something ? also physically i looked at the chart D1, i didnt find so much high success rate ....

thanks for great analysis !!!
 
 
  • Post #44
  • Quote
  • May 19, 2011 4:28am May 19, 2011 4:28am
  •  magft
  • | Joined Apr 2011 | Status: Member | 208 Posts
I have added the option to select whether to trade both ways or just in one direction as per Squalou idea previously. Also added a minimum bodysize value so if the candle bodysize is below the specified value then ignore it as a reversal. In brief backtesting this increases profits and reduced DD as long as SkipCandlesBelowBodySize isn't too big, a value of 0 turns off feature.

One point to note is i couldn't get this calcualtion to work with the Stats displayed, need to rethink the logic so the values are as per Steve's method.

I'm looking into the statistics of this using the indicator by Squalou, roundrock the calculated probability value is correct for cumulative distribution. I'm a bit rusty on all this so off to wiki for some research work permitting!

Regards

Mike
Attached File(s)
File Type: mq4 Reversi v1.01.mq4   68 KB | 953 downloads
 
 
  • Post #45
  • Quote
  • May 19, 2011 4:35am May 19, 2011 4:35am
  •  squalou
  • Joined Mar 2010 | Status: Member | 588 Posts
Quoting roundrock
Disliked
hi sq,


"With my example picture:

prob_of_reversal_after(5) = 100 - 100 * ( 48+23+5+2+6+1 ) / 1409 = 94%"


i am trying to understand how you have arrived at probability of success. if we enter after 5 consequitive green bars. in your example you are deducting the occurances of 6 or more consequitive green bars from 100. what is the guarantee they have occured AFTER our trade ? some are after and some are before. for example there are 48 occurances of 6 consequitive grreens, these 48 are from start of the test. and we are entering trades (of...
Ignored

My reasoning is definitely wrong, i am sure about it.

Let's try to put it another way.
This is like trying to estimate the probability of light-red cars among all red cars in a parking lot : once we find a red car, what is the probability for that red car to be light-red ?
You will eliminate all non-red cars first, and focus only on red cars, then count the light-red cars only out of that sample of red cars.
If my parking lot has 1000 cars, but only 300 of them are red, and 50 are light-red, then my probability of finding a light-red car among all red cars is NOT 100 - 100 * (50 + 250) / 1000 = 70%.
It is rather 100 * 50 / 300 = 16% only.
16% of the red cars are light-red. Not 70%.

Does this sound better ?

So our 100% is actually reduced to only the occurences of reversals occuring after the 5th candle (=ALL red cars), and we don't count reversal cases before 5 (=non-red cars).
We wan to know the probability of reversing right after that 5th candle (=light-red cars) out of all reversals occuring after 5 (all red cars).

Therefore:

prob_of_reversal_after(5) = 100 * 48 / ( 48+23+5+2+6+1 ) = 56%

that's much less sexy now.... coin toss again.

And that explains the Profit columns results, which do not show any better success rate when waiting for more consecutive candles.

I have updated the indi to reflect this new calculation.

The results are that all probs are now arround 50% -- do not put too much credit on higher probs appearing on longer reversals, this is due to the low number of samples which increases the statistical error margin a lot.

Conclusion: probably not any edge when using the simple rule
" enter a counter-trade after n consecutive bars of the same color ";

We will need more than that to get rich !

Sq
Attached File(s)
File Type: mq4 sqConsecutiveCandlesStatistics v1.04.mq4   8 KB | 863 downloads
 
 
  • Post #46
  • Quote
  • May 19, 2011 10:06am May 19, 2011 10:06am
  •  squalou
  • Joined Mar 2010 | Status: Member | 588 Posts
Steve,


i run the EA under the backtester on M5 with simplest settings to explore the "pure reversal rule" result:

CandlesInSeries=4
TP=10
no SL
no mptm features
no recovery features (I left "Start_Recovery_at_trades" at 2 as default).


What i observe is that a trade is opened at opening the candle following 4 consecutive green or red candles -- this is expected.
However, if the next (5th) candle is still the same color, then the EA will open another trade, and so on.

Meaning that the EA will open a new trade at each candle opening as long as there are AT LEAST CandlesInSeries previous candles of the same color.

The EA only looks for the past CandlesInSeries candles to decide, and does not check if that amount is exceeded already.

This makes the EA end up opening 5 sells if we have a series of 9 red candles in a row.

I would have expected the EA to open just 1 trade, at the 5th candle, only.
At the 6th candle, we would NOT open a new tarde, because there are 5 past red candles, not only 4.
And so on.

If we set CandlesInSeries to 2 for instance, then we can end up with many cumulating wrong-direction open trades until a reversal candle stops us from opening new trades.

Perhaps a user input to choose if we want :
1) to open a new trade only when the series of candles == CandlesInSeries, (this was my understanding of the strategy), or,
2) to keep opening counter-trades as long as the series of candles is >= CandlesInSeries; (this is how the EA behaves at the moment)

Perhaps an input to set the maximum number of counter-trades that can be opened in the same series of candles ?


BTW, this behaviour has a side-effect on when Recovery kicks in:
once the EA has opened 2 counter-trades in the same series, Recovery kicks in (with default setting "Start_Recovery_at_trades" of 2), which screws up any hard TP that we would have set.
And this happens even when "UseRecovery" is false, which i think is unexpected behaviour in that case.


Another point is the exit rules:
appart from SL, MPTM, and Recovery features, there is no option to just ask to close any trade at the close of the current bar, whatever the outcome may be.
I am not saying that SL, MPTM, and Recovery features are not enough exit rules ...

Just trying to confirm with the EA what i am finding with the "simple rules" of my indicator...


Don't know if you would be interested in adding those 2 features...


Sq
 
 
  • Post #47
  • Quote
  • May 19, 2011 11:13am May 19, 2011 11:13am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting squalou
Disliked
Steve,


i run the EA under the backtester on M5 with simplest settings to explore the "pure reversal rule" result:

CandlesInSeries=4
TP=10
no SL
no mptm features
no recovery features (I left "Start_Recovery_at_trades" at 2 as default).


What i observe is that a trade is opened at opening the candle following 4 consecutive green or red candles -- this is expected.
However, if the next (5th) candle is still the same color, then the EA will open another trade, and so on.

Meaning that the EA will open a new trade at each candle opening as long...
Ignored
Don't know sq. I have understood little of what has been happening here recently; stats make my eyes glaze over. I commented on the potential close distance between trades a while back, but nobody took any notice.

I am watching to see what happens for week before making any changes.

Cheers
 
 
  • Post #48
  • Quote
  • May 19, 2011 11:30am May 19, 2011 11:30am
  •  ArrietaTech
  • | Joined Oct 2010 | Status: Douche | 272 Posts
I'm posting this again...

I've been trading this bot since monday with the following set:

13 pairs
M15
CalculationCandlesCount: 2688 (equates to 1 month approximately)
Breakeven at 30 pips for a 20 pip profit
Jumping Stop after BE at 20 pips (hidden)

Recently I changed SequenceMinimumCandles to 5 so I get a little more trades (They're still profitable)


The results: 28% up in a 2000 acct using 0.03 basic lots (100:1)

I know a week is way too soon, but from what I have observed, the only changes/options that this bot would need atm would be:

- The option to ignore VERY small candles that frustrate the 5 candle sequences that triggers trades (maybe autocalced or as an input)

- recovery should kick in not at the consecutive same direction candle after a reversal trade triggers (as in the attached example), but when the COMPLETE 5 candle sequence kicks in again. This is only a problem when the next candle after the one that triggered the trade keeps going in the same direction
Attached Image(s) (click to enlarge)
Click to Enlarge

Name: EURCAD REVERSI.png
Size: 233 KB
Click to Enlarge

Name: DetailedStatement.gif
Size: 6 KB
 
 
  • Post #49
  • Quote
  • May 19, 2011 11:35am May 19, 2011 11:35am
  •  macman
  • Joined Jan 2009 | Status: Member | 844 Posts
Quoting acostafulano
Disliked
I'm posting this again...

I've been trading this bot since monday with the following set:

13 pairs
M15
........
Ignored
How did you arrive at M15 as being the best time frame for all 13 pairs?
 
 
  • Post #50
  • Quote
  • May 19, 2011 11:46am May 19, 2011 11:46am
  •  ArrietaTech
  • | Joined Oct 2010 | Status: Douche | 272 Posts
Quoting macman
Disliked
How did you arrive at M15 as being the best time frame for all 13 pairs?
Ignored
I chose M15 for no particular reason other than I guessed it would get somewhat frequent trades but without that much noise as lower TF's. I'm sure this can be optimized.
 
 
  • Post #51
  • Quote
  • May 19, 2011 11:49am May 19, 2011 11:49am
  •  ArrietaTech
  • | Joined Oct 2010 | Status: Douche | 272 Posts
My point here is that we're discarding ideas without giving them enough time to for them to be tested, the original reversi bot that steve coded with some tweaking could be something like "The beast in steroids" as I mentioned before. It still takes advantage of NB recovery, mptm features, etc and it can work on lower TF's as I think my test could help prove in some measure
 
 
  • Post #52
  • Quote
  • May 19, 2011 12:18pm May 19, 2011 12:18pm
  •  squalou
  • Joined Mar 2010 | Status: Member | 588 Posts
Quoting acostafulano
Disliked
I know a week is way too soon, but from what I have observed, the only changes/options that this bot would need atm would be:
(...)
- recovery should kick in not at the consecutive same direction candle after a reversal trade triggers (as in the attached example), but when the COMPLETE 5 candle sequence kicks in again. This is only a problem when the next candle after the one that triggered the trade keeps going in the same direction
Ignored
Because the EA will keep opening new trades and premarturely reach "Start_Recovery_at_trades".

Agreed.
Sq
 
 
  • Post #53
  • Quote
  • May 19, 2011 12:34pm May 19, 2011 12:34pm
  •  ArrietaTech
  • | Joined Oct 2010 | Status: Douche | 272 Posts
Quoting squalou
Disliked
Because the EA will keep opening new trades and premarturely reach "Start_Recovery_at_trades".

Agreed.
Sq
Ignored
Yes, that's exactly my point. I think the bot has great potential though, I encourage everyone to keep testing the bot as it is ATM in smaller TF's and with different JS, BE settings, etc.

Maybe there could be a way to adjust these parameters dinamically according to the pair's recent volatility, but I'm guessing that would require a lot of coding. At least we could define the best parameters for each pair for starters
 
 
  • Post #54
  • Quote
  • May 19, 2011 6:58pm May 19, 2011 6:58pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting acostafulano
Disliked
My point here is that we're discarding ideas without giving them enough time to for them to be tested,
Ignored
Some are, or appear to be. I am not. I am operating KISS here.

Your ideas from a couple of posts ago make sense; I am considering them.

 
 
  • Post #55
  • Quote
  • May 20, 2011 9:22am May 20, 2011 9:22am
  •  getdown71
  • | Joined Jul 2009 | Status: v1.03 of SSS EA | 302 Posts
Excellent weeks performance - Kudos to Steve and klan!
 
 
  • Post #56
  • Quote
  • May 21, 2011 11:08am May 21, 2011 11:08am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Latest update in post 1:

 

  1. MinimumCandleBodySize: please see explanation in post 1
  2. Change to the way CalculationCandlesCount works: please see explanation in post 1
  3. added a re-entry line and ReEntryLinePips input a la The Beast etc. As yet, there is no auto-relp calculation; let's wait and see if it is necessary.

Have fun. This one made a promising start on demo last week.

 
 
  • Post #57
  • Quote
  • May 21, 2011 11:40am May 21, 2011 11:40am
  •  dinofx
  • | Joined Dec 2008 | Status: Member | 247 Posts
hi guys

As i glance sometimes around Steeve EA, this one let me skeptic.

This strategy is built on random timing candles: thats funny but really dont talk about the future: nobody can watch the landscape if he's only looking his feet.

Better to know the weekly cycle/trend, then calculate the noise range, and be ready for bouncing

only my 2 cents
 
 
  • Post #58
  • Quote
  • May 21, 2011 1:54pm May 21, 2011 1:54pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting dinofx
Disliked
hi guys

As i glance sometimes around Steeve EA, this one let me skeptic.

This strategy is built on random timing candles: thats funny but really dont talk about the future: nobody can watch the landscape if he's only looking his feet.

Better to know the weekly cycle/trend, then calculate the noise range, and be ready for bouncing

only my 2 cents
Ignored
Well, if it has legs we will use it. If not, we will abandon it. Only time will tell.

 
 
  • Post #59
  • Quote
  • Edited May 23, 2011 3:05am May 22, 2011 7:29am | Edited May 23, 2011 3:05am
  •  fxozgirl
  • | Joined Mar 2011 | Status: Member | 277 Posts
Steve, FWIW I really think this EA does have potential.

After 1 week, ea is up 10.6% with open trades sitting at +$30.61
trading all pairs (I have gone all out on this to see if it will break).
Trading 0.1 lots
1H timeframe
Ea is set to default with SequenceMinimumCandles = 6
TP = 300
Use Recovery = True 1.2.6
Margin was never an issue.
Most trades are closing using the Recovery trailing stop

The only 2 comments/suggestions I have would be in relation to the recovery trades kicking in early as squalou explained (but it looks like you have made some adjustments for this)

And perhaps the ability to restrict the max number of pairs traded (as per TB) as margin could be compromised if multiple recovery trades are open at the same time.
Of course, we can just manually restrict the number of pairs we trade as well

I have attached a statement and graph and will continue demoing this week.
I will also update the ea as per your amendments a couple of posts ago.

Additionally, I am also demoing (read having some fun ) on 15M charts, using 3 candles - account is up 50% in 1 week, but with a 30% drawn down. I think it is likely to blow very soon as margin is around 200% and 4 candles which is up 25% and margin around 500% with a large drawdown as well.

So, thanks again Steve for always being open to different ideas and strategies...as you've shown with TB your persistence and committment to 'the cause' has been amazing along with the myriad of other ea's you've produced. I'm so pleased you are starting to reap the rewards of your endeavours and I thank you for sharing them all so willingly with the rest of us

Cheers

Shelley
Attached Image (click to enlarge)
Click to Enlarge

Name: DetailedStatement_Reversi_1H_5candles_20052011.gif
Size: 6 KB
 
 
  • Post #60
  • Quote
  • May 22, 2011 7:38am May 22, 2011 7:38am
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting fxozgirl
Disliked
Steve, FWIW I really think this EA does have potential.

After 1 week, ea is up 10.6% with open trades sitting at +$30.61
trading all pairs (I have gone all out on this to see if it will break).
Trading 0.1 lots
Ea is set to default with SequenceMinimumCandles = 6
TP = 300
Use Recovery = True 1.2.6
Margin was never an issue.
Most trades are closing using the Recovery trailing stop

The only 2 comments/suggestions I have would be in relation to the recovery trades kicking in early as squalou explained (but it looks like you have made some adjustments...
Ignored
I shall start to add the usual filters to avoid over-trading soon, Shelley. I wanted to see if this one would make a half-decent start first and it has.

 
 
  • Commercial Content
  • /
  • Reversi: a dynamically calculated x-candle reversal EA by Steve Hopwood
  • Reply to Thread
    • 1 2Page 3456 12
    • 1 2Page 34 12
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