stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Holy Graily Bob 'n Dotty
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4892
Page 23 of 26
Author:  SteveHopwood [ Mon Feb 27, 2017 9:25 am ]
Post subject:  Holy Graily Bob 'n Dotty

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
I will leave it alone.

:xm:
Author:  TonkaTuff [ Tue Feb 28, 2017 1:08 am ]
Post subject:  Holy Graily Bob 'n Dotty

You should have read my first quick reply!!! Brain engaged now and have read previous posts. :)
Author:  OmarSM [ Mon Mar 06, 2017 8:35 pm ]
Post subject:  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.
Author:  SteveHopwood [ Mon Mar 06, 2017 10:29 pm ]
Post subject:  Holy Graily Bob 'n Dotty

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.
Our pleasure. :clap: :clap: :clap:

:xm:
Author:  kennychua [ Thu Mar 09, 2017 6:51 pm ]
Post subject:  Holy Graily Bob 'n Dotty

Hi Steve

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();          
	}
}
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:

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
TotalLossSoFar is now 5
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 closed
TotalLossSoFar is still 5
The 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
TotalLossSoFar is still 5
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 closed

For 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)
Author:  SteveHopwood [ Sun Mar 12, 2017 11:02 am ]
Post subject:  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.

:xm:
Author:  tomele [ Sun Mar 12, 2017 12:48 pm ]
Post subject:  Holy Graily Bob 'n Dotty

:!!: :!!: :!!: :!!: :!!:
Author:  Wavegarrick [ Mon Mar 13, 2017 2:24 pm ]
Post subject:  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:
#Hgbdotty 5 & 15 min 6ths 100 pips.set
Anyone interested in this method please feel free to ask questions regarding this.

Cheers
Leon
Author:  bazze [ Mon Mar 13, 2017 9:18 pm ]
Post subject:  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.)
Author:  tomele [ Mon Mar 13, 2017 9:56 pm ]
Post subject:  Holy Graily Bob 'n Dotty

You need the core library from here: http://www.stevehopwoodforex.com/phpBB3 ... p?id=70084
All times are UTC Page 23 of 26