Bob's Biggest Balls Ever

fmuir
Trader
Posts: 87
Joined: Sun Apr 01, 2012 7:32 am
Location: Seattle, WA, USA

Re: Bob's Biggest Balls Ever

Post by fmuir »

Steve/LifeSys,

BBBE doesn't have any code to control hedging!

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

Re: Bob's Biggest Balls Ever

Post by SteveHopwood »

fmuir wrote:Steve/LifeSys,

BBBE doesn't have any code to control hedging!

Regards,
-Frank
I know.

:D
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.
Fujiyama
Posts: 2
Joined: Sat Jan 19, 2013 10:06 am
Location: Tokyo Japan

Re: Bob's Biggest Balls Ever

Post by Fujiyama »

Hi Steve ,

Thank you for sharing.

There is no or less possibility in live trading that we encounter this situation but let me report what I found.
There was a devide by zero error when BT with OANDA historical data.

I checked the code and found the portion.

void GetPairDoji(string pair)
topwik = (hi-MathMax(op,cl))/(hi-lo) ; // <-- Here
botwik = (MathMin(op,cl)-lo)/(hi-lo) ; // <-- And here

So I changed the code to this.
if (hi-lo ==0) {
//Print("hi-lo: 0 ");
topwik = (hi-MathMax(op,cl)) / MarketInfo(pair,MODE_POINT) ;
botwik = (MathMin(op,cl)-lo) / MarketInfo(pair,MODE_POINT) ;
}else{
topwik = (hi-MathMax(op,cl)) / (hi-lo) ;
botwik = (MathMin(op,cl)-lo) / (hi-lo) ;
}

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

Re: Bob's Biggest Balls Ever

Post by SteveHopwood »

Fujiyama wrote:Hi Steve ,

Thank you for sharing.

There is no or less possibility in live trading that we encounter this situation but let me report what I found.
There was a devide by zero error when BT with OANDA historical data.

I checked the code and found the portion.

void GetPairDoji(string pair)
topwik = (hi-MathMax(op,cl))/(hi-lo) ; // <-- Here
botwik = (MathMin(op,cl)-lo)/(hi-lo) ; // <-- And here

So I changed the code to this.
if (hi-lo ==0) {
//Print("hi-lo: 0 ");
topwik = (hi-MathMax(op,cl)) / MarketInfo(pair,MODE_POINT) ;
botwik = (MathMin(op,cl)-lo) / MarketInfo(pair,MODE_POINT) ;
}else{
topwik = (hi-MathMax(op,cl)) / (hi-lo) ;
botwik = (MathMin(op,cl)-lo) / (hi-lo) ;
}

Best Regards,
Problem here is that MarketInfo(pair,MODE_POINT) often returns zero when run on the platforms of some criminals, so this merely shifts the division by zero bug elsewhere.

:D
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.
Fujiyama
Posts: 2
Joined: Sat Jan 19, 2013 10:06 am
Location: Tokyo Japan

Re: Bob's Biggest Balls Ever

Post by Fujiyama »

mmmm, :o
How's this? :?

if (hi-lo ==0 && IsTesting()) {
//Print("hi-lo: 0 ");
topwik = (hi-MathMax(op,cl)) / MarketInfo(pair,MODE_POINT) ;
botwik = (MathMin(op,cl)-lo) / MarketInfo(pair,MODE_POINT) ;
}else{
topwik = (hi-MathMax(op,cl)) / (hi-lo) ;
botwik = (MathMin(op,cl)-lo) / (hi-lo) ;
}
Lifesys
Trader
Posts: 126
Joined: Wed Apr 25, 2012 2:05 am
Location: Echuca Victoria. Australia

Re: Bob's Biggest Balls Ever

Post by Lifesys »

If (hi-lo) == 0 then Doji is zero so no need for manipulation.
I have used this routine in several EAs for some time and never seen divide zero error here.
Could simple add line **

Code: Select all

      op = iOpen(pair,tfs[tf],1);
      hi = iHigh(pair,tfs[tf],1);
      lo = iLow(pair,tfs[tf],1);
      if (CloseEnough( hi-lo, 0) ) { TradePairDoji[tf] = 0; continue; }/**/
      topwik = (hi-MathMax(op,cl))/(hi-lo) ;
      botwik = (MathMin(op,cl)-lo)/(hi-lo) ;
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

Re: Bob's Biggest Balls Ever

Post by mobthehop »

Lifesys - thanks for sharing the code...

Quick question: Is the line for close (cl=iClose(pair,tfs[tf],1); missing from your pasted code?

Cheers / Mop
Lifesys
Trader
Posts: 126
Joined: Wed Apr 25, 2012 2:05 am
Location: Echuca Victoria. Australia

Re: Bob's Biggest Balls Ever

Post by Lifesys »

Yes.

Code: Select all

      op = iOpen(pair,tfs[tf],1);
      hi = iHigh(pair,tfs[tf],1);
      lo = iLow(pair,tfs[tf],1);
      cl = iClose(pair,tfs[tf],1);
      if (CloseEnough( hi-lo, 0)) { TradePairDoji[tf] = 0; continue; }/**/
      topwik = (hi-MathMax(op,cl))/(hi-lo) ;
      botwik = (MathMin(op,cl)-lo)/(hi-lo) ;
Radar
Trader
Posts: 437
Joined: Fri Mar 23, 2012 5:39 pm
Location: Round the bend ;)

Basket Stats Time

Post by Radar »

Hey Gang,

A couple of weeks back, I posted what I think is a handy indicator, at http://www.stevehopwoodforex.com/phpBB3 ... 700#p39700

It shows the total pips won or lost for trades opened each hour of the day, for each symbol using the same magic number, (though it would be handy if somebody could modify it to show stats for days of the week as well).

Since BBBE has different MagicNo's for trend trades and scalp trades, we can use it to help tune trading times for each of them.

Hope this helps.

Have fun!

Radar =8^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
User avatar
snailbeard
Trader
Posts: 615
Joined: Mon Dec 24, 2012 10:54 am
Location: Just above water somewhere between Oxford & Cambridge

Re: Bob's Biggest Balls Ever

Post by snailbeard »

Hi All,

For a couple of weeks between other things I have been observing and investigating BBBE trades, templates 10.3 and 10.4. It took quite a few edits to my debug copy of BBBE for me to run and collect back-testing and some trace information.

I was investigating the following observations (version 1m)
a) BBBE on one machine (2 core cpu, 3GB memory) was using 90% + 90% cpu
b) There seemed to be scalping too often when it did not look like a promising entry
c) There seemed to be too few trend trades or none at all
d) The colours of the 10.3 bars were sometimes opposite between
- i) BBBE and the chart
- ii) A chart using template 10.3 and one using 10.4
e) On Friday, I noticed that my debugging BBBE on FXDD had different colour 10.3 bars to one running on AlpariUK
(I was investigating a scalp buy entry for AUDCAD)

Since I am new to the code and templates I did not post my preliminary findings until I had more confidence in my understanding and results.
Also since I had to make changes to the code in order to back-test and gather data: my copy of BBBE is no longer the real BBBE, some results could be flawed and since back-testing is a nightmare on T4 I cannot fully trust anything that comes out of ST, which is another reason I haven't posted some results I had over a week ago.
I am running under WINE on Linux which is another factor which could have an influence on results.

So here are my findings:

Performance

I am not seeing any problem on my main machine I could probably run 10 copies of Empty4 & BBBE.
However, I ran a basic performance analysis to find out where most of the cpu work is done and most of the effort went into
- a) manipulating strings
- b) and updating the screen (when user feedback is active - I have this constantly on at the moment)

I have accidentally over tweaked the refresh of the screen and now have to manually change chart period to get an update - which could be why I am seeing so little load on the cpu now.

Trend Trades

My first back-test was on USDJPY for two months in 2011 and I had hardly any trend trades.
I added variables to count the number of times a particular rule passed in order to understand which rules might have excessive filtering.

I ran another test, this time for GPDUSD:
December 2012:

Sell (Trend) rules passed (cumulative):

Weekly Piv. < Monthly Piv.........63775
Off or Daily Piv. < Weekly Piv....44174
Open trend trades < Max...........44174
Off or Trend slope < threshold....20295
15 min bar Open above Daily Piv...5115
Bid < Daily Pivot........................5115
Trading is allowed.......................5115
No Zeljko or BalancedPair............1608
Trade short enabled....................1564
Trend trading for today over........1023
No ADX or ADX good for sell.............0
No check or Doji check ok................0

----

Buy (Trend) rules passed (cumulative):

Weekly Piv. > Monthly Piv.........235583
Off or Daily Piv. > Weekly Piv....152923
Open trend trades < Max...........152923
Off or Trend slope > threshold....115624
15 min bar Open below Daily Piv...73907
Bid > Daily Pivot...........................405
Trading is allowed..........................146
No Zeljko or BalancedPair...............146
Trade long enabled........................146
Trend trading for today over............146
No ADX or ADX good for buy.............64
No check or Doji check ok..................1

It is possible that when I was editing the nested if statements I broke something,
I need to do more checking to be sure these are the same results one would get on the real BBBE (v1m). This is bit like Heisenberg's uncertainty principle :)

----------------------------
Coloured bars - sometimes different between BBBE, charts and other crim Empty4

This could be two separate issues
One cause could be an offset in the first hour of the day affecting the value of Daily Open.
I see that there is code to compensate for this already:
BBBE uses
either

Code: Select all

            symbolValues[i][iDO] = iOpen( symbolNames[i], PERIOD_H1, shiftHour );
or

Code: Select all

            symbolValues[i][iDO] = iMA( symbolNames[i], PERIOD_D1, 1, 0, MODE_SMA, PRICE_OPEN, 0 );
and
DWMPivot for template 10.3 uses the same logic as BBBE

whereas

DWMPivot for template 10.4 version "v1.0.10" uses different logic

Code: Select all

         DO = iMA(NULL, PERIOD_H4, 240, 0, MODE_LWMA, PRICE_OPEN, 0);
This accounts for the difference between BBBE user feedback and the 10.4 chart,
on my 10.4 chart this gives a DO line at the latest value of the 240 MA for the current bar rather than the real DO.

---------------------------------
Scalping too often when it did not look like a promising entry

I don't have enough data on this, I have only gone deeply into to Friday's scalp
Buy AUDCAD at 14:57
Both the Tma slope of 10.3 and the AO/Sto of 10.4 did not favour a buy trade
The AO/STO was confidently predicting a sell trade several hours earlier
the STO bottomed and was pointing up at the time the buy trade
but the the AO was completely red and going down.
--------------------------------------------
If any of the above is useful I could do some more digging?

I have to leave it there for now, the boss is calling for her Sunday morning Tea and Toast in bed.

Thank you to everyone who has contributed to 10.x and BBBE
I hope I can contribute in a small way too.

Snailbeard
Post Reply

Return to “Automated trading systems”