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 »

Wiggy1965 wrote:i had the GU one the other day, i posted abut it...;-)

did you have fun closing all those trades...;-)

Wiggy
@ Wiggy1965,

Here is a script that makes it a snap to close all open or pending trades.

-Frank
You do not have the required permissions to view the files attached to this post.
House Brick
Posts: 2
Joined: Mon Sep 03, 2012 9:59 pm

Re: Bob's Biggest Balls Ever

Post by House Brick »

SteveHopwood wrote:Just had umpteen GU NY trend sell trades sent, so there is something wrong in the code that allows a new trade each day. I will look at this over the weekend.

:D

Code: Select all

int CountOpenTrendTrades()
{
   //Counts the number of open trend trades
   if (OrdersTotal() == 0) return(0);
   int OpenTrades;

   for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
   {
      if (!OrderSelect(cc, SELECT_BY_POS) ) continue;
      if (OrderSymbol() != Symbol() ) continue;
      if (OrderMagicNumber() != TrendMagicNumber) continue;

      OpenTrades++;
      //We only want one trend trade a day
      if (TimeDayOfWeek(OrderOpenTime()) == TimeDayOfWeek(TimeLocal()) ) TrendTradingDoneForToday = true;
   }//for (int cc = OrdersTotal() - 1; cc >= 0; cc--)

   return(OpenTrades);

}//End int CountOpenTrendTrades()
[/size]

The variable OpenTrades isn't being initialised before being incremented. Not sure what Empty4 does, are ints defaulted to zero? If not, it could have random crap in like -12 so even when incremented

Code: Select all

if (CountOpenTrendTrades() <= MaxTrades)//3
[/size]
will always pass. Or it could sometimes have a bigger number e.g. 1012 which would stop some valid trades.

But

Code: Select all

//Look for a long 10.2A trend trade
. . .
if (!TrendTradingDoneForToday)//8
[/size]
Should block later on when OpenTrades is randomly negative unless

Code: Select all

if (TimeDayOfWeek(OrderOpenTime()) == TimeDayOfWeek(TimeLocal()) ) TrendTradingDoneForToday = true;
[/size]
Isn't doing what it should.

Is Order Open Time Local time or Criminal time? Seems to be Criminal time, (it looks like it is for my Oanda acct). Sometimes Criminal and Local time will overlap which would explain why this isn't happening all the time.

So we need:

Code: Select all

int OpenTrades = 0;
. . .
if (TimeDayOfWeek(OrderOpenTime()) == TimeDayOfWeek(TimeCurrent()) ) TrendTradingDoneForToday = true;
[/size]

However:

Code: Select all

//Look for a long 10.2A trend trade
. . .
            if (CountOpenTrendTrades() <= MaxTrades)//3
. . .
                                 if (!TrendTradingDoneForToday)//8
[/size]

Can you spot the problem, #3 allows up to MaxTrades but #8 TrendTradingDoneForToday blocks after 1 trade. I suggest removing the !TrendTradingDoneForToday check in the Trade allowed filters as being the easiest thing to do.

I'm just guessing though.

Ta,
HouseBrick
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 »

House Brick wrote:Can you spot the problem, #3 allows up to MaxTrades but #8 TrendTradingDoneForToday blocks after 1 trade. I suggest removing the !TrendTradingDoneForToday check in the Trade allowed filters as being the easiest thing to do.

I'm just guessing though.

Ta,
HouseBrick
Thanks again.

I have learned/been taught not to trust Crapql4 documentation and normally explicitly initialise variables. I forgot to do this here with OpenTrades.

Re the #8

Code: Select all

if  (TimeDayOfWeek(OrderOpenTime()) == TimeDayOfWeek(TimeLocal()) ) TrendTradingDoneForToday = true;
check, this is essential. The code allows for scaling in of trend trades at the rate of one per day, so BBBE needs to know when this trade has been taken. Whether this check should be as is or should actually be

Code: Select all

if  (TimeDayOfWeek(OrderOpenTime()) == TimeDayOfWeek(TimeCurrent()) ) TrendTradingDoneForToday = true;
is another matter. I have coded what I coded because I decided to code it that way. It might be better coded differently - don't know.

So, the next update will have OpenTrades explicitly declared to zero. To be honest, I cannot see this making any difference, but accurate code is always better than my usual rubbish.

Do me a favour, please, and cast your eagle eye over the O_R_CheckForHistory code. This is industrial strength code provided by one of the best in the business and it is foolproof. Thing is, Matt's original code is for single pair EA's, so there is always the possibility that I have mucked up its translation for multi-pair use. I cannot see anything wrong, but that means not a lot.

: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.
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 »

V 1l is in post 1, with a fix for the implicit/explicit thingy that HB spotted.

Do I think this will make a scrap of difference? Nope, but we can hope. It will save a hell of a lot of bug-hunting if it does.

: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.
User avatar
McNish
Trader
Posts: 227
Joined: Tue Nov 06, 2012 3:56 pm

Re: Bob's Biggest Balls Ever

Post by McNish »

CADCHF gone berserk for 10.2 short on V1l. Suspended EA for now, will resume an hour later with new H1 candle formation. Anyone else?
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 »

V 1m is in post 1. I found the cause of the repeated order sends as soon as I looked for it. It is the most gormless mistake imaginable. Hey ho.

Those of you who can, go to int CountOpenTrendTrades() and change it to int CountOpenTrendTrades(string symbol). Then change the reference to Symbol() to symbol.

Recompile and follow the links to the two errors this generates and change CountOpenTrendTrades() to CountOpenTrendTrades(symbol).

: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.
User avatar
McNish
Trader
Posts: 227
Joined: Tue Nov 06, 2012 3:56 pm

Re: Bob's Biggest Balls Ever

Post by McNish »

Thanks Steve, Will edit and report back.
User avatar
babalu4u
Trader
Posts: 173
Joined: Fri Apr 13, 2012 6:52 pm
Location: Slovenia - EU

Re: Bob's Biggest Balls Ever

Post by babalu4u »

Hi Steve,

the bot on my Cowboy IBFX au mini account have a problem to set tp....
You do not have the required permissions to view the files attached to this post.
User avatar
ovisun
Trader
Posts: 63
Joined: Sun Mar 18, 2012 11:54 am
Location: Romania, Constanta

Re: Bob's Biggest Balls Ever

Post by ovisun »

case 130: Error Invalid stops
Check if broker is ecn or not
Image
User avatar
blinkxzero
Trader
Posts: 10
Joined: Mon Jan 28, 2013 12:20 am

Re: Bob's Biggest Balls Ever

Post by blinkxzero »

ovisun wrote:case 130: Error Invalid stops
Check if broker is ecn or not
Would the error imply that the broker is ECN but the setting is not changed to true? Or would it mean the broker isn't ECN and the setting is set to true?

If you set CrimIsECN to true and your Crim is not ECN, would this result in an error or just use 2 steps to put in your order but still function properly?

Thanks for the clarification!
Post Reply

Return to “Automated trading systems”