I will leave it alone.TonkaTuff » Mon Feb 27, 2017 12:38 am wrote:I'm a big fan of the Chandelier Exit. It's got my vote..
Thanks,
TT
Holy Graily Bob 'n Dotty
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Holy Graily Bob 'n Dotty
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.
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.
- TonkaTuff
- Trader
- Posts: 74
- Joined: Wed May 01, 2013 6:30 am
- Location: Sydney, AUSTRALIA
Holy Graily Bob 'n Dotty
You should have read my first quick reply!!! Brain engaged now and have read previous posts. 
In theory, there is no difference between theory and practice. In practice, there is.
- OmarSM
- Trader
- Posts: 10
- Joined: Wed Nov 16, 2011 12:48 pm
Holy Graily Bob 'n Dotty
SteveHopwood » Sat Feb 25, 2017 6:03 pm wrote:It reflects a sentiment I feel about our totally fantastic forum.
As an aside, it is worthwhile considering how far we have come in recent years.
People were still trading the cross of a slow moving average by a faster one when I started my coding career.
Steve, Thomas, et all the coders, debuggers, spotters, helpers,
Thanks, huuuuge thanks.
"Never Give Up, Never Surrender"
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Holy Graily Bob 'n Dotty
Our pleasure.OmarSM » Mon Mar 06, 2017 8:35 pm wrote:SteveHopwood » Sat Feb 25, 2017 6:03 pm wrote:It reflects a sentiment I feel about our totally fantastic forum.
As an aside, it is worthwhile considering how far we have come in recent years.
People were still trading the cross of a slow moving average by a faster one when I started my coding career.
Steve, Thomas, et all the coders, debuggers, spotters, helpers,
Thanks, huuuuge thanks.
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.
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.
-
kennychua
- Posts: 7
- Joined: Sat Feb 27, 2016 6:12 am
Holy Graily Bob 'n Dotty
Hi Steve
There is a bug with the CloseOppositeDirectionLosers function.
To explain, let's assume the following scenario
Full Hedge = +7
Trade #1 = -5
Trade #2 = -5
Trade #3 = -5
Trade #4 = -5
Expected behavior: Only one trade should be closed.
Current behaviour: All trade would be closed.
Further explanation
First,full hedge is closed, so ClosedHedgeProfit = 7.
Next, CloseOppositeDirectionLosers function is called.
TotalLossSoFar is set to 0
The first loop for Trade #1 start:
TotalLossSoFar is now 5
The second loop for trade #2 start:
TotalLossSoFar is still 5
The third loop for trade #3 start:
TotalLossSoFar is still 5
The third loop for trade #4 start:
For rectification, I am using the following code
There is a bug with the CloseOppositeDirectionLosers function.
Code: Select all
if (LossThisTrade < 0)
{
LossThisTrade*= -1;//Needs to be a positive number for the comparison
if (TotalLossSoFar + LossThisTrade <= ClosedHedgeProfit)
TotalLossSoFar+= LossThisTrade;
if (TotalLossSoFar > ClosedHedgeProfit)
{
TotalLossSoFar-= LossThisTrade;
continue;
}
if (TotalLossSoFar <= ClosedHedgeProfit)
{
as = ArraySize(ForceCloseTickets);
ArrayResize(ForceCloseTickets, as + 1);
ForceCloseTickets[as] = OrderTicket();
}
}Full Hedge = +7
Trade #1 = -5
Trade #2 = -5
Trade #3 = -5
Trade #4 = -5
Expected behavior: Only one trade should be closed.
Current behaviour: All trade would be closed.
Further explanation
First,full hedge is closed, so ClosedHedgeProfit = 7.
Next, CloseOppositeDirectionLosers function is called.
TotalLossSoFar is set to 0
The first loop for Trade #1 start:
Code: Select all
TotalLossSoFar (0) + LossThisTrade (5) is 5 <= (7) ClosedHedgeProfit is TRUE,
so, TotalLossSoFar(0) += LossThisTrade(5), TotalLossSoFar become 5.
TotalLossSoFar (5) > (7) ClosedHedgProfit is FALSE
TotalLossSoFar (5) <= (7) ClosedHedgProfit is TRUE
so, Trade #1 is closed
The second loop for trade #2 start:
Code: Select all
TotalLossSoFar (5) + LossThisTrade (5) is 10 <= (7) ClosedHedgeProfit is FALSE,
TotalLossSoFar (5) > (7) ClosedHedgProfit is FALSE
TotalLossSoFar (5) <= (7) ClosedHedgProfit is TRUE
so, Trade #2 is closedThe third loop for trade #3 start:
Code: Select all
TotalLossSoFar (5) + LossThisTrade (5) is 10 <= (7) ClosedHedgeProfit is FALSE,
TotalLossSoFar (5) > (7) ClosedHedgProfit is FALSE
TotalLossSoFar (5) <= (7) ClosedHedgProfit is TRUE
so, Trade #3 is closed
The third loop for trade #4 start:
Code: Select all
TotalLossSoFar (5) + LossThisTrade (5) is 10 <= (7) ClosedHedgeProfit is FALSE,
TotalLossSoFar (5) > (7) ClosedHedgProfit is FALSE
TotalLossSoFar (5) <= (7) ClosedHedgProfit is TRUE
so, Trade #4 is closedFor rectification, I am using the following code
Code: Select all
if (LossThisTrade < 0)
{
LossThisTrade*= -1;//Needs to be a positive number for the comparison
if (TotalLossSoFar + LossThisTrade <= ClosedHedgeProfit)
as = ArraySize(ForceCloseTickets);
ArrayResize(ForceCloseTickets, as + 1);
ForceCloseTickets[as] = OrderTicket();
TotalLossSoFar+= LossThisTrade;
}//if (LossThisTrade < 0)- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Holy Graily Bob 'n Dotty
I have started to roll out versions of the HGBnD family that use the core library described in post 1.
Users will notice no difference and the code in the library is unchanged from the original, so there is no need to download the new version yet. Just bear in mind that you will need to do so the next time Thomas corrects one of my coding bloops.
The only advantages to coding the family this way are for the coders. Thomas and I can make changes to the library then post it once rather than having to repeat the changes over several robots.

Users will notice no difference and the code in the library is unchanged from the original, so there is no need to download the new version yet. Just bear in mind that you will need to do so the next time Thomas corrects one of my coding bloops.
The only advantages to coding the family this way are for the coders. Thomas and I can make changes to the library then post it once rather than having to repeat the changes over several robots.
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.
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.
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Holy Graily Bob 'n Dotty

Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
- Wavegarrick
- Trader
- Posts: 1172
- Joined: Sun Dec 30, 2012 11:21 am
- Location: South Africa
Holy Graily Bob 'n Dotty
Hi Guys,
I have let things settle down a bit with all the additions, bug hunting and so forth and begun testing today again.
This is an idea I have been testing for a while when Steve introduced Sixths and Buy low sell high with all the various timeframes. I am not interested in hedging with this method but want to get in when there is a fair chance with extended price turning in the opposite direction and make the most out of it.
I am currently only running this on Eu but will progressively introduce it on other currency pairs. Quick and easy 100 pips booked on Eu today. I also believe that a profit target could be set at 200 pips or more will play with this.
The set is on the latest updated Ea: Anyone interested in this method please feel free to ask questions regarding this.
Cheers
Leon
I have let things settle down a bit with all the additions, bug hunting and so forth and begun testing today again.
This is an idea I have been testing for a while when Steve introduced Sixths and Buy low sell high with all the various timeframes. I am not interested in hedging with this method but want to get in when there is a fair chance with extended price turning in the opposite direction and make the most out of it.
I am currently only running this on Eu but will progressively introduce it on other currency pairs. Quick and easy 100 pips booked on Eu today. I also believe that a profit target could be set at 200 pips or more will play with this.
The set is on the latest updated Ea: Anyone interested in this method please feel free to ask questions regarding this.
Cheers
Leon
You do not have the required permissions to view the files attached to this post.
-
bazze
Holy Graily Bob 'n Dotty
I can't attach the EA in post 1 to the chart? When I try to compile it, I got 100 errors and 50 warnings?
Have tried on two different brokers, the pic. is from my GP acc., with the same result.)
Have tried on two different brokers, the pic. is from my GP acc., with the same result.)
You do not have the required permissions to view the files attached to this post.
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Holy Graily Bob 'n Dotty
You need the core library from here: http://www.stevehopwoodforex.com/phpBB3 ... p?id=70084
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate